|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6 |
| 2 | +; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx90a < %s | FileCheck -check-prefixes=GFX90A,GFX90A-SDAG %s |
| 3 | +; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx90a < %s | FileCheck -check-prefixes=GFX90A,GFX90A-GISEL %s |
| 4 | +; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx950 < %s | FileCheck -check-prefixes=GFX950,GFX950-SDAG %s |
| 5 | +; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx950 < %s | FileCheck -check-prefixes=GFX950,GFX950-GISEL %s |
| 6 | +; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GFX1250,GFX1250-SDAG %s |
| 7 | +; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1250 < %s | FileCheck -check-prefixes=GFX1250,GFX1250-GISEL %s |
| 8 | + |
| 9 | +define <2 x float> @fneg_v2f32_v(<2 x float> %first) { |
| 10 | +; GFX90A-LABEL: fneg_v2f32_v: |
| 11 | +; GFX90A: ; %bb.0: ; %bb |
| 12 | +; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 13 | +; GFX90A-NEXT: v_pk_add_f32 v[0:1], v[0:1], 0 neg_lo:[1,1] neg_hi:[1,1] |
| 14 | +; GFX90A-NEXT: s_setpc_b64 s[30:31] |
| 15 | +; |
| 16 | +; GFX950-LABEL: fneg_v2f32_v: |
| 17 | +; GFX950: ; %bb.0: ; %bb |
| 18 | +; GFX950-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 19 | +; GFX950-NEXT: v_pk_add_f32 v[0:1], v[0:1], 0 neg_lo:[1,1] neg_hi:[1,1] |
| 20 | +; GFX950-NEXT: s_setpc_b64 s[30:31] |
| 21 | +; |
| 22 | +; GFX1250-LABEL: fneg_v2f32_v: |
| 23 | +; GFX1250: ; %bb.0: ; %bb |
| 24 | +; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0 |
| 25 | +; GFX1250-NEXT: s_wait_kmcnt 0x0 |
| 26 | +; GFX1250-NEXT: v_pk_add_f32 v[0:1], v[0:1], 0 neg_lo:[1,1] neg_hi:[1,1] |
| 27 | +; GFX1250-NEXT: s_set_pc_i64 s[30:31] |
| 28 | +bb: |
| 29 | + %neg = fneg <2 x float> %first |
| 30 | + ret <2 x float> %neg |
| 31 | +} |
| 32 | + |
| 33 | +define <2 x float> @fabs_v2f32_v(<2 x float> %first) { |
| 34 | +; GFX90A-SDAG-LABEL: fabs_v2f32_v: |
| 35 | +; GFX90A-SDAG: ; %bb.0: ; %bb |
| 36 | +; GFX90A-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 37 | +; GFX90A-SDAG-NEXT: v_and_b32_e32 v0, 0x7fffffff, v0 |
| 38 | +; GFX90A-SDAG-NEXT: v_and_b32_e32 v1, 0x7fffffff, v1 |
| 39 | +; GFX90A-SDAG-NEXT: s_setpc_b64 s[30:31] |
| 40 | +; |
| 41 | +; GFX90A-GISEL-LABEL: fabs_v2f32_v: |
| 42 | +; GFX90A-GISEL: ; %bb.0: ; %bb |
| 43 | +; GFX90A-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 44 | +; GFX90A-GISEL-NEXT: v_and_b32_e32 v1, 0x7fffffff, v1 |
| 45 | +; GFX90A-GISEL-NEXT: v_and_b32_e32 v0, 0x7fffffff, v0 |
| 46 | +; GFX90A-GISEL-NEXT: s_setpc_b64 s[30:31] |
| 47 | +; |
| 48 | +; GFX950-SDAG-LABEL: fabs_v2f32_v: |
| 49 | +; GFX950-SDAG: ; %bb.0: ; %bb |
| 50 | +; GFX950-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 51 | +; GFX950-SDAG-NEXT: v_and_b32_e32 v0, 0x7fffffff, v0 |
| 52 | +; GFX950-SDAG-NEXT: v_and_b32_e32 v1, 0x7fffffff, v1 |
| 53 | +; GFX950-SDAG-NEXT: s_setpc_b64 s[30:31] |
| 54 | +; |
| 55 | +; GFX950-GISEL-LABEL: fabs_v2f32_v: |
| 56 | +; GFX950-GISEL: ; %bb.0: ; %bb |
| 57 | +; GFX950-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 58 | +; GFX950-GISEL-NEXT: v_and_b32_e32 v1, 0x7fffffff, v1 |
| 59 | +; GFX950-GISEL-NEXT: v_and_b32_e32 v0, 0x7fffffff, v0 |
| 60 | +; GFX950-GISEL-NEXT: s_setpc_b64 s[30:31] |
| 61 | +; |
| 62 | +; GFX1250-LABEL: fabs_v2f32_v: |
| 63 | +; GFX1250: ; %bb.0: ; %bb |
| 64 | +; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0 |
| 65 | +; GFX1250-NEXT: s_wait_kmcnt 0x0 |
| 66 | +; GFX1250-NEXT: v_and_b32_e32 v0, 0x7fffffff, v0 |
| 67 | +; GFX1250-NEXT: v_and_b32_e32 v1, 0x7fffffff, v1 |
| 68 | +; GFX1250-NEXT: s_set_pc_i64 s[30:31] |
| 69 | +bb: |
| 70 | + %abs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %first) |
| 71 | + ret <2 x float> %abs |
| 72 | +} |
| 73 | + |
| 74 | +define <2 x float> @fneg_fabs_v2f32_v(<2 x float> %first) { |
| 75 | +; GFX90A-LABEL: fneg_fabs_v2f32_v: |
| 76 | +; GFX90A: ; %bb.0: ; %bb |
| 77 | +; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 78 | +; GFX90A-NEXT: v_and_b32_e32 v1, 0x7fffffff, v1 |
| 79 | +; GFX90A-NEXT: v_and_b32_e32 v0, 0x7fffffff, v0 |
| 80 | +; GFX90A-NEXT: v_pk_add_f32 v[0:1], v[0:1], 0 neg_lo:[1,1] neg_hi:[1,1] |
| 81 | +; GFX90A-NEXT: s_setpc_b64 s[30:31] |
| 82 | +; |
| 83 | +; GFX950-LABEL: fneg_fabs_v2f32_v: |
| 84 | +; GFX950: ; %bb.0: ; %bb |
| 85 | +; GFX950-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 86 | +; GFX950-NEXT: v_and_b32_e32 v1, 0x7fffffff, v1 |
| 87 | +; GFX950-NEXT: v_and_b32_e32 v0, 0x7fffffff, v0 |
| 88 | +; GFX950-NEXT: v_pk_add_f32 v[0:1], v[0:1], 0 neg_lo:[1,1] neg_hi:[1,1] |
| 89 | +; GFX950-NEXT: s_setpc_b64 s[30:31] |
| 90 | +; |
| 91 | +; GFX1250-LABEL: fneg_fabs_v2f32_v: |
| 92 | +; GFX1250: ; %bb.0: ; %bb |
| 93 | +; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0 |
| 94 | +; GFX1250-NEXT: s_wait_kmcnt 0x0 |
| 95 | +; GFX1250-NEXT: v_and_b32_e32 v1, 0x7fffffff, v1 |
| 96 | +; GFX1250-NEXT: v_and_b32_e32 v0, 0x7fffffff, v0 |
| 97 | +; GFX1250-NEXT: s_delay_alu instid0(VALU_DEP_1) |
| 98 | +; GFX1250-NEXT: v_pk_add_f32 v[0:1], v[0:1], 0 neg_lo:[1,1] neg_hi:[1,1] |
| 99 | +; GFX1250-NEXT: s_set_pc_i64 s[30:31] |
| 100 | +bb: |
| 101 | + %abs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %first) |
| 102 | + %neg = fneg <2 x float> %abs |
| 103 | + ret <2 x float> %neg |
| 104 | +} |
| 105 | + |
| 106 | +define <2 x float> @fneg_v2f32_s(<2 x float> inreg %first) { |
| 107 | +; GFX90A-LABEL: fneg_v2f32_s: |
| 108 | +; GFX90A: ; %bb.0: ; %bb |
| 109 | +; GFX90A-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 110 | +; GFX90A-NEXT: s_xor_b32 s4, s17, 0x80000000 |
| 111 | +; GFX90A-NEXT: s_xor_b32 s5, s16, 0x80000000 |
| 112 | +; GFX90A-NEXT: v_mov_b32_e32 v0, s5 |
| 113 | +; GFX90A-NEXT: v_mov_b32_e32 v1, s4 |
| 114 | +; GFX90A-NEXT: s_setpc_b64 s[30:31] |
| 115 | +; |
| 116 | +; GFX950-LABEL: fneg_v2f32_s: |
| 117 | +; GFX950: ; %bb.0: ; %bb |
| 118 | +; GFX950-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 119 | +; GFX950-NEXT: s_xor_b32 s1, s1, 0x80000000 |
| 120 | +; GFX950-NEXT: s_xor_b32 s0, s0, 0x80000000 |
| 121 | +; GFX950-NEXT: v_mov_b32_e32 v0, s0 |
| 122 | +; GFX950-NEXT: v_mov_b32_e32 v1, s1 |
| 123 | +; GFX950-NEXT: s_setpc_b64 s[30:31] |
| 124 | +; |
| 125 | +; GFX1250-LABEL: fneg_v2f32_s: |
| 126 | +; GFX1250: ; %bb.0: ; %bb |
| 127 | +; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0 |
| 128 | +; GFX1250-NEXT: s_wait_kmcnt 0x0 |
| 129 | +; GFX1250-NEXT: s_xor_b32 s0, s0, 0x80000000 |
| 130 | +; GFX1250-NEXT: s_xor_b32 s1, s1, 0x80000000 |
| 131 | +; GFX1250-NEXT: s_delay_alu instid0(SALU_CYCLE_1) |
| 132 | +; GFX1250-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1 |
| 133 | +; GFX1250-NEXT: s_set_pc_i64 s[30:31] |
| 134 | +bb: |
| 135 | + %neg = fneg <2 x float> %first |
| 136 | + ret <2 x float> %neg |
| 137 | +} |
| 138 | + |
| 139 | +define <2 x float> @fabs_v2f32_s(<2 x float> inreg %first) { |
| 140 | +; GFX90A-SDAG-LABEL: fabs_v2f32_s: |
| 141 | +; GFX90A-SDAG: ; %bb.0: ; %bb |
| 142 | +; GFX90A-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 143 | +; GFX90A-SDAG-NEXT: s_bitset0_b32 s16, 31 |
| 144 | +; GFX90A-SDAG-NEXT: s_bitset0_b32 s17, 31 |
| 145 | +; GFX90A-SDAG-NEXT: v_mov_b32_e32 v0, s16 |
| 146 | +; GFX90A-SDAG-NEXT: v_mov_b32_e32 v1, s17 |
| 147 | +; GFX90A-SDAG-NEXT: s_setpc_b64 s[30:31] |
| 148 | +; |
| 149 | +; GFX90A-GISEL-LABEL: fabs_v2f32_s: |
| 150 | +; GFX90A-GISEL: ; %bb.0: ; %bb |
| 151 | +; GFX90A-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 152 | +; GFX90A-GISEL-NEXT: s_and_b32 s4, s17, 0x7fffffff |
| 153 | +; GFX90A-GISEL-NEXT: s_and_b32 s5, s16, 0x7fffffff |
| 154 | +; GFX90A-GISEL-NEXT: v_mov_b32_e32 v0, s5 |
| 155 | +; GFX90A-GISEL-NEXT: v_mov_b32_e32 v1, s4 |
| 156 | +; GFX90A-GISEL-NEXT: s_setpc_b64 s[30:31] |
| 157 | +; |
| 158 | +; GFX950-SDAG-LABEL: fabs_v2f32_s: |
| 159 | +; GFX950-SDAG: ; %bb.0: ; %bb |
| 160 | +; GFX950-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 161 | +; GFX950-SDAG-NEXT: s_bitset0_b32 s0, 31 |
| 162 | +; GFX950-SDAG-NEXT: s_bitset0_b32 s1, 31 |
| 163 | +; GFX950-SDAG-NEXT: v_mov_b32_e32 v0, s0 |
| 164 | +; GFX950-SDAG-NEXT: v_mov_b32_e32 v1, s1 |
| 165 | +; GFX950-SDAG-NEXT: s_setpc_b64 s[30:31] |
| 166 | +; |
| 167 | +; GFX950-GISEL-LABEL: fabs_v2f32_s: |
| 168 | +; GFX950-GISEL: ; %bb.0: ; %bb |
| 169 | +; GFX950-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 170 | +; GFX950-GISEL-NEXT: s_bitset0_b32 s1, 31 |
| 171 | +; GFX950-GISEL-NEXT: s_bitset0_b32 s0, 31 |
| 172 | +; GFX950-GISEL-NEXT: v_mov_b32_e32 v0, s0 |
| 173 | +; GFX950-GISEL-NEXT: v_mov_b32_e32 v1, s1 |
| 174 | +; GFX950-GISEL-NEXT: s_setpc_b64 s[30:31] |
| 175 | +; |
| 176 | +; GFX1250-LABEL: fabs_v2f32_s: |
| 177 | +; GFX1250: ; %bb.0: ; %bb |
| 178 | +; GFX1250-NEXT: s_wait_loadcnt_dscnt 0x0 |
| 179 | +; GFX1250-NEXT: s_wait_kmcnt 0x0 |
| 180 | +; GFX1250-NEXT: s_bitset0_b32 s0, 31 |
| 181 | +; GFX1250-NEXT: s_bitset0_b32 s1, 31 |
| 182 | +; GFX1250-NEXT: s_delay_alu instid0(SALU_CYCLE_1) |
| 183 | +; GFX1250-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1 |
| 184 | +; GFX1250-NEXT: s_set_pc_i64 s[30:31] |
| 185 | +bb: |
| 186 | + %abs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %first) |
| 187 | + ret <2 x float> %abs |
| 188 | +} |
| 189 | + |
| 190 | +define <2 x float> @fneg_fabs_v2f32_s(<2 x float> inreg %first) { |
| 191 | +; GFX90A-SDAG-LABEL: fneg_fabs_v2f32_s: |
| 192 | +; GFX90A-SDAG: ; %bb.0: ; %bb |
| 193 | +; GFX90A-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 194 | +; GFX90A-SDAG-NEXT: s_bitset0_b32 s17, 31 |
| 195 | +; GFX90A-SDAG-NEXT: s_bitset0_b32 s16, 31 |
| 196 | +; GFX90A-SDAG-NEXT: s_xor_b32 s4, s17, 0x80000000 |
| 197 | +; GFX90A-SDAG-NEXT: s_xor_b32 s5, s16, 0x80000000 |
| 198 | +; GFX90A-SDAG-NEXT: v_mov_b32_e32 v0, s5 |
| 199 | +; GFX90A-SDAG-NEXT: v_mov_b32_e32 v1, s4 |
| 200 | +; GFX90A-SDAG-NEXT: s_setpc_b64 s[30:31] |
| 201 | +; |
| 202 | +; GFX90A-GISEL-LABEL: fneg_fabs_v2f32_s: |
| 203 | +; GFX90A-GISEL: ; %bb.0: ; %bb |
| 204 | +; GFX90A-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 205 | +; GFX90A-GISEL-NEXT: s_or_b32 s4, s17, 0x80000000 |
| 206 | +; GFX90A-GISEL-NEXT: s_or_b32 s5, s16, 0x80000000 |
| 207 | +; GFX90A-GISEL-NEXT: v_mov_b32_e32 v0, s5 |
| 208 | +; GFX90A-GISEL-NEXT: v_mov_b32_e32 v1, s4 |
| 209 | +; GFX90A-GISEL-NEXT: s_setpc_b64 s[30:31] |
| 210 | +; |
| 211 | +; GFX950-SDAG-LABEL: fneg_fabs_v2f32_s: |
| 212 | +; GFX950-SDAG: ; %bb.0: ; %bb |
| 213 | +; GFX950-SDAG-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 214 | +; GFX950-SDAG-NEXT: s_bitset0_b32 s1, 31 |
| 215 | +; GFX950-SDAG-NEXT: s_bitset0_b32 s0, 31 |
| 216 | +; GFX950-SDAG-NEXT: s_xor_b32 s1, s1, 0x80000000 |
| 217 | +; GFX950-SDAG-NEXT: s_xor_b32 s0, s0, 0x80000000 |
| 218 | +; GFX950-SDAG-NEXT: v_mov_b32_e32 v0, s0 |
| 219 | +; GFX950-SDAG-NEXT: v_mov_b32_e32 v1, s1 |
| 220 | +; GFX950-SDAG-NEXT: s_setpc_b64 s[30:31] |
| 221 | +; |
| 222 | +; GFX950-GISEL-LABEL: fneg_fabs_v2f32_s: |
| 223 | +; GFX950-GISEL: ; %bb.0: ; %bb |
| 224 | +; GFX950-GISEL-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0) |
| 225 | +; GFX950-GISEL-NEXT: s_bitset1_b32 s1, 31 |
| 226 | +; GFX950-GISEL-NEXT: s_bitset1_b32 s0, 31 |
| 227 | +; GFX950-GISEL-NEXT: v_mov_b32_e32 v0, s0 |
| 228 | +; GFX950-GISEL-NEXT: v_mov_b32_e32 v1, s1 |
| 229 | +; GFX950-GISEL-NEXT: s_setpc_b64 s[30:31] |
| 230 | +; |
| 231 | +; GFX1250-SDAG-LABEL: fneg_fabs_v2f32_s: |
| 232 | +; GFX1250-SDAG: ; %bb.0: ; %bb |
| 233 | +; GFX1250-SDAG-NEXT: s_wait_loadcnt_dscnt 0x0 |
| 234 | +; GFX1250-SDAG-NEXT: s_wait_kmcnt 0x0 |
| 235 | +; GFX1250-SDAG-NEXT: s_bitset0_b32 s0, 31 |
| 236 | +; GFX1250-SDAG-NEXT: s_bitset0_b32 s1, 31 |
| 237 | +; GFX1250-SDAG-NEXT: s_xor_b32 s0, s0, 0x80000000 |
| 238 | +; GFX1250-SDAG-NEXT: s_xor_b32 s1, s1, 0x80000000 |
| 239 | +; GFX1250-SDAG-NEXT: s_delay_alu instid0(SALU_CYCLE_1) |
| 240 | +; GFX1250-SDAG-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1 |
| 241 | +; GFX1250-SDAG-NEXT: s_set_pc_i64 s[30:31] |
| 242 | +; |
| 243 | +; GFX1250-GISEL-LABEL: fneg_fabs_v2f32_s: |
| 244 | +; GFX1250-GISEL: ; %bb.0: ; %bb |
| 245 | +; GFX1250-GISEL-NEXT: s_wait_loadcnt_dscnt 0x0 |
| 246 | +; GFX1250-GISEL-NEXT: s_wait_kmcnt 0x0 |
| 247 | +; GFX1250-GISEL-NEXT: s_bitset1_b32 s0, 31 |
| 248 | +; GFX1250-GISEL-NEXT: s_bitset1_b32 s1, 31 |
| 249 | +; GFX1250-GISEL-NEXT: s_delay_alu instid0(SALU_CYCLE_1) |
| 250 | +; GFX1250-GISEL-NEXT: v_dual_mov_b32 v0, s0 :: v_dual_mov_b32 v1, s1 |
| 251 | +; GFX1250-GISEL-NEXT: s_set_pc_i64 s[30:31] |
| 252 | +bb: |
| 253 | + %abs = call <2 x float> @llvm.fabs.v2f32(<2 x float> %first) |
| 254 | + %neg = fneg <2 x float> %abs |
| 255 | + ret <2 x float> %neg |
| 256 | +} |
0 commit comments