Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 1 | # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py |
| 2 | # RUN: llc -mtriple=aarch64-- -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s |
| 3 | |
| 4 | --- | |
| 5 | target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" |
| 6 | |
Chih-Hung Hsieh | 43f0694 | 2019-12-19 15:01:08 -0800 | [diff] [blame^] | 7 | define i8 @const_s8() { ret i8 42 } |
| 8 | define i16 @const_s16() { ret i16 42 } |
Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 9 | define i32 @const_s32() { ret i32 42 } |
| 10 | define i64 @const_s64() { ret i64 1234567890123 } |
| 11 | |
| 12 | define i32 @fconst_s32() { ret i32 42 } |
| 13 | define i64 @fconst_s64() { ret i64 1234567890123 } |
| 14 | define float @fconst_s32_0() { ret float 0.0 } |
| 15 | define double @fconst_s64_0() { ret double 0.0 } |
| 16 | ... |
| 17 | |
| 18 | --- |
Chih-Hung Hsieh | 43f0694 | 2019-12-19 15:01:08 -0800 | [diff] [blame^] | 19 | name: const_s8 |
| 20 | legalized: true |
| 21 | regBankSelected: true |
| 22 | body: | |
| 23 | bb.0: |
| 24 | ; CHECK-LABEL: name: const_s8 |
| 25 | ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42 |
| 26 | ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY [[MOVi32imm]] |
| 27 | ; CHECK: $w0 = COPY [[COPY]] |
| 28 | %0:gpr(s8) = G_CONSTANT i8 42 |
| 29 | %1:gpr(s32) = G_ANYEXT %0(s8) |
| 30 | $w0 = COPY %1(s32) |
| 31 | ... |
| 32 | |
| 33 | --- |
| 34 | name: const_s16 |
| 35 | legalized: true |
| 36 | regBankSelected: true |
| 37 | body: | |
| 38 | bb.0: |
| 39 | ; CHECK-LABEL: name: const_s16 |
| 40 | ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42 |
| 41 | ; CHECK: [[COPY:%[0-9]+]]:gpr32all = COPY [[MOVi32imm]] |
| 42 | ; CHECK: $w0 = COPY [[COPY]] |
| 43 | %0:gpr(s16) = G_CONSTANT i16 42 |
| 44 | %1:gpr(s32) = G_ANYEXT %0(s16) |
| 45 | $w0 = COPY %1(s32) |
| 46 | ... |
| 47 | |
| 48 | --- |
Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 49 | name: const_s32 |
| 50 | legalized: true |
| 51 | regBankSelected: true |
| 52 | registers: |
| 53 | - { id: 0, class: gpr } |
| 54 | |
| 55 | body: | |
| 56 | bb.0: |
| 57 | ; CHECK-LABEL: name: const_s32 |
| 58 | ; CHECK: [[MOVi32imm:%[0-9]+]]:gpr32 = MOVi32imm 42 |
| 59 | ; CHECK: $w0 = COPY [[MOVi32imm]] |
| 60 | %0(s32) = G_CONSTANT i32 42 |
| 61 | $w0 = COPY %0(s32) |
| 62 | ... |
| 63 | |
| 64 | --- |
| 65 | name: const_s64 |
| 66 | legalized: true |
| 67 | regBankSelected: true |
| 68 | registers: |
| 69 | - { id: 0, class: gpr } |
| 70 | |
| 71 | body: | |
| 72 | bb.0: |
| 73 | ; CHECK-LABEL: name: const_s64 |
| 74 | ; CHECK: [[MOVi64imm:%[0-9]+]]:gpr64 = MOVi64imm 1234567890123 |
| 75 | ; CHECK: $x0 = COPY [[MOVi64imm]] |
| 76 | %0(s64) = G_CONSTANT i64 1234567890123 |
| 77 | $x0 = COPY %0(s64) |
| 78 | ... |
| 79 | |
| 80 | --- |
| 81 | name: fconst_s32 |
| 82 | legalized: true |
| 83 | regBankSelected: true |
| 84 | registers: |
| 85 | - { id: 0, class: fpr } |
| 86 | |
| 87 | body: | |
| 88 | bb.0: |
| 89 | ; CHECK-LABEL: name: fconst_s32 |
Chih-Hung Hsieh | 43f0694 | 2019-12-19 15:01:08 -0800 | [diff] [blame^] | 90 | ; CHECK: [[FMOVSi:%[0-9]+]]:fpr32 = FMOVSi 12 |
| 91 | ; CHECK: $s0 = COPY [[FMOVSi]] |
Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 92 | %0(s32) = G_FCONSTANT float 3.5 |
| 93 | $s0 = COPY %0(s32) |
| 94 | ... |
| 95 | |
| 96 | --- |
| 97 | name: fconst_s64 |
| 98 | legalized: true |
| 99 | regBankSelected: true |
| 100 | registers: |
| 101 | - { id: 0, class: fpr } |
| 102 | |
| 103 | body: | |
| 104 | bb.0: |
| 105 | ; CHECK-LABEL: name: fconst_s64 |
Chih-Hung Hsieh | 43f0694 | 2019-12-19 15:01:08 -0800 | [diff] [blame^] | 106 | ; CHECK: [[FMOVDi:%[0-9]+]]:fpr64 = FMOVDi 112 |
| 107 | ; CHECK: $d0 = COPY [[FMOVDi]] |
Inna Palant | ff3f07a | 2019-07-11 16:15:26 -0700 | [diff] [blame] | 108 | %0(s64) = G_FCONSTANT double 1.0 |
| 109 | $d0 = COPY %0(s64) |
| 110 | ... |
| 111 | |
| 112 | --- |
| 113 | name: fconst_s32_0 |
| 114 | legalized: true |
| 115 | regBankSelected: true |
| 116 | registers: |
| 117 | - { id: 0, class: fpr } |
| 118 | |
| 119 | body: | |
| 120 | bb.0: |
| 121 | ; CHECK-LABEL: name: fconst_s32_0 |
| 122 | ; CHECK: [[FMOVS0_:%[0-9]+]]:fpr32 = FMOVS0 |
| 123 | ; CHECK: $s0 = COPY [[FMOVS0_]] |
| 124 | %0(s32) = G_FCONSTANT float 0.0 |
| 125 | $s0 = COPY %0(s32) |
| 126 | ... |
| 127 | |
| 128 | --- |
| 129 | name: fconst_s64_0 |
| 130 | legalized: true |
| 131 | regBankSelected: true |
| 132 | registers: |
| 133 | - { id: 0, class: fpr } |
| 134 | |
| 135 | body: | |
| 136 | bb.0: |
| 137 | ; CHECK-LABEL: name: fconst_s64_0 |
| 138 | ; CHECK: [[FMOVD0_:%[0-9]+]]:fpr64 = FMOVD0 |
| 139 | ; CHECK: $x0 = COPY [[FMOVD0_]] |
| 140 | %0(s64) = G_FCONSTANT double 0.0 |
| 141 | $x0 = COPY %0(s64) |
| 142 | ... |