| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py |
| 2 |
// RUN: %clang_cc1 -ffreestanding -triple armv8a-none-eabi -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch32 |
| 3 |
// RUN: %clang_cc1 -ffreestanding -triple armv8a-none-eabi -target-feature +crc -target-feature +dsp -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch32 |
| 4 |
// RUN: %clang_cc1 -ffreestanding -Wno-error=implicit-function-declaration -triple aarch64-none-elf -target-feature +neon -target-feature +crc -target-feature +crypto -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch64 |
| 5 |
// RUN: %clang_cc1 -ffreestanding -triple aarch64-none-elf -target-feature +v8.3a -target-feature +crc -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch64,AArch6483 |
| 6 |
// RUN: %clang_cc1 -ffreestanding -triple aarch64-none-elf -target-feature +v8.5a -target-feature +crc -target-feature +rand -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch64,AArch6483,AArch6485 |
| 7 |
// RUN: %clang_cc1 -ffreestanding -triple aarch64-none-elf -target-feature +v9.4a -target-feature +crc -target-feature +rand -target-feature +d128 -O0 -disable-O0-optnone -emit-llvm -o - %s | opt -S -passes=mem2reg | FileCheck %s -check-prefixes=ARM,AArch64,AArch6483,AArch6485,AArch6494D128 |
| 8 |
|
| 9 |
|
| 10 |
#include <arm_acle.h> |
| 11 |
|
| 12 |
// REQUIRES: arm-registered-target,aarch64-registered-target |
| 13 |
|
| 14 |
/* 8 SYNCHRONIZATION, BARRIER AND HINT INTRINSICS */ |
| 15 |
/* 8.3 Memory Barriers */ |
| 16 |
|
| 17 |
// AArch32-LABEL: @test_dmb( |
| 18 |
// AArch32-NEXT: entry: |
| 19 |
// AArch32-NEXT: call void @llvm.arm.dmb(i32 1) |
| 20 |
// AArch32-NEXT: ret void |
| 21 |
// |
| 22 |
// AArch64-LABEL: @test_dmb( |
| 23 |
// AArch64-NEXT: entry: |
| 24 |
// AArch64-NEXT: call void @llvm.aarch64.dmb(i32 1) |
| 25 |
// AArch64-NEXT: ret void |
| 26 |
// |
| 27 |
void test_dmb(void) { |
| 28 |
__dmb(1); |
| 29 |
} |
| 30 |
|
| 31 |
// AArch32-LABEL: @test_dsb( |
| 32 |
// AArch32-NEXT: entry: |
| 33 |
// AArch32-NEXT: call void @llvm.arm.dsb(i32 2) |
| 34 |
// AArch32-NEXT: ret void |
| 35 |
// |
| 36 |
// AArch64-LABEL: @test_dsb( |
| 37 |
// AArch64-NEXT: entry: |
| 38 |
// AArch64-NEXT: call void @llvm.aarch64.dsb(i32 2) |
| 39 |
// AArch64-NEXT: ret void |
| 40 |
// |
| 41 |
void test_dsb(void) { |
| 42 |
__dsb(2); |
| 43 |
} |
| 44 |
|
| 45 |
// AArch32-LABEL: @test_isb( |
| 46 |
// AArch32-NEXT: entry: |
| 47 |
// AArch32-NEXT: call void @llvm.arm.isb(i32 3) |
| 48 |
// AArch32-NEXT: ret void |
| 49 |
// |
| 50 |
// AArch64-LABEL: @test_isb( |
| 51 |
// AArch64-NEXT: entry: |
| 52 |
// AArch64-NEXT: call void @llvm.aarch64.isb(i32 3) |
| 53 |
// AArch64-NEXT: ret void |
| 54 |
// |
| 55 |
void test_isb(void) { |
| 56 |
__isb(3); |
| 57 |
} |
| 58 |
|
| 59 |
/* 8.4 Hints */ |
| 60 |
// AArch32-LABEL: @test_yield( |
| 61 |
// AArch32-NEXT: entry: |
| 62 |
// AArch32-NEXT: call void @llvm.arm.hint(i32 1) |
| 63 |
// AArch32-NEXT: ret void |
| 64 |
// |
| 65 |
// AArch64-LABEL: @test_yield( |
| 66 |
// AArch64-NEXT: entry: |
| 67 |
// AArch64-NEXT: call void @llvm.aarch64.hint(i32 1) |
| 68 |
// AArch64-NEXT: ret void |
| 69 |
// |
| 70 |
void test_yield(void) { |
| 71 |
__yield(); |
| 72 |
} |
| 73 |
|
| 74 |
// AArch32-LABEL: @test_wfe( |
| 75 |
// AArch32-NEXT: entry: |
| 76 |
// AArch32-NEXT: call void @llvm.arm.hint(i32 2) |
| 77 |
// AArch32-NEXT: ret void |
| 78 |
// |
| 79 |
// AArch64-LABEL: @test_wfe( |
| 80 |
// AArch64-NEXT: entry: |
| 81 |
// AArch64-NEXT: call void @llvm.aarch64.hint(i32 2) |
| 82 |
// AArch64-NEXT: ret void |
| 83 |
// |
| 84 |
void test_wfe(void) { |
| 85 |
__wfe(); |
| 86 |
} |
| 87 |
|
| 88 |
// AArch32-LABEL: @test_wfi( |
| 89 |
// AArch32-NEXT: entry: |
| 90 |
// AArch32-NEXT: call void @llvm.arm.hint(i32 3) |
| 91 |
// AArch32-NEXT: ret void |
| 92 |
// |
| 93 |
// AArch64-LABEL: @test_wfi( |
| 94 |
// AArch64-NEXT: entry: |
| 95 |
// AArch64-NEXT: call void @llvm.aarch64.hint(i32 3) |
| 96 |
// AArch64-NEXT: ret void |
| 97 |
// |
| 98 |
void test_wfi(void) { |
| 99 |
__wfi(); |
| 100 |
} |
| 101 |
|
| 102 |
// AArch32-LABEL: @test_sev( |
| 103 |
// AArch32-NEXT: entry: |
| 104 |
// AArch32-NEXT: call void @llvm.arm.hint(i32 4) |
| 105 |
// AArch32-NEXT: ret void |
| 106 |
// |
| 107 |
// AArch64-LABEL: @test_sev( |
| 108 |
// AArch64-NEXT: entry: |
| 109 |
// AArch64-NEXT: call void @llvm.aarch64.hint(i32 4) |
| 110 |
// AArch64-NEXT: ret void |
| 111 |
// |
| 112 |
void test_sev(void) { |
| 113 |
__sev(); |
| 114 |
} |
| 115 |
|
| 116 |
// AArch32-LABEL: @test_sevl( |
| 117 |
// AArch32-NEXT: entry: |
| 118 |
// AArch32-NEXT: call void @llvm.arm.hint(i32 5) |
| 119 |
// AArch32-NEXT: ret void |
| 120 |
// |
| 121 |
// AArch64-LABEL: @test_sevl( |
| 122 |
// AArch64-NEXT: entry: |
| 123 |
// AArch64-NEXT: call void @llvm.aarch64.hint(i32 5) |
| 124 |
// AArch64-NEXT: ret void |
| 125 |
// |
| 126 |
void test_sevl(void) { |
| 127 |
__sevl(); |
| 128 |
} |
| 129 |
|
| 130 |
#ifdef __ARM_32BIT_STATE |
| 131 |
// AArch32-LABEL: @test_dbg( |
| 132 |
// AArch32-NEXT: entry: |
| 133 |
// AArch32-NEXT: call void @llvm.arm.dbg(i32 0) |
| 134 |
// AArch32-NEXT: ret void |
| 135 |
// |
| 136 |
void test_dbg(void) { |
| 137 |
__dbg(0); |
| 138 |
} |
| 139 |
#endif |
| 140 |
|
| 141 |
/* 8.5 Swap */ |
| 142 |
// ARM-LABEL: @test_swp( |
| 143 |
// ARM-NEXT: entry: |
| 144 |
// ARM-NEXT: [[TMP0:%.*]] = atomicrmw volatile xchg ptr [[P:%.*]], i32 [[X:%.*]] monotonic, align 4 |
| 145 |
// ARM-NEXT: ret void |
| 146 |
// |
| 147 |
void test_swp(uint32_t x, volatile void *p) { |
| 148 |
__swp(x, p); |
| 149 |
} |
| 150 |
|
| 151 |
/* 8.6 Memory prefetch intrinsics */ |
| 152 |
/* 8.6.1 Data prefetch */ |
| 153 |
// AArch32-LABEL: @test_pld( |
| 154 |
// AArch32-NEXT: entry: |
| 155 |
// AArch32-NEXT: call void @llvm.prefetch.p0(ptr null, i32 0, i32 3, i32 1) |
| 156 |
// AArch32-NEXT: ret void |
| 157 |
// |
| 158 |
// AArch64-LABEL: @test_pld( |
| 159 |
// AArch64-NEXT: entry: |
| 160 |
// AArch64-NEXT: call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 0, i32 0, i32 1) |
| 161 |
// AArch64-NEXT: ret void |
| 162 |
// |
| 163 |
void test_pld() { |
| 164 |
__pld(0); |
| 165 |
} |
| 166 |
|
| 167 |
#if defined(__ARM_64BIT_STATE) && defined(__ARM_PREFETCH_RANGE) |
| 168 |
|
| 169 |
// AArch64-LABEL: @test_pld_range( |
| 170 |
// AArch64-NEXT: entry: |
| 171 |
// AArch64-NEXT: call void @llvm.aarch64.range.prefetch(ptr null, i32 0, i32 1, i64 [[MD:%.*]]) |
| 172 |
// AArch64-NEXT: ret void |
| 173 |
// |
| 174 |
void test_pld_range(uint64_t md) { |
| 175 |
__pld_range(0, 1, md, 0); |
| 176 |
} |
| 177 |
|
| 178 |
// AArch64-LABEL: @test_pldx_range( |
| 179 |
// AArch64-NEXT: entry: |
| 180 |
// AArch64-NEXT: call void @llvm.aarch64.range.prefetch(ptr null, i32 0, i32 1, i64 -576460477427613697) |
| 181 |
// AArch64-NEXT: ret void |
| 182 |
// |
| 183 |
void test_pldx_range() { |
| 184 |
__pldx_range(0, 1, 2097151, 65536, -2097152, 15, 0); |
| 185 |
} |
| 186 |
|
| 187 |
#endif |
| 188 |
|
| 189 |
// AArch32-LABEL: @test_pldx( |
| 190 |
// AArch32-NEXT: entry: |
| 191 |
// AArch32-NEXT: call void @llvm.prefetch.p0(ptr null, i32 1, i32 3, i32 1) |
| 192 |
// AArch32-NEXT: ret void |
| 193 |
// |
| 194 |
// AArch64-LABEL: @test_pldx( |
| 195 |
// AArch64-NEXT: entry: |
| 196 |
// AArch64-NEXT: call void @llvm.aarch64.prefetch(ptr null, i32 1, i32 2, i32 0, i32 1) |
| 197 |
// AArch64-NEXT: ret void |
| 198 |
// |
| 199 |
void test_pldx() { |
| 200 |
__pldx(1, 2, 0, 0); |
| 201 |
} |
| 202 |
|
| 203 |
/* 8.6.2 Instruction prefetch */ |
| 204 |
// AArch32-LABEL: @test_pli( |
| 205 |
// AArch32-NEXT: entry: |
| 206 |
// AArch32-NEXT: call void @llvm.prefetch.p0(ptr null, i32 0, i32 3, i32 0) |
| 207 |
// AArch32-NEXT: ret void |
| 208 |
// |
| 209 |
// AArch64-LABEL: @test_pli( |
| 210 |
// AArch64-NEXT: entry: |
| 211 |
// AArch64-NEXT: call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 0, i32 0, i32 0) |
| 212 |
// AArch64-NEXT: ret void |
| 213 |
// |
| 214 |
void test_pli() { |
| 215 |
__pli(0); |
| 216 |
} |
| 217 |
|
| 218 |
// AArch32-LABEL: @test_plix( |
| 219 |
// AArch32-NEXT: entry: |
| 220 |
// AArch32-NEXT: call void @llvm.prefetch.p0(ptr null, i32 0, i32 3, i32 0) |
| 221 |
// AArch32-NEXT: ret void |
| 222 |
// |
| 223 |
// AArch64-LABEL: @test_plix( |
| 224 |
// AArch64-NEXT: entry: |
| 225 |
// AArch64-NEXT: call void @llvm.aarch64.prefetch(ptr null, i32 0, i32 2, i32 0, i32 0) |
| 226 |
// AArch64-NEXT: ret void |
| 227 |
// |
| 228 |
void test_plix() { |
| 229 |
__plix(2, 0, 0); |
| 230 |
} |
| 231 |
|
| 232 |
/* 8.7 NOP */ |
| 233 |
// AArch32-LABEL: @test_nop( |
| 234 |
// AArch32-NEXT: entry: |
| 235 |
// AArch32-NEXT: call void @llvm.arm.hint(i32 0) |
| 236 |
// AArch32-NEXT: ret void |
| 237 |
// |
| 238 |
// AArch64-LABEL: @test_nop( |
| 239 |
// AArch64-NEXT: entry: |
| 240 |
// AArch64-NEXT: call void @llvm.aarch64.hint(i32 0) |
| 241 |
// AArch64-NEXT: ret void |
| 242 |
// |
| 243 |
void test_nop(void) { |
| 244 |
__nop(); |
| 245 |
} |
| 246 |
|
| 247 |
/* 9 DATA-PROCESSING INTRINSICS */ |
| 248 |
|
| 249 |
/* 9.2 Miscellaneous data-processing intrinsics */ |
| 250 |
// ARM-LABEL: @test_ror( |
| 251 |
// ARM-NEXT: entry: |
| 252 |
// ARM-NEXT: [[REM_I:%.*]] = urem i32 [[Y:%.*]], 32 |
| 253 |
// ARM-NEXT: [[CMP_I:%.*]] = icmp eq i32 [[REM_I]], 0 |
| 254 |
// ARM-NEXT: br i1 [[CMP_I]], label [[IF_THEN_I:%.*]], label [[IF_END_I:%.*]] |
| 255 |
// ARM: if.then.i: |
| 256 |
// ARM-NEXT: br label [[__ROR_EXIT:%.*]] |
| 257 |
// ARM: if.end.i: |
| 258 |
// ARM-NEXT: [[SHR_I:%.*]] = lshr i32 [[X:%.*]], [[REM_I]] |
| 259 |
// ARM-NEXT: [[SUB_I:%.*]] = sub i32 32, [[REM_I]] |
| 260 |
// ARM-NEXT: [[SHL_I:%.*]] = shl i32 [[X]], [[SUB_I]] |
| 261 |
// ARM-NEXT: [[OR_I:%.*]] = or i32 [[SHR_I]], [[SHL_I]] |
| 262 |
// ARM-NEXT: br label [[__ROR_EXIT]] |
| 263 |
// ARM: __ror.exit: |
| 264 |
// ARM-NEXT: [[RETVAL_I_0:%.*]] = phi i32 [ [[X]], [[IF_THEN_I]] ], [ [[OR_I]], [[IF_END_I]] ] |
| 265 |
// ARM-NEXT: ret i32 [[RETVAL_I_0]] |
| 266 |
// |
| 267 |
uint32_t test_ror(uint32_t x, uint32_t y) { |
| 268 |
return __ror(x, y); |
| 269 |
} |
| 270 |
|
| 271 |
// AArch32-LABEL: @test_rorl( |
| 272 |
// AArch32-NEXT: entry: |
| 273 |
// AArch32-NEXT: [[REM_I_I:%.*]] = urem i32 [[Y:%.*]], 32 |
| 274 |
// AArch32-NEXT: [[CMP_I_I:%.*]] = icmp eq i32 [[REM_I_I]], 0 |
| 275 |
// AArch32-NEXT: br i1 [[CMP_I_I]], label [[IF_THEN_I_I:%.*]], label [[IF_END_I_I:%.*]] |
| 276 |
// AArch32: if.then.i.i: |
| 277 |
// AArch32-NEXT: br label [[__RORL_EXIT:%.*]] |
| 278 |
// AArch32: if.end.i.i: |
| 279 |
// AArch32-NEXT: [[SHR_I_I:%.*]] = lshr i32 [[X:%.*]], [[REM_I_I]] |
| 280 |
// AArch32-NEXT: [[SUB_I_I:%.*]] = sub i32 32, [[REM_I_I]] |
| 281 |
// AArch32-NEXT: [[SHL_I_I:%.*]] = shl i32 [[X]], [[SUB_I_I]] |
| 282 |
// AArch32-NEXT: [[OR_I_I:%.*]] = or i32 [[SHR_I_I]], [[SHL_I_I]] |
| 283 |
// AArch32-NEXT: br label [[__RORL_EXIT]] |
| 284 |
// AArch32: __rorl.exit: |
| 285 |
// AArch32-NEXT: [[RETVAL_I_I_0:%.*]] = phi i32 [ [[X]], [[IF_THEN_I_I]] ], [ [[OR_I_I]], [[IF_END_I_I]] ] |
| 286 |
// AArch32-NEXT: ret i32 [[RETVAL_I_I_0]] |
| 287 |
// |
| 288 |
// AArch64-LABEL: @test_rorl( |
| 289 |
// AArch64-NEXT: entry: |
| 290 |
// AArch64-NEXT: [[REM_I:%.*]] = urem i32 [[Y:%.*]], 64 |
| 291 |
// AArch64-NEXT: [[CMP_I:%.*]] = icmp eq i32 [[REM_I]], 0 |
| 292 |
// AArch64-NEXT: br i1 [[CMP_I]], label [[IF_THEN_I:%.*]], label [[IF_END_I:%.*]] |
| 293 |
// AArch64: if.then.i: |
| 294 |
// AArch64-NEXT: br label [[__RORLL_EXIT:%.*]] |
| 295 |
// AArch64: if.end.i: |
| 296 |
// AArch64-NEXT: [[SH_PROM_I:%.*]] = zext i32 [[REM_I]] to i64 |
| 297 |
// AArch64-NEXT: [[SHR_I:%.*]] = lshr i64 [[X:%.*]], [[SH_PROM_I]] |
| 298 |
// AArch64-NEXT: [[SUB_I:%.*]] = sub i32 64, [[REM_I]] |
| 299 |
// AArch64-NEXT: [[SH_PROM1_I:%.*]] = zext i32 [[SUB_I]] to i64 |
| 300 |
// AArch64-NEXT: [[SHL_I:%.*]] = shl i64 [[X]], [[SH_PROM1_I]] |
| 301 |
// AArch64-NEXT: [[OR_I:%.*]] = or i64 [[SHR_I]], [[SHL_I]] |
| 302 |
// AArch64-NEXT: br label [[__RORLL_EXIT]] |
| 303 |
// AArch64: __rorll.exit: |
| 304 |
// AArch64-NEXT: [[RETVAL_I_0:%.*]] = phi i64 [ [[X]], [[IF_THEN_I]] ], [ [[OR_I]], [[IF_END_I]] ] |
| 305 |
// AArch64-NEXT: ret i64 [[RETVAL_I_0]] |
| 306 |
// |
| 307 |
unsigned long test_rorl(unsigned long x, uint32_t y) { |
| 308 |
return __rorl(x, y); |
| 309 |
} |
| 310 |
|
| 311 |
// ARM-LABEL: @test_rorll( |
| 312 |
// ARM-NEXT: entry: |
| 313 |
// ARM-NEXT: [[REM_I:%.*]] = urem i32 [[Y:%.*]], 64 |
| 314 |
// ARM-NEXT: [[CMP_I:%.*]] = icmp eq i32 [[REM_I]], 0 |
| 315 |
// ARM-NEXT: br i1 [[CMP_I]], label [[IF_THEN_I:%.*]], label [[IF_END_I:%.*]] |
| 316 |
// ARM: if.then.i: |
| 317 |
// ARM-NEXT: br label [[__RORLL_EXIT:%.*]] |
| 318 |
// ARM: if.end.i: |
| 319 |
// ARM-NEXT: [[SH_PROM_I:%.*]] = zext i32 [[REM_I]] to i64 |
| 320 |
// ARM-NEXT: [[SHR_I:%.*]] = lshr i64 [[X:%.*]], [[SH_PROM_I]] |
| 321 |
// ARM-NEXT: [[SUB_I:%.*]] = sub i32 64, [[REM_I]] |
| 322 |
// ARM-NEXT: [[SH_PROM1_I:%.*]] = zext i32 [[SUB_I]] to i64 |
| 323 |
// ARM-NEXT: [[SHL_I:%.*]] = shl i64 [[X]], [[SH_PROM1_I]] |
| 324 |
// ARM-NEXT: [[OR_I:%.*]] = or i64 [[SHR_I]], [[SHL_I]] |
| 325 |
// ARM-NEXT: br label [[__RORLL_EXIT]] |
| 326 |
// ARM: __rorll.exit: |
| 327 |
// ARM-NEXT: [[RETVAL_I_0:%.*]] = phi i64 [ [[X]], [[IF_THEN_I]] ], [ [[OR_I]], [[IF_END_I]] ] |
| 328 |
// ARM-NEXT: ret i64 [[RETVAL_I_0]] |
| 329 |
// |
| 330 |
uint64_t test_rorll(uint64_t x, uint32_t y) { |
| 331 |
return __rorll(x, y); |
| 332 |
} |
| 333 |
|
| 334 |
// ARM-LABEL: @test_clz( |
| 335 |
// ARM-NEXT: entry: |
| 336 |
// ARM-NEXT: [[TMP0:%.*]] = call i32 @llvm.ctlz.i32(i32 [[T:%.*]], i1 false) |
| 337 |
// ARM-NEXT: ret i32 [[TMP0]] |
| 338 |
// |
| 339 |
unsigned test_clz(uint32_t t) { |
| 340 |
return __clz(t); |
| 341 |
} |
| 342 |
|
| 343 |
// AArch32-LABEL: @test_clzl( |
| 344 |
// AArch32-NEXT: entry: |
| 345 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.ctlz.i32(i32 [[T:%.*]], i1 false) |
| 346 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 347 |
// |
| 348 |
// AArch64-LABEL: @test_clzl( |
| 349 |
// AArch64-NEXT: entry: |
| 350 |
// AArch64-NEXT: [[TMP0:%.*]] = call i64 @llvm.ctlz.i64(i64 [[T:%.*]], i1 false) |
| 351 |
// AArch64-NEXT: [[CAST_I:%.*]] = trunc i64 [[TMP0]] to i32 |
| 352 |
// AArch64-NEXT: ret i32 [[CAST_I]] |
| 353 |
// |
| 354 |
unsigned test_clzl(unsigned long t) { |
| 355 |
return __clzl(t); |
| 356 |
} |
| 357 |
|
| 358 |
// ARM-LABEL: @test_clzll( |
| 359 |
// ARM-NEXT: entry: |
| 360 |
// ARM-NEXT: [[TMP0:%.*]] = call i64 @llvm.ctlz.i64(i64 [[T:%.*]], i1 false) |
| 361 |
// ARM-NEXT: [[CAST_I:%.*]] = trunc i64 [[TMP0]] to i32 |
| 362 |
// ARM-NEXT: ret i32 [[CAST_I]] |
| 363 |
// |
| 364 |
unsigned test_clzll(uint64_t t) { |
| 365 |
return __clzll(t); |
| 366 |
} |
| 367 |
|
| 368 |
// AArch32-LABEL: @test_cls( |
| 369 |
// AArch32-NEXT: entry: |
| 370 |
// AArch32-NEXT: [[CLS_I:%.*]] = call i32 @llvm.arm.cls(i32 [[T:%.*]]) |
| 371 |
// AArch32-NEXT: ret i32 [[CLS_I]] |
| 372 |
// |
| 373 |
// AArch64-LABEL: @test_cls( |
| 374 |
// AArch64-NEXT: entry: |
| 375 |
// AArch64-NEXT: [[CLS_I:%.*]] = call i32 @llvm.aarch64.cls(i32 [[T:%.*]]) |
| 376 |
// AArch64-NEXT: ret i32 [[CLS_I]] |
| 377 |
// |
| 378 |
unsigned test_cls(uint32_t t) { |
| 379 |
return __cls(t); |
| 380 |
} |
| 381 |
|
| 382 |
// AArch32-LABEL: @test_clsl( |
| 383 |
// AArch32-NEXT: entry: |
| 384 |
// AArch32-NEXT: [[CLS_I:%.*]] = call i32 @llvm.arm.cls(i32 [[T:%.*]]) |
| 385 |
// AArch32-NEXT: ret i32 [[CLS_I]] |
| 386 |
// |
| 387 |
// AArch64-LABEL: @test_clsl( |
| 388 |
// AArch64-NEXT: entry: |
| 389 |
// AArch64-NEXT: [[CLS_I:%.*]] = call i32 @llvm.aarch64.cls64(i64 [[T:%.*]]) |
| 390 |
// AArch64-NEXT: ret i32 [[CLS_I]] |
| 391 |
// |
| 392 |
unsigned test_clsl(unsigned long t) { |
| 393 |
return __clsl(t); |
| 394 |
} |
| 395 |
|
| 396 |
// AArch32-LABEL: @test_clsll( |
| 397 |
// AArch32-NEXT: entry: |
| 398 |
// AArch32-NEXT: [[CLS_I:%.*]] = call i32 @llvm.arm.cls64(i64 [[T:%.*]]) |
| 399 |
// AArch32-NEXT: ret i32 [[CLS_I]] |
| 400 |
// |
| 401 |
// AArch64-LABEL: @test_clsll( |
| 402 |
// AArch64-NEXT: entry: |
| 403 |
// AArch64-NEXT: [[CLS_I:%.*]] = call i32 @llvm.aarch64.cls64(i64 [[T:%.*]]) |
| 404 |
// AArch64-NEXT: ret i32 [[CLS_I]] |
| 405 |
// |
| 406 |
unsigned test_clsll(uint64_t t) { |
| 407 |
return __clsll(t); |
| 408 |
} |
| 409 |
|
| 410 |
// ARM-LABEL: @test_rev( |
| 411 |
// ARM-NEXT: entry: |
| 412 |
// ARM-NEXT: [[TMP0:%.*]] = call i32 @llvm.bswap.i32(i32 [[T:%.*]]) |
| 413 |
// ARM-NEXT: ret i32 [[TMP0]] |
| 414 |
// |
| 415 |
uint32_t test_rev(uint32_t t) { |
| 416 |
return __rev(t); |
| 417 |
} |
| 418 |
|
| 419 |
// AArch32-LABEL: @test_revl( |
| 420 |
// AArch32-NEXT: entry: |
| 421 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.bswap.i32(i32 [[T:%.*]]) |
| 422 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 423 |
// |
| 424 |
// AArch64-LABEL: @test_revl( |
| 425 |
// AArch64-NEXT: entry: |
| 426 |
// AArch64-NEXT: [[TMP0:%.*]] = call i64 @llvm.bswap.i64(i64 [[T:%.*]]) |
| 427 |
// AArch64-NEXT: ret i64 [[TMP0]] |
| 428 |
// |
| 429 |
long test_revl(long t) { |
| 430 |
return __revl(t); |
| 431 |
} |
| 432 |
|
| 433 |
// ARM-LABEL: @test_revll( |
| 434 |
// ARM-NEXT: entry: |
| 435 |
// ARM-NEXT: [[TMP0:%.*]] = call i64 @llvm.bswap.i64(i64 [[T:%.*]]) |
| 436 |
// ARM-NEXT: ret i64 [[TMP0]] |
| 437 |
// |
| 438 |
uint64_t test_revll(uint64_t t) { |
| 439 |
return __revll(t); |
| 440 |
} |
| 441 |
|
| 442 |
// ARM-LABEL: @test_rev16( |
| 443 |
// ARM-NEXT: entry: |
| 444 |
// ARM-NEXT: [[TMP0:%.*]] = call i32 @llvm.bswap.i32(i32 [[T:%.*]]) |
| 445 |
// ARM-NEXT: [[REM_I_I:%.*]] = urem i32 16, 32 |
| 446 |
// ARM-NEXT: [[CMP_I_I:%.*]] = icmp eq i32 [[REM_I_I]], 0 |
| 447 |
// ARM-NEXT: br i1 [[CMP_I_I]], label [[IF_THEN_I_I:%.*]], label [[IF_END_I_I:%.*]] |
| 448 |
// ARM: if.then.i.i: |
| 449 |
// ARM-NEXT: br label [[__REV16_EXIT:%.*]] |
| 450 |
// ARM: if.end.i.i: |
| 451 |
// ARM-NEXT: [[SHR_I_I:%.*]] = lshr i32 [[TMP0]], [[REM_I_I]] |
| 452 |
// ARM-NEXT: [[SUB_I_I:%.*]] = sub i32 32, [[REM_I_I]] |
| 453 |
// ARM-NEXT: [[SHL_I_I:%.*]] = shl i32 [[TMP0]], [[SUB_I_I]] |
| 454 |
// ARM-NEXT: [[OR_I_I:%.*]] = or i32 [[SHR_I_I]], [[SHL_I_I]] |
| 455 |
// ARM-NEXT: br label [[__REV16_EXIT]] |
| 456 |
// ARM: __rev16.exit: |
| 457 |
// ARM-NEXT: [[RETVAL_I_I_0:%.*]] = phi i32 [ [[TMP0]], [[IF_THEN_I_I]] ], [ [[OR_I_I]], [[IF_END_I_I]] ] |
| 458 |
// ARM-NEXT: ret i32 [[RETVAL_I_I_0]] |
| 459 |
// |
| 460 |
uint32_t test_rev16(uint32_t t) { |
| 461 |
return __rev16(t); |
| 462 |
} |
| 463 |
|
| 464 |
// AArch32-LABEL: @test_rev16l( |
| 465 |
// AArch32-NEXT: entry: |
| 466 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.bswap.i32(i32 [[T:%.*]]) |
| 467 |
// AArch32-NEXT: [[REM_I_I_I:%.*]] = urem i32 16, 32 |
| 468 |
// AArch32-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i32 [[REM_I_I_I]], 0 |
| 469 |
// AArch32-NEXT: br i1 [[CMP_I_I_I]], label [[IF_THEN_I_I_I:%.*]], label [[IF_END_I_I_I:%.*]] |
| 470 |
// AArch32: if.then.i.i.i: |
| 471 |
// AArch32-NEXT: br label [[__REV16L_EXIT:%.*]] |
| 472 |
// AArch32: if.end.i.i.i: |
| 473 |
// AArch32-NEXT: [[SHR_I_I_I:%.*]] = lshr i32 [[TMP0]], [[REM_I_I_I]] |
| 474 |
// AArch32-NEXT: [[SUB_I_I_I:%.*]] = sub i32 32, [[REM_I_I_I]] |
| 475 |
// AArch32-NEXT: [[SHL_I_I_I:%.*]] = shl i32 [[TMP0]], [[SUB_I_I_I]] |
| 476 |
// AArch32-NEXT: [[OR_I_I_I:%.*]] = or i32 [[SHR_I_I_I]], [[SHL_I_I_I]] |
| 477 |
// AArch32-NEXT: br label [[__REV16L_EXIT]] |
| 478 |
// AArch32: __rev16l.exit: |
| 479 |
// AArch32-NEXT: [[RETVAL_I_I_I_0:%.*]] = phi i32 [ [[TMP0]], [[IF_THEN_I_I_I]] ], [ [[OR_I_I_I]], [[IF_END_I_I_I]] ] |
| 480 |
// AArch32-NEXT: ret i32 [[RETVAL_I_I_I_0]] |
| 481 |
// |
| 482 |
// AArch64-LABEL: @test_rev16l( |
| 483 |
// AArch64-NEXT: entry: |
| 484 |
// AArch64-NEXT: [[SHR_I:%.*]] = lshr i64 [[T:%.*]], 32 |
| 485 |
// AArch64-NEXT: [[CONV_I:%.*]] = trunc i64 [[SHR_I]] to i32 |
| 486 |
// AArch64-NEXT: [[TMP0:%.*]] = call i32 @llvm.bswap.i32(i32 [[CONV_I]]) |
| 487 |
// AArch64-NEXT: [[REM_I_I10_I:%.*]] = urem i32 16, 32 |
| 488 |
// AArch64-NEXT: [[CMP_I_I11_I:%.*]] = icmp eq i32 [[REM_I_I10_I]], 0 |
| 489 |
// AArch64-NEXT: br i1 [[CMP_I_I11_I]], label [[IF_THEN_I_I17_I:%.*]], label [[IF_END_I_I12_I:%.*]] |
| 490 |
// AArch64: if.then.i.i17.i: |
| 491 |
// AArch64-NEXT: br label [[__REV16_EXIT18_I:%.*]] |
| 492 |
// AArch64: if.end.i.i12.i: |
| 493 |
// AArch64-NEXT: [[SHR_I_I13_I:%.*]] = lshr i32 [[TMP0]], [[REM_I_I10_I]] |
| 494 |
// AArch64-NEXT: [[SUB_I_I14_I:%.*]] = sub i32 32, [[REM_I_I10_I]] |
| 495 |
// AArch64-NEXT: [[SHL_I_I15_I:%.*]] = shl i32 [[TMP0]], [[SUB_I_I14_I]] |
| 496 |
// AArch64-NEXT: [[OR_I_I16_I:%.*]] = or i32 [[SHR_I_I13_I]], [[SHL_I_I15_I]] |
| 497 |
// AArch64-NEXT: br label [[__REV16_EXIT18_I]] |
| 498 |
// AArch64: __rev16.exit18.i: |
| 499 |
// AArch64-NEXT: [[RETVAL_I_I6_I_0:%.*]] = phi i32 [ [[TMP0]], [[IF_THEN_I_I17_I]] ], [ [[OR_I_I16_I]], [[IF_END_I_I12_I]] ] |
| 500 |
// AArch64-NEXT: [[CONV1_I:%.*]] = zext i32 [[RETVAL_I_I6_I_0]] to i64 |
| 501 |
// AArch64-NEXT: [[SHL_I:%.*]] = shl i64 [[CONV1_I]], 32 |
| 502 |
// AArch64-NEXT: [[CONV2_I:%.*]] = trunc i64 [[T]] to i32 |
| 503 |
// AArch64-NEXT: [[TMP1:%.*]] = call i32 @llvm.bswap.i32(i32 [[CONV2_I]]) |
| 504 |
// AArch64-NEXT: [[REM_I_I_I:%.*]] = urem i32 16, 32 |
| 505 |
// AArch64-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i32 [[REM_I_I_I]], 0 |
| 506 |
// AArch64-NEXT: br i1 [[CMP_I_I_I]], label [[IF_THEN_I_I_I:%.*]], label [[IF_END_I_I_I:%.*]] |
| 507 |
// AArch64: if.then.i.i.i: |
| 508 |
// AArch64-NEXT: br label [[__REV16LL_EXIT:%.*]] |
| 509 |
// AArch64: if.end.i.i.i: |
| 510 |
// AArch64-NEXT: [[SHR_I_I_I:%.*]] = lshr i32 [[TMP1]], [[REM_I_I_I]] |
| 511 |
// AArch64-NEXT: [[SUB_I_I_I:%.*]] = sub i32 32, [[REM_I_I_I]] |
| 512 |
// AArch64-NEXT: [[SHL_I_I_I:%.*]] = shl i32 [[TMP1]], [[SUB_I_I_I]] |
| 513 |
// AArch64-NEXT: [[OR_I_I_I:%.*]] = or i32 [[SHR_I_I_I]], [[SHL_I_I_I]] |
| 514 |
// AArch64-NEXT: br label [[__REV16LL_EXIT]] |
| 515 |
// AArch64: __rev16ll.exit: |
| 516 |
// AArch64-NEXT: [[RETVAL_I_I_I_0:%.*]] = phi i32 [ [[TMP1]], [[IF_THEN_I_I_I]] ], [ [[OR_I_I_I]], [[IF_END_I_I_I]] ] |
| 517 |
// AArch64-NEXT: [[CONV4_I:%.*]] = zext i32 [[RETVAL_I_I_I_0]] to i64 |
| 518 |
// AArch64-NEXT: [[OR_I:%.*]] = or i64 [[SHL_I]], [[CONV4_I]] |
| 519 |
// AArch64-NEXT: ret i64 [[OR_I]] |
| 520 |
// |
| 521 |
long test_rev16l(long t) { |
| 522 |
return __rev16l(t); |
| 523 |
} |
| 524 |
|
| 525 |
// ARM-LABEL: @test_rev16ll( |
| 526 |
// ARM-NEXT: entry: |
| 527 |
// ARM-NEXT: [[SHR_I:%.*]] = lshr i64 [[T:%.*]], 32 |
| 528 |
// ARM-NEXT: [[CONV_I:%.*]] = trunc i64 [[SHR_I]] to i32 |
| 529 |
// ARM-NEXT: [[TMP0:%.*]] = call i32 @llvm.bswap.i32(i32 [[CONV_I]]) |
| 530 |
// ARM-NEXT: [[REM_I_I10_I:%.*]] = urem i32 16, 32 |
| 531 |
// ARM-NEXT: [[CMP_I_I11_I:%.*]] = icmp eq i32 [[REM_I_I10_I]], 0 |
| 532 |
// ARM-NEXT: br i1 [[CMP_I_I11_I]], label [[IF_THEN_I_I17_I:%.*]], label [[IF_END_I_I12_I:%.*]] |
| 533 |
// ARM: if.then.i.i17.i: |
| 534 |
// ARM-NEXT: br label [[__REV16_EXIT18_I:%.*]] |
| 535 |
// ARM: if.end.i.i12.i: |
| 536 |
// ARM-NEXT: [[SHR_I_I13_I:%.*]] = lshr i32 [[TMP0]], [[REM_I_I10_I]] |
| 537 |
// ARM-NEXT: [[SUB_I_I14_I:%.*]] = sub i32 32, [[REM_I_I10_I]] |
| 538 |
// ARM-NEXT: [[SHL_I_I15_I:%.*]] = shl i32 [[TMP0]], [[SUB_I_I14_I]] |
| 539 |
// ARM-NEXT: [[OR_I_I16_I:%.*]] = or i32 [[SHR_I_I13_I]], [[SHL_I_I15_I]] |
| 540 |
// ARM-NEXT: br label [[__REV16_EXIT18_I]] |
| 541 |
// ARM: __rev16.exit18.i: |
| 542 |
// ARM-NEXT: [[RETVAL_I_I6_I_0:%.*]] = phi i32 [ [[TMP0]], [[IF_THEN_I_I17_I]] ], [ [[OR_I_I16_I]], [[IF_END_I_I12_I]] ] |
| 543 |
// ARM-NEXT: [[CONV1_I:%.*]] = zext i32 [[RETVAL_I_I6_I_0]] to i64 |
| 544 |
// ARM-NEXT: [[SHL_I:%.*]] = shl i64 [[CONV1_I]], 32 |
| 545 |
// ARM-NEXT: [[CONV2_I:%.*]] = trunc i64 [[T]] to i32 |
| 546 |
// ARM-NEXT: [[TMP1:%.*]] = call i32 @llvm.bswap.i32(i32 [[CONV2_I]]) |
| 547 |
// ARM-NEXT: [[REM_I_I_I:%.*]] = urem i32 16, 32 |
| 548 |
// ARM-NEXT: [[CMP_I_I_I:%.*]] = icmp eq i32 [[REM_I_I_I]], 0 |
| 549 |
// ARM-NEXT: br i1 [[CMP_I_I_I]], label [[IF_THEN_I_I_I:%.*]], label [[IF_END_I_I_I:%.*]] |
| 550 |
// ARM: if.then.i.i.i: |
| 551 |
// ARM-NEXT: br label [[__REV16LL_EXIT:%.*]] |
| 552 |
// ARM: if.end.i.i.i: |
| 553 |
// ARM-NEXT: [[SHR_I_I_I:%.*]] = lshr i32 [[TMP1]], [[REM_I_I_I]] |
| 554 |
// ARM-NEXT: [[SUB_I_I_I:%.*]] = sub i32 32, [[REM_I_I_I]] |
| 555 |
// ARM-NEXT: [[SHL_I_I_I:%.*]] = shl i32 [[TMP1]], [[SUB_I_I_I]] |
| 556 |
// ARM-NEXT: [[OR_I_I_I:%.*]] = or i32 [[SHR_I_I_I]], [[SHL_I_I_I]] |
| 557 |
// ARM-NEXT: br label [[__REV16LL_EXIT]] |
| 558 |
// ARM: __rev16ll.exit: |
| 559 |
// ARM-NEXT: [[RETVAL_I_I_I_0:%.*]] = phi i32 [ [[TMP1]], [[IF_THEN_I_I_I]] ], [ [[OR_I_I_I]], [[IF_END_I_I_I]] ] |
| 560 |
// ARM-NEXT: [[CONV4_I:%.*]] = zext i32 [[RETVAL_I_I_I_0]] to i64 |
| 561 |
// ARM-NEXT: [[OR_I:%.*]] = or i64 [[SHL_I]], [[CONV4_I]] |
| 562 |
// ARM-NEXT: ret i64 [[OR_I]] |
| 563 |
// |
| 564 |
uint64_t test_rev16ll(uint64_t t) { |
| 565 |
return __rev16ll(t); |
| 566 |
} |
| 567 |
|
| 568 |
// ARM-LABEL: @test_revsh( |
| 569 |
// ARM-NEXT: entry: |
| 570 |
// ARM-NEXT: [[TMP0:%.*]] = call i16 @llvm.bswap.i16(i16 [[T:%.*]]) |
| 571 |
// ARM-NEXT: ret i16 [[TMP0]] |
| 572 |
// |
| 573 |
int16_t test_revsh(int16_t t) { |
| 574 |
return __revsh(t); |
| 575 |
} |
| 576 |
|
| 577 |
// ARM-LABEL: @test_rbit( |
| 578 |
// ARM-NEXT: entry: |
| 579 |
// ARM-NEXT: [[RBIT_I:%.*]] = call i32 @llvm.bitreverse.i32(i32 [[T:%.*]]) |
| 580 |
// ARM-NEXT: ret i32 [[RBIT_I]] |
| 581 |
// |
| 582 |
uint32_t test_rbit(uint32_t t) { |
| 583 |
return __rbit(t); |
| 584 |
} |
| 585 |
|
| 586 |
// AArch32-LABEL: @test_rbitl( |
| 587 |
// AArch32-NEXT: entry: |
| 588 |
// AArch32-NEXT: [[RBIT_I_I:%.*]] = call i32 @llvm.bitreverse.i32(i32 [[T:%.*]]) |
| 589 |
// AArch32-NEXT: ret i32 [[RBIT_I_I]] |
| 590 |
// |
| 591 |
// AArch64-LABEL: @test_rbitl( |
| 592 |
// AArch64-NEXT: entry: |
| 593 |
// AArch64-NEXT: [[RBIT_I:%.*]] = call i64 @llvm.bitreverse.i64(i64 [[T:%.*]]) |
| 594 |
// AArch64-NEXT: ret i64 [[RBIT_I]] |
| 595 |
// |
| 596 |
long test_rbitl(long t) { |
| 597 |
return __rbitl(t); |
| 598 |
} |
| 599 |
|
| 600 |
// AArch32-LABEL: @test_rbitll( |
| 601 |
// AArch32-NEXT: entry: |
| 602 |
// AArch32-NEXT: [[CONV_I:%.*]] = trunc i64 [[T:%.*]] to i32 |
| 603 |
// AArch32-NEXT: [[RBIT_I:%.*]] = call i32 @llvm.bitreverse.i32(i32 [[CONV_I]]) |
| 604 |
// AArch32-NEXT: [[CONV1_I:%.*]] = zext i32 [[RBIT_I]] to i64 |
| 605 |
// AArch32-NEXT: [[SHL_I:%.*]] = shl i64 [[CONV1_I]], 32 |
| 606 |
// AArch32-NEXT: [[SHR_I:%.*]] = lshr i64 [[T]], 32 |
| 607 |
// AArch32-NEXT: [[CONV2_I:%.*]] = trunc i64 [[SHR_I]] to i32 |
| 608 |
// AArch32-NEXT: [[RBIT3_I:%.*]] = call i32 @llvm.bitreverse.i32(i32 [[CONV2_I]]) |
| 609 |
// AArch32-NEXT: [[CONV4_I:%.*]] = zext i32 [[RBIT3_I]] to i64 |
| 610 |
// AArch32-NEXT: [[OR_I:%.*]] = or i64 [[SHL_I]], [[CONV4_I]] |
| 611 |
// AArch32-NEXT: ret i64 [[OR_I]] |
| 612 |
// |
| 613 |
// AArch64-LABEL: @test_rbitll( |
| 614 |
// AArch64-NEXT: entry: |
| 615 |
// AArch64-NEXT: [[RBIT_I:%.*]] = call i64 @llvm.bitreverse.i64(i64 [[T:%.*]]) |
| 616 |
// AArch64-NEXT: ret i64 [[RBIT_I]] |
| 617 |
// |
| 618 |
uint64_t test_rbitll(uint64_t t) { |
| 619 |
return __rbitll(t); |
| 620 |
} |
| 621 |
|
| 622 |
/* 9.4 Saturating intrinsics */ |
| 623 |
#ifdef __ARM_FEATURE_SAT |
| 624 |
/* 9.4.1 Width-specified saturation intrinsics */ |
| 625 |
// AArch32-LABEL: @test_ssat( |
| 626 |
// AArch32-NEXT: entry: |
| 627 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.ssat(i32 [[T:%.*]], i32 1) |
| 628 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 629 |
// |
| 630 |
int32_t test_ssat(int32_t t) { |
| 631 |
return __ssat(t, 1); |
| 632 |
} |
| 633 |
|
| 634 |
// AArch32-LABEL: @test_usat( |
| 635 |
// AArch32-NEXT: entry: |
| 636 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.usat(i32 [[T:%.*]], i32 2) |
| 637 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 638 |
// |
| 639 |
uint32_t test_usat(int32_t t) { |
| 640 |
return __usat(t, 2); |
| 641 |
} |
| 642 |
#endif |
| 643 |
|
| 644 |
/* 9.4.2 Saturating addition and subtraction intrinsics */ |
| 645 |
#ifdef __ARM_32BIT_STATE |
| 646 |
// AArch32-LABEL: @test_qadd( |
| 647 |
// AArch32-NEXT: entry: |
| 648 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qadd(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 649 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 650 |
// |
| 651 |
#ifndef __ARM_FEATURE_DSP |
| 652 |
__attribute__((target("dsp"))) |
| 653 |
#endif |
| 654 |
int32_t test_qadd(int32_t a, int32_t b) { |
| 655 |
return __qadd(a, b); |
| 656 |
} |
| 657 |
|
| 658 |
// AArch32-LABEL: @test_qsub( |
| 659 |
// AArch32-NEXT: entry: |
| 660 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qsub(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 661 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 662 |
// |
| 663 |
#ifndef __ARM_FEATURE_DSP |
| 664 |
__attribute__((target("dsp"))) |
| 665 |
#endif |
| 666 |
int32_t test_qsub(int32_t a, int32_t b) { |
| 667 |
return __qsub(a, b); |
| 668 |
} |
| 669 |
|
| 670 |
extern int32_t f(); |
| 671 |
// AArch32-LABEL: @test_qdbl( |
| 672 |
// AArch32-NEXT: entry: |
| 673 |
// AArch32-NEXT: [[CALL:%.*]] = call i32 @f() #[[ATTR9:[0-9]+]] |
| 674 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qadd(i32 [[CALL]], i32 [[CALL]]) |
| 675 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 676 |
// |
| 677 |
#ifndef __ARM_FEATURE_DSP |
| 678 |
__attribute__((target("dsp"))) |
| 679 |
#endif |
| 680 |
int32_t test_qdbl() { |
| 681 |
return __qdbl(f()); |
| 682 |
} |
| 683 |
#endif |
| 684 |
|
| 685 |
/* |
| 686 |
* 9.3 16-bit multiplications |
| 687 |
*/ |
| 688 |
#ifdef __ARM_32BIT_STATE |
| 689 |
// AArch32-LABEL: @test_smulbb( |
| 690 |
// AArch32-NEXT: entry: |
| 691 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smulbb(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 692 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 693 |
// |
| 694 |
#ifndef __ARM_FEATURE_DSP |
| 695 |
__attribute__((target("dsp"))) |
| 696 |
#endif |
| 697 |
int32_t test_smulbb(int32_t a, int32_t b) { |
| 698 |
return __smulbb(a, b); |
| 699 |
} |
| 700 |
|
| 701 |
// AArch32-LABEL: @test_smulbt( |
| 702 |
// AArch32-NEXT: entry: |
| 703 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smulbt(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 704 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 705 |
// |
| 706 |
#ifndef __ARM_FEATURE_DSP |
| 707 |
__attribute__((target("dsp"))) |
| 708 |
#endif |
| 709 |
int32_t test_smulbt(int32_t a, int32_t b) { |
| 710 |
return __smulbt(a, b); |
| 711 |
} |
| 712 |
|
| 713 |
// AArch32-LABEL: @test_smultb( |
| 714 |
// AArch32-NEXT: entry: |
| 715 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smultb(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 716 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 717 |
// |
| 718 |
#ifndef __ARM_FEATURE_DSP |
| 719 |
__attribute__((target("dsp"))) |
| 720 |
#endif |
| 721 |
int32_t test_smultb(int32_t a, int32_t b) { |
| 722 |
return __smultb(a, b); |
| 723 |
} |
| 724 |
|
| 725 |
// AArch32-LABEL: @test_smultt( |
| 726 |
// AArch32-NEXT: entry: |
| 727 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smultt(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 728 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 729 |
// |
| 730 |
#ifndef __ARM_FEATURE_DSP |
| 731 |
__attribute__((target("dsp"))) |
| 732 |
#endif |
| 733 |
int32_t test_smultt(int32_t a, int32_t b) { |
| 734 |
return __smultt(a, b); |
| 735 |
} |
| 736 |
|
| 737 |
// AArch32-LABEL: @test_smulwb( |
| 738 |
// AArch32-NEXT: entry: |
| 739 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smulwb(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 740 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 741 |
// |
| 742 |
#ifndef __ARM_FEATURE_DSP |
| 743 |
__attribute__((target("dsp"))) |
| 744 |
#endif |
| 745 |
int32_t test_smulwb(int32_t a, int32_t b) { |
| 746 |
return __smulwb(a, b); |
| 747 |
} |
| 748 |
|
| 749 |
// AArch32-LABEL: @test_smulwt( |
| 750 |
// AArch32-NEXT: entry: |
| 751 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smulwt(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 752 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 753 |
// |
| 754 |
#ifndef __ARM_FEATURE_DSP |
| 755 |
__attribute__((target("dsp"))) |
| 756 |
#endif |
| 757 |
int32_t test_smulwt(int32_t a, int32_t b) { |
| 758 |
return __smulwt(a, b); |
| 759 |
} |
| 760 |
#endif |
| 761 |
|
| 762 |
/* 9.4.3 Accumultating multiplications */ |
| 763 |
#ifdef __ARM_32BIT_STATE |
| 764 |
// AArch32-LABEL: @test_smlabb( |
| 765 |
// AArch32-NEXT: entry: |
| 766 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlabb(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 767 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 768 |
// |
| 769 |
#ifndef __ARM_FEATURE_DSP |
| 770 |
__attribute__((target("dsp"))) |
| 771 |
#endif |
| 772 |
int32_t test_smlabb(int32_t a, int32_t b, int32_t c) { |
| 773 |
return __smlabb(a, b, c); |
| 774 |
} |
| 775 |
|
| 776 |
// AArch32-LABEL: @test_smlabt( |
| 777 |
// AArch32-NEXT: entry: |
| 778 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlabt(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 779 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 780 |
// |
| 781 |
#ifndef __ARM_FEATURE_DSP |
| 782 |
__attribute__((target("dsp"))) |
| 783 |
#endif |
| 784 |
int32_t test_smlabt(int32_t a, int32_t b, int32_t c) { |
| 785 |
return __smlabt(a, b, c); |
| 786 |
} |
| 787 |
|
| 788 |
// AArch32-LABEL: @test_smlatb( |
| 789 |
// AArch32-NEXT: entry: |
| 790 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlatb(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 791 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 792 |
// |
| 793 |
#ifndef __ARM_FEATURE_DSP |
| 794 |
__attribute__((target("dsp"))) |
| 795 |
#endif |
| 796 |
int32_t test_smlatb(int32_t a, int32_t b, int32_t c) { |
| 797 |
return __smlatb(a, b, c); |
| 798 |
} |
| 799 |
|
| 800 |
// AArch32-LABEL: @test_smlatt( |
| 801 |
// AArch32-NEXT: entry: |
| 802 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlatt(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 803 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 804 |
// |
| 805 |
#ifndef __ARM_FEATURE_DSP |
| 806 |
__attribute__((target("dsp"))) |
| 807 |
#endif |
| 808 |
int32_t test_smlatt(int32_t a, int32_t b, int32_t c) { |
| 809 |
return __smlatt(a, b, c); |
| 810 |
} |
| 811 |
|
| 812 |
// AArch32-LABEL: @test_smlawb( |
| 813 |
// AArch32-NEXT: entry: |
| 814 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlawb(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 815 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 816 |
// |
| 817 |
#ifndef __ARM_FEATURE_DSP |
| 818 |
__attribute__((target("dsp"))) |
| 819 |
#endif |
| 820 |
int32_t test_smlawb(int32_t a, int32_t b, int32_t c) { |
| 821 |
return __smlawb(a, b, c); |
| 822 |
} |
| 823 |
|
| 824 |
// AArch32-LABEL: @test_smlawt( |
| 825 |
// AArch32-NEXT: entry: |
| 826 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlawt(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 827 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 828 |
// |
| 829 |
#ifndef __ARM_FEATURE_DSP |
| 830 |
__attribute__((target("dsp"))) |
| 831 |
#endif |
| 832 |
int32_t test_smlawt(int32_t a, int32_t b, int32_t c) { |
| 833 |
return __smlawt(a, b, c); |
| 834 |
} |
| 835 |
#endif |
| 836 |
|
| 837 |
/* 9.5.4 Parallel 16-bit saturation */ |
| 838 |
#if __ARM_FEATURE_SIMD32 |
| 839 |
// AArch32-LABEL: @test_ssat16( |
| 840 |
// AArch32-NEXT: entry: |
| 841 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.ssat16(i32 [[A:%.*]], i32 15) |
| 842 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 843 |
// |
| 844 |
int16x2_t test_ssat16(int16x2_t a) { |
| 845 |
return __ssat16(a, 15); |
| 846 |
} |
| 847 |
|
| 848 |
// AArch32-LABEL: @test_usat16( |
| 849 |
// AArch32-NEXT: entry: |
| 850 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.usat16(i32 [[A:%.*]], i32 15) |
| 851 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 852 |
// |
| 853 |
uint16x2_t test_usat16(int16x2_t a) { |
| 854 |
return __usat16(a, 15); |
| 855 |
} |
| 856 |
#endif |
| 857 |
|
| 858 |
/* 9.5.5 Packing and unpacking */ |
| 859 |
#if __ARM_FEATURE_SIMD32 |
| 860 |
// AArch32-LABEL: @test_sxtab16( |
| 861 |
// AArch32-NEXT: entry: |
| 862 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.sxtab16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 863 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 864 |
// |
| 865 |
int16x2_t test_sxtab16(int16x2_t a, int8x4_t b) { |
| 866 |
return __sxtab16(a, b); |
| 867 |
} |
| 868 |
|
| 869 |
// AArch32-LABEL: @test_sxtb16( |
| 870 |
// AArch32-NEXT: entry: |
| 871 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.sxtb16(i32 [[A:%.*]]) |
| 872 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 873 |
// |
| 874 |
int16x2_t test_sxtb16(int8x4_t a) { |
| 875 |
return __sxtb16(a); |
| 876 |
} |
| 877 |
|
| 878 |
// AArch32-LABEL: @test_uxtab16( |
| 879 |
// AArch32-NEXT: entry: |
| 880 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uxtab16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 881 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 882 |
// |
| 883 |
int16x2_t test_uxtab16(int16x2_t a, int8x4_t b) { |
| 884 |
return __uxtab16(a, b); |
| 885 |
} |
| 886 |
|
| 887 |
// AArch32-LABEL: @test_uxtb16( |
| 888 |
// AArch32-NEXT: entry: |
| 889 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uxtb16(i32 [[A:%.*]]) |
| 890 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 891 |
// |
| 892 |
int16x2_t test_uxtb16(int8x4_t a) { |
| 893 |
return __uxtb16(a); |
| 894 |
} |
| 895 |
#endif |
| 896 |
|
| 897 |
/* 9.5.6 Parallel selection */ |
| 898 |
#if __ARM_FEATURE_SIMD32 |
| 899 |
// AArch32-LABEL: @test_sel( |
| 900 |
// AArch32-NEXT: entry: |
| 901 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.sel(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 902 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 903 |
// |
| 904 |
uint8x4_t test_sel(uint8x4_t a, uint8x4_t b) { |
| 905 |
return __sel(a, b); |
| 906 |
} |
| 907 |
#endif |
| 908 |
|
| 909 |
/* 9.5.7 Parallel 8-bit addition and subtraction */ |
| 910 |
#if __ARM_FEATURE_SIMD32 |
| 911 |
// AArch32-LABEL: @test_qadd8( |
| 912 |
// AArch32-NEXT: entry: |
| 913 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qadd8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 914 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 915 |
// |
| 916 |
int16x2_t test_qadd8(int8x4_t a, int8x4_t b) { |
| 917 |
return __qadd8(a, b); |
| 918 |
} |
| 919 |
|
| 920 |
// AArch32-LABEL: @test_qsub8( |
| 921 |
// AArch32-NEXT: entry: |
| 922 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qsub8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 923 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 924 |
// |
| 925 |
int8x4_t test_qsub8(int8x4_t a, int8x4_t b) { |
| 926 |
return __qsub8(a, b); |
| 927 |
} |
| 928 |
|
| 929 |
// AArch32-LABEL: @test_sadd8( |
| 930 |
// AArch32-NEXT: entry: |
| 931 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.sadd8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 932 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 933 |
// |
| 934 |
int8x4_t test_sadd8(int8x4_t a, int8x4_t b) { |
| 935 |
return __sadd8(a, b); |
| 936 |
} |
| 937 |
|
| 938 |
// AArch32-LABEL: @test_shadd8( |
| 939 |
// AArch32-NEXT: entry: |
| 940 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.shadd8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 941 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 942 |
// |
| 943 |
int8x4_t test_shadd8(int8x4_t a, int8x4_t b) { |
| 944 |
return __shadd8(a, b); |
| 945 |
} |
| 946 |
|
| 947 |
// AArch32-LABEL: @test_shsub8( |
| 948 |
// AArch32-NEXT: entry: |
| 949 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.shsub8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 950 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 951 |
// |
| 952 |
int8x4_t test_shsub8(int8x4_t a, int8x4_t b) { |
| 953 |
return __shsub8(a, b); |
| 954 |
} |
| 955 |
|
| 956 |
// AArch32-LABEL: @test_ssub8( |
| 957 |
// AArch32-NEXT: entry: |
| 958 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.ssub8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 959 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 960 |
// |
| 961 |
int8x4_t test_ssub8(int8x4_t a, int8x4_t b) { |
| 962 |
return __ssub8(a, b); |
| 963 |
} |
| 964 |
|
| 965 |
// AArch32-LABEL: @test_uadd8( |
| 966 |
// AArch32-NEXT: entry: |
| 967 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uadd8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 968 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 969 |
// |
| 970 |
uint8x4_t test_uadd8(uint8x4_t a, uint8x4_t b) { |
| 971 |
return __uadd8(a, b); |
| 972 |
} |
| 973 |
|
| 974 |
// AArch32-LABEL: @test_uhadd8( |
| 975 |
// AArch32-NEXT: entry: |
| 976 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uhadd8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 977 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 978 |
// |
| 979 |
uint8x4_t test_uhadd8(uint8x4_t a, uint8x4_t b) { |
| 980 |
return __uhadd8(a, b); |
| 981 |
} |
| 982 |
|
| 983 |
// AArch32-LABEL: @test_uhsub8( |
| 984 |
// AArch32-NEXT: entry: |
| 985 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uhsub8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 986 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 987 |
// |
| 988 |
uint8x4_t test_uhsub8(uint8x4_t a, uint8x4_t b) { |
| 989 |
return __uhsub8(a, b); |
| 990 |
} |
| 991 |
|
| 992 |
// AArch32-LABEL: @test_uqadd8( |
| 993 |
// AArch32-NEXT: entry: |
| 994 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uqadd8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 995 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 996 |
// |
| 997 |
uint8x4_t test_uqadd8(uint8x4_t a, uint8x4_t b) { |
| 998 |
return __uqadd8(a, b); |
| 999 |
} |
| 1000 |
|
| 1001 |
// AArch32-LABEL: @test_uqsub8( |
| 1002 |
// AArch32-NEXT: entry: |
| 1003 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uqsub8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1004 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1005 |
// |
| 1006 |
uint8x4_t test_uqsub8(uint8x4_t a, uint8x4_t b) { |
| 1007 |
return __uqsub8(a, b); |
| 1008 |
} |
| 1009 |
|
| 1010 |
// AArch32-LABEL: @test_usub8( |
| 1011 |
// AArch32-NEXT: entry: |
| 1012 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.usub8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1013 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1014 |
// |
| 1015 |
uint8x4_t test_usub8(uint8x4_t a, uint8x4_t b) { |
| 1016 |
return __usub8(a, b); |
| 1017 |
} |
| 1018 |
#endif |
| 1019 |
|
| 1020 |
/* 9.5.8 Sum of 8-bit absolute differences */ |
| 1021 |
#if __ARM_FEATURE_SIMD32 |
| 1022 |
// AArch32-LABEL: @test_usad8( |
| 1023 |
// AArch32-NEXT: entry: |
| 1024 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.usad8(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1025 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1026 |
// |
| 1027 |
uint32_t test_usad8(uint8x4_t a, uint8x4_t b) { |
| 1028 |
return __usad8(a, b); |
| 1029 |
} |
| 1030 |
|
| 1031 |
// AArch32-LABEL: @test_usada8( |
| 1032 |
// AArch32-NEXT: entry: |
| 1033 |
// AArch32-NEXT: [[CONV:%.*]] = zext i8 [[A:%.*]] to i32 |
| 1034 |
// AArch32-NEXT: [[CONV1:%.*]] = zext i8 [[B:%.*]] to i32 |
| 1035 |
// AArch32-NEXT: [[CONV2:%.*]] = zext i8 [[C:%.*]] to i32 |
| 1036 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.usada8(i32 [[CONV]], i32 [[CONV1]], i32 [[CONV2]]) |
| 1037 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1038 |
// |
| 1039 |
uint32_t test_usada8(uint8_t a, uint8_t b, uint8_t c) { |
| 1040 |
return __usada8(a, b, c); |
| 1041 |
} |
| 1042 |
#endif |
| 1043 |
|
| 1044 |
/* 9.5.9 Parallel 16-bit addition and subtraction */ |
| 1045 |
#if __ARM_FEATURE_SIMD32 |
| 1046 |
// AArch32-LABEL: @test_qadd16( |
| 1047 |
// AArch32-NEXT: entry: |
| 1048 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qadd16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1049 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1050 |
// |
| 1051 |
int16x2_t test_qadd16(int16x2_t a, int16x2_t b) { |
| 1052 |
return __qadd16(a, b); |
| 1053 |
} |
| 1054 |
|
| 1055 |
// AArch32-LABEL: @test_qasx( |
| 1056 |
// AArch32-NEXT: entry: |
| 1057 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qasx(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1058 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1059 |
// |
| 1060 |
int16x2_t test_qasx(int16x2_t a, int16x2_t b) { |
| 1061 |
return __qasx(a, b); |
| 1062 |
} |
| 1063 |
|
| 1064 |
// AArch32-LABEL: @test_qsax( |
| 1065 |
// AArch32-NEXT: entry: |
| 1066 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qsax(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1067 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1068 |
// |
| 1069 |
int16x2_t test_qsax(int16x2_t a, int16x2_t b) { |
| 1070 |
return __qsax(a, b); |
| 1071 |
} |
| 1072 |
|
| 1073 |
// AArch32-LABEL: @test_qsub16( |
| 1074 |
// AArch32-NEXT: entry: |
| 1075 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.qsub16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1076 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1077 |
// |
| 1078 |
int16x2_t test_qsub16(int16x2_t a, int16x2_t b) { |
| 1079 |
return __qsub16(a, b); |
| 1080 |
} |
| 1081 |
|
| 1082 |
// AArch32-LABEL: @test_sadd16( |
| 1083 |
// AArch32-NEXT: entry: |
| 1084 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.sadd16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1085 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1086 |
// |
| 1087 |
int16x2_t test_sadd16(int16x2_t a, int16x2_t b) { |
| 1088 |
return __sadd16(a, b); |
| 1089 |
} |
| 1090 |
|
| 1091 |
// AArch32-LABEL: @test_sasx( |
| 1092 |
// AArch32-NEXT: entry: |
| 1093 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.sasx(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1094 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1095 |
// |
| 1096 |
int16x2_t test_sasx(int16x2_t a, int16x2_t b) { |
| 1097 |
return __sasx(a, b); |
| 1098 |
} |
| 1099 |
|
| 1100 |
// AArch32-LABEL: @test_shadd16( |
| 1101 |
// AArch32-NEXT: entry: |
| 1102 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.shadd16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1103 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1104 |
// |
| 1105 |
int16x2_t test_shadd16(int16x2_t a, int16x2_t b) { |
| 1106 |
return __shadd16(a, b); |
| 1107 |
} |
| 1108 |
|
| 1109 |
// AArch32-LABEL: @test_shasx( |
| 1110 |
// AArch32-NEXT: entry: |
| 1111 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.shasx(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1112 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1113 |
// |
| 1114 |
int16x2_t test_shasx(int16x2_t a, int16x2_t b) { |
| 1115 |
return __shasx(a, b); |
| 1116 |
} |
| 1117 |
|
| 1118 |
// AArch32-LABEL: @test_shsax( |
| 1119 |
// AArch32-NEXT: entry: |
| 1120 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.shsax(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1121 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1122 |
// |
| 1123 |
int16x2_t test_shsax(int16x2_t a, int16x2_t b) { |
| 1124 |
return __shsax(a, b); |
| 1125 |
} |
| 1126 |
|
| 1127 |
// AArch32-LABEL: @test_shsub16( |
| 1128 |
// AArch32-NEXT: entry: |
| 1129 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.shsub16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1130 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1131 |
// |
| 1132 |
int16x2_t test_shsub16(int16x2_t a, int16x2_t b) { |
| 1133 |
return __shsub16(a, b); |
| 1134 |
} |
| 1135 |
|
| 1136 |
// AArch32-LABEL: @test_ssax( |
| 1137 |
// AArch32-NEXT: entry: |
| 1138 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.ssax(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1139 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1140 |
// |
| 1141 |
int16x2_t test_ssax(int16x2_t a, int16x2_t b) { |
| 1142 |
return __ssax(a, b); |
| 1143 |
} |
| 1144 |
|
| 1145 |
// AArch32-LABEL: @test_ssub16( |
| 1146 |
// AArch32-NEXT: entry: |
| 1147 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.ssub16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1148 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1149 |
// |
| 1150 |
int16x2_t test_ssub16(int16x2_t a, int16x2_t b) { |
| 1151 |
return __ssub16(a, b); |
| 1152 |
} |
| 1153 |
|
| 1154 |
// AArch32-LABEL: @test_uadd16( |
| 1155 |
// AArch32-NEXT: entry: |
| 1156 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uadd16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1157 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1158 |
// |
| 1159 |
uint16x2_t test_uadd16(uint16x2_t a, uint16x2_t b) { |
| 1160 |
return __uadd16(a, b); |
| 1161 |
} |
| 1162 |
|
| 1163 |
// AArch32-LABEL: @test_uasx( |
| 1164 |
// AArch32-NEXT: entry: |
| 1165 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uasx(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1166 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1167 |
// |
| 1168 |
uint16x2_t test_uasx(uint16x2_t a, uint16x2_t b) { |
| 1169 |
return __uasx(a, b); |
| 1170 |
} |
| 1171 |
|
| 1172 |
// AArch32-LABEL: @test_uhadd16( |
| 1173 |
// AArch32-NEXT: entry: |
| 1174 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uhadd16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1175 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1176 |
// |
| 1177 |
uint16x2_t test_uhadd16(uint16x2_t a, uint16x2_t b) { |
| 1178 |
return __uhadd16(a, b); |
| 1179 |
} |
| 1180 |
|
| 1181 |
// AArch32-LABEL: @test_uhasx( |
| 1182 |
// AArch32-NEXT: entry: |
| 1183 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uhasx(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1184 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1185 |
// |
| 1186 |
uint16x2_t test_uhasx(uint16x2_t a, uint16x2_t b) { |
| 1187 |
return __uhasx(a, b); |
| 1188 |
} |
| 1189 |
|
| 1190 |
// AArch32-LABEL: @test_uhsax( |
| 1191 |
// AArch32-NEXT: entry: |
| 1192 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uhsax(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1193 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1194 |
// |
| 1195 |
uint16x2_t test_uhsax(uint16x2_t a, uint16x2_t b) { |
| 1196 |
return __uhsax(a, b); |
| 1197 |
} |
| 1198 |
|
| 1199 |
// AArch32-LABEL: @test_uhsub16( |
| 1200 |
// AArch32-NEXT: entry: |
| 1201 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uhsub16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1202 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1203 |
// |
| 1204 |
uint16x2_t test_uhsub16(uint16x2_t a, uint16x2_t b) { |
| 1205 |
return __uhsub16(a, b); |
| 1206 |
} |
| 1207 |
|
| 1208 |
// AArch32-LABEL: @test_uqadd16( |
| 1209 |
// AArch32-NEXT: entry: |
| 1210 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uqadd16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1211 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1212 |
// |
| 1213 |
uint16x2_t test_uqadd16(uint16x2_t a, uint16x2_t b) { |
| 1214 |
return __uqadd16(a, b); |
| 1215 |
} |
| 1216 |
|
| 1217 |
// AArch32-LABEL: @test_uqasx( |
| 1218 |
// AArch32-NEXT: entry: |
| 1219 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uqasx(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1220 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1221 |
// |
| 1222 |
uint16x2_t test_uqasx(uint16x2_t a, uint16x2_t b) { |
| 1223 |
return __uqasx(a, b); |
| 1224 |
} |
| 1225 |
|
| 1226 |
// AArch32-LABEL: @test_uqsax( |
| 1227 |
// AArch32-NEXT: entry: |
| 1228 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uqsax(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1229 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1230 |
// |
| 1231 |
uint16x2_t test_uqsax(uint16x2_t a, uint16x2_t b) { |
| 1232 |
return __uqsax(a, b); |
| 1233 |
} |
| 1234 |
|
| 1235 |
// AArch32-LABEL: @test_uqsub16( |
| 1236 |
// AArch32-NEXT: entry: |
| 1237 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.uqsub16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1238 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1239 |
// |
| 1240 |
uint16x2_t test_uqsub16(uint16x2_t a, uint16x2_t b) { |
| 1241 |
return __uqsub16(a, b); |
| 1242 |
} |
| 1243 |
|
| 1244 |
// AArch32-LABEL: @test_usax( |
| 1245 |
// AArch32-NEXT: entry: |
| 1246 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.usax(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1247 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1248 |
// |
| 1249 |
uint16x2_t test_usax(uint16x2_t a, uint16x2_t b) { |
| 1250 |
return __usax(a, b); |
| 1251 |
} |
| 1252 |
|
| 1253 |
// AArch32-LABEL: @test_usub16( |
| 1254 |
// AArch32-NEXT: entry: |
| 1255 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.usub16(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1256 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1257 |
// |
| 1258 |
uint16x2_t test_usub16(uint16x2_t a, uint16x2_t b) { |
| 1259 |
return __usub16(a, b); |
| 1260 |
} |
| 1261 |
#endif |
| 1262 |
|
| 1263 |
/* 9.5.10 Parallel 16-bit multiplications */ |
| 1264 |
#if __ARM_FEATURE_SIMD32 |
| 1265 |
// AArch32-LABEL: @test_smlad( |
| 1266 |
// AArch32-NEXT: entry: |
| 1267 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlad(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 1268 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1269 |
// |
| 1270 |
int32_t test_smlad(int16x2_t a, int16x2_t b, int32_t c) { |
| 1271 |
return __smlad(a, b, c); |
| 1272 |
} |
| 1273 |
|
| 1274 |
// AArch32-LABEL: @test_smladx( |
| 1275 |
// AArch32-NEXT: entry: |
| 1276 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smladx(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 1277 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1278 |
// |
| 1279 |
int32_t test_smladx(int16x2_t a, int16x2_t b, int32_t c) { |
| 1280 |
return __smladx(a, b, c); |
| 1281 |
} |
| 1282 |
|
| 1283 |
// AArch32-LABEL: @test_smlald( |
| 1284 |
// AArch32-NEXT: entry: |
| 1285 |
// AArch32-NEXT: [[TMP0:%.*]] = call i64 @llvm.arm.smlald(i32 [[A:%.*]], i32 [[B:%.*]], i64 [[C:%.*]]) |
| 1286 |
// AArch32-NEXT: ret i64 [[TMP0]] |
| 1287 |
// |
| 1288 |
int64_t test_smlald(int16x2_t a, int16x2_t b, int64_t c) { |
| 1289 |
return __smlald(a, b, c); |
| 1290 |
} |
| 1291 |
|
| 1292 |
// AArch32-LABEL: @test_smlaldx( |
| 1293 |
// AArch32-NEXT: entry: |
| 1294 |
// AArch32-NEXT: [[TMP0:%.*]] = call i64 @llvm.arm.smlaldx(i32 [[A:%.*]], i32 [[B:%.*]], i64 [[C:%.*]]) |
| 1295 |
// AArch32-NEXT: ret i64 [[TMP0]] |
| 1296 |
// |
| 1297 |
int64_t test_smlaldx(int16x2_t a, int16x2_t b, int64_t c) { |
| 1298 |
return __smlaldx(a, b, c); |
| 1299 |
} |
| 1300 |
|
| 1301 |
// AArch32-LABEL: @test_smlsd( |
| 1302 |
// AArch32-NEXT: entry: |
| 1303 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlsd(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 1304 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1305 |
// |
| 1306 |
int32_t test_smlsd(int16x2_t a, int16x2_t b, int32_t c) { |
| 1307 |
return __smlsd(a, b, c); |
| 1308 |
} |
| 1309 |
|
| 1310 |
// AArch32-LABEL: @test_smlsdx( |
| 1311 |
// AArch32-NEXT: entry: |
| 1312 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smlsdx(i32 [[A:%.*]], i32 [[B:%.*]], i32 [[C:%.*]]) |
| 1313 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1314 |
// |
| 1315 |
int32_t test_smlsdx(int16x2_t a, int16x2_t b, int32_t c) { |
| 1316 |
return __smlsdx(a, b, c); |
| 1317 |
} |
| 1318 |
|
| 1319 |
// AArch32-LABEL: @test_smlsld( |
| 1320 |
// AArch32-NEXT: entry: |
| 1321 |
// AArch32-NEXT: [[TMP0:%.*]] = call i64 @llvm.arm.smlsld(i32 [[A:%.*]], i32 [[B:%.*]], i64 [[C:%.*]]) |
| 1322 |
// AArch32-NEXT: ret i64 [[TMP0]] |
| 1323 |
// |
| 1324 |
int64_t test_smlsld(int16x2_t a, int16x2_t b, int64_t c) { |
| 1325 |
return __smlsld(a, b, c); |
| 1326 |
} |
| 1327 |
|
| 1328 |
// AArch32-LABEL: @test_smlsldx( |
| 1329 |
// AArch32-NEXT: entry: |
| 1330 |
// AArch32-NEXT: [[TMP0:%.*]] = call i64 @llvm.arm.smlsldx(i32 [[A:%.*]], i32 [[B:%.*]], i64 [[C:%.*]]) |
| 1331 |
// AArch32-NEXT: ret i64 [[TMP0]] |
| 1332 |
// |
| 1333 |
int64_t test_smlsldx(int16x2_t a, int16x2_t b, int64_t c) { |
| 1334 |
return __smlsldx(a, b, c); |
| 1335 |
} |
| 1336 |
|
| 1337 |
// AArch32-LABEL: @test_smuad( |
| 1338 |
// AArch32-NEXT: entry: |
| 1339 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smuad(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1340 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1341 |
// |
| 1342 |
int32_t test_smuad(int16x2_t a, int16x2_t b) { |
| 1343 |
return __smuad(a, b); |
| 1344 |
} |
| 1345 |
|
| 1346 |
// AArch32-LABEL: @test_smuadx( |
| 1347 |
// AArch32-NEXT: entry: |
| 1348 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smuadx(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1349 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1350 |
// |
| 1351 |
int32_t test_smuadx(int16x2_t a, int16x2_t b) { |
| 1352 |
return __smuadx(a, b); |
| 1353 |
} |
| 1354 |
|
| 1355 |
// AArch32-LABEL: @test_smusd( |
| 1356 |
// AArch32-NEXT: entry: |
| 1357 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smusd(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1358 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1359 |
// |
| 1360 |
int32_t test_smusd(int16x2_t a, int16x2_t b) { |
| 1361 |
return __smusd(a, b); |
| 1362 |
} |
| 1363 |
|
| 1364 |
// AArch32-LABEL: @test_smusdx( |
| 1365 |
// AArch32-NEXT: entry: |
| 1366 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.smusdx(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1367 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1368 |
// |
| 1369 |
int32_t test_smusdx(int16x2_t a, int16x2_t b) { |
| 1370 |
return __smusdx(a, b); |
| 1371 |
} |
| 1372 |
#endif |
| 1373 |
|
| 1374 |
/* 9.7 CRC32 intrinsics */ |
| 1375 |
// AArch32-LABEL: @test_crc32b( |
| 1376 |
// AArch32-NEXT: entry: |
| 1377 |
// AArch32-NEXT: [[TMP0:%.*]] = zext i8 [[B:%.*]] to i32 |
| 1378 |
// AArch32-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.crc32b(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1379 |
// AArch32-NEXT: ret i32 [[TMP1]] |
| 1380 |
// |
| 1381 |
// AArch64-LABEL: @test_crc32b( |
| 1382 |
// AArch64-NEXT: entry: |
| 1383 |
// AArch64-NEXT: [[TMP0:%.*]] = zext i8 [[B:%.*]] to i32 |
| 1384 |
// AArch64-NEXT: [[TMP1:%.*]] = call i32 @llvm.aarch64.crc32b(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1385 |
// AArch64-NEXT: ret i32 [[TMP1]] |
| 1386 |
// |
| 1387 |
#ifndef __ARM_FEATURE_CRC32 |
| 1388 |
__attribute__((target("crc"))) |
| 1389 |
#endif |
| 1390 |
uint32_t test_crc32b(uint32_t a, uint8_t b) { |
| 1391 |
return __crc32b(a, b); |
| 1392 |
} |
| 1393 |
|
| 1394 |
// AArch32-LABEL: @test_crc32h( |
| 1395 |
// AArch32-NEXT: entry: |
| 1396 |
// AArch32-NEXT: [[TMP0:%.*]] = zext i16 [[B:%.*]] to i32 |
| 1397 |
// AArch32-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.crc32h(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1398 |
// AArch32-NEXT: ret i32 [[TMP1]] |
| 1399 |
// |
| 1400 |
// AArch64-LABEL: @test_crc32h( |
| 1401 |
// AArch64-NEXT: entry: |
| 1402 |
// AArch64-NEXT: [[TMP0:%.*]] = zext i16 [[B:%.*]] to i32 |
| 1403 |
// AArch64-NEXT: [[TMP1:%.*]] = call i32 @llvm.aarch64.crc32h(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1404 |
// AArch64-NEXT: ret i32 [[TMP1]] |
| 1405 |
// |
| 1406 |
#ifndef __ARM_FEATURE_CRC32 |
| 1407 |
__attribute__((target("crc"))) |
| 1408 |
#endif |
| 1409 |
uint32_t test_crc32h(uint32_t a, uint16_t b) { |
| 1410 |
return __crc32h(a, b); |
| 1411 |
} |
| 1412 |
|
| 1413 |
// AArch32-LABEL: @test_crc32w( |
| 1414 |
// AArch32-NEXT: entry: |
| 1415 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.crc32w(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1416 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1417 |
// |
| 1418 |
// AArch64-LABEL: @test_crc32w( |
| 1419 |
// AArch64-NEXT: entry: |
| 1420 |
// AArch64-NEXT: [[TMP0:%.*]] = call i32 @llvm.aarch64.crc32w(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1421 |
// AArch64-NEXT: ret i32 [[TMP0]] |
| 1422 |
// |
| 1423 |
#ifndef __ARM_FEATURE_CRC32 |
| 1424 |
__attribute__((target("crc"))) |
| 1425 |
#endif |
| 1426 |
uint32_t test_crc32w(uint32_t a, uint32_t b) { |
| 1427 |
return __crc32w(a, b); |
| 1428 |
} |
| 1429 |
|
| 1430 |
// AArch32-LABEL: @test_crc32d( |
| 1431 |
// AArch32-NEXT: entry: |
| 1432 |
// AArch32-NEXT: [[TMP0:%.*]] = trunc i64 [[B:%.*]] to i32 |
| 1433 |
// AArch32-NEXT: [[TMP1:%.*]] = lshr i64 [[B]], 32 |
| 1434 |
// AArch32-NEXT: [[TMP2:%.*]] = trunc i64 [[TMP1]] to i32 |
| 1435 |
// AArch32-NEXT: [[TMP3:%.*]] = call i32 @llvm.arm.crc32w(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1436 |
// AArch32-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.crc32w(i32 [[TMP3]], i32 [[TMP2]]) |
| 1437 |
// AArch32-NEXT: ret i32 [[TMP4]] |
| 1438 |
// |
| 1439 |
// AArch64-LABEL: @test_crc32d( |
| 1440 |
// AArch64-NEXT: entry: |
| 1441 |
// AArch64-NEXT: [[TMP0:%.*]] = call i32 @llvm.aarch64.crc32x(i32 [[A:%.*]], i64 [[B:%.*]]) |
| 1442 |
// AArch64-NEXT: ret i32 [[TMP0]] |
| 1443 |
// |
| 1444 |
#ifndef __ARM_FEATURE_CRC32 |
| 1445 |
__attribute__((target("crc"))) |
| 1446 |
#endif |
| 1447 |
uint32_t test_crc32d(uint32_t a, uint64_t b) { |
| 1448 |
return __crc32d(a, b); |
| 1449 |
} |
| 1450 |
|
| 1451 |
// AArch32-LABEL: @test_crc32cb( |
| 1452 |
// AArch32-NEXT: entry: |
| 1453 |
// AArch32-NEXT: [[TMP0:%.*]] = zext i8 [[B:%.*]] to i32 |
| 1454 |
// AArch32-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.crc32cb(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1455 |
// AArch32-NEXT: ret i32 [[TMP1]] |
| 1456 |
// |
| 1457 |
// AArch64-LABEL: @test_crc32cb( |
| 1458 |
// AArch64-NEXT: entry: |
| 1459 |
// AArch64-NEXT: [[TMP0:%.*]] = zext i8 [[B:%.*]] to i32 |
| 1460 |
// AArch64-NEXT: [[TMP1:%.*]] = call i32 @llvm.aarch64.crc32cb(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1461 |
// AArch64-NEXT: ret i32 [[TMP1]] |
| 1462 |
// |
| 1463 |
#ifndef __ARM_FEATURE_CRC32 |
| 1464 |
__attribute__((target("crc"))) |
| 1465 |
#endif |
| 1466 |
uint32_t test_crc32cb(uint32_t a, uint8_t b) { |
| 1467 |
return __crc32cb(a, b); |
| 1468 |
} |
| 1469 |
|
| 1470 |
// AArch32-LABEL: @test_crc32ch( |
| 1471 |
// AArch32-NEXT: entry: |
| 1472 |
// AArch32-NEXT: [[TMP0:%.*]] = zext i16 [[B:%.*]] to i32 |
| 1473 |
// AArch32-NEXT: [[TMP1:%.*]] = call i32 @llvm.arm.crc32ch(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1474 |
// AArch32-NEXT: ret i32 [[TMP1]] |
| 1475 |
// |
| 1476 |
// AArch64-LABEL: @test_crc32ch( |
| 1477 |
// AArch64-NEXT: entry: |
| 1478 |
// AArch64-NEXT: [[TMP0:%.*]] = zext i16 [[B:%.*]] to i32 |
| 1479 |
// AArch64-NEXT: [[TMP1:%.*]] = call i32 @llvm.aarch64.crc32ch(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1480 |
// AArch64-NEXT: ret i32 [[TMP1]] |
| 1481 |
// |
| 1482 |
#ifndef __ARM_FEATURE_CRC32 |
| 1483 |
__attribute__((target("crc"))) |
| 1484 |
#endif |
| 1485 |
uint32_t test_crc32ch(uint32_t a, uint16_t b) { |
| 1486 |
return __crc32ch(a, b); |
| 1487 |
} |
| 1488 |
|
| 1489 |
// AArch32-LABEL: @test_crc32cw( |
| 1490 |
// AArch32-NEXT: entry: |
| 1491 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.arm.crc32cw(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1492 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1493 |
// |
| 1494 |
// AArch64-LABEL: @test_crc32cw( |
| 1495 |
// AArch64-NEXT: entry: |
| 1496 |
// AArch64-NEXT: [[TMP0:%.*]] = call i32 @llvm.aarch64.crc32cw(i32 [[A:%.*]], i32 [[B:%.*]]) |
| 1497 |
// AArch64-NEXT: ret i32 [[TMP0]] |
| 1498 |
// |
| 1499 |
#ifndef __ARM_FEATURE_CRC32 |
| 1500 |
__attribute__((target("crc"))) |
| 1501 |
#endif |
| 1502 |
uint32_t test_crc32cw(uint32_t a, uint32_t b) { |
| 1503 |
return __crc32cw(a, b); |
| 1504 |
} |
| 1505 |
|
| 1506 |
// AArch32-LABEL: @test_crc32cd( |
| 1507 |
// AArch32-NEXT: entry: |
| 1508 |
// AArch32-NEXT: [[TMP0:%.*]] = trunc i64 [[B:%.*]] to i32 |
| 1509 |
// AArch32-NEXT: [[TMP1:%.*]] = lshr i64 [[B]], 32 |
| 1510 |
// AArch32-NEXT: [[TMP2:%.*]] = trunc i64 [[TMP1]] to i32 |
| 1511 |
// AArch32-NEXT: [[TMP3:%.*]] = call i32 @llvm.arm.crc32cw(i32 [[A:%.*]], i32 [[TMP0]]) |
| 1512 |
// AArch32-NEXT: [[TMP4:%.*]] = call i32 @llvm.arm.crc32cw(i32 [[TMP3]], i32 [[TMP2]]) |
| 1513 |
// AArch32-NEXT: ret i32 [[TMP4]] |
| 1514 |
// |
| 1515 |
// AArch64-LABEL: @test_crc32cd( |
| 1516 |
// AArch64-NEXT: entry: |
| 1517 |
// AArch64-NEXT: [[TMP0:%.*]] = call i32 @llvm.aarch64.crc32cx(i32 [[A:%.*]], i64 [[B:%.*]]) |
| 1518 |
// AArch64-NEXT: ret i32 [[TMP0]] |
| 1519 |
// |
| 1520 |
#ifndef __ARM_FEATURE_CRC32 |
| 1521 |
__attribute__((target("crc"))) |
| 1522 |
#endif |
| 1523 |
uint32_t test_crc32cd(uint32_t a, uint64_t b) { |
| 1524 |
return __crc32cd(a, b); |
| 1525 |
} |
| 1526 |
|
| 1527 |
/* 10.1 Special register intrinsics */ |
| 1528 |
// AArch32-LABEL: @test_rsr( |
| 1529 |
// AArch32-NEXT: entry: |
| 1530 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.read_volatile_register.i32(metadata [[META5:![0-9]+]]) |
| 1531 |
// AArch32-NEXT: ret i32 [[TMP0]] |
| 1532 |
// |
| 1533 |
// AArch64-LABEL: @test_rsr( |
| 1534 |
// AArch64-NEXT: entry: |
| 1535 |
// AArch64-NEXT: [[TMP0:%.*]] = call i64 @llvm.read_volatile_register.i64(metadata [[META4:![0-9]+]]) |
| 1536 |
// AArch64-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32 |
| 1537 |
// AArch64-NEXT: ret i32 [[TMP1]] |
| 1538 |
// |
| 1539 |
uint32_t test_rsr() { |
| 1540 |
#ifdef __ARM_32BIT_STATE |
| 1541 |
return __arm_rsr("cp1:2:c3:c4:5"); |
| 1542 |
#else |
| 1543 |
return __arm_rsr("1:2:3:4:5"); |
| 1544 |
#endif |
| 1545 |
} |
| 1546 |
|
| 1547 |
// AArch32-LABEL: @test_rsr64( |
| 1548 |
// AArch32-NEXT: entry: |
| 1549 |
// AArch32-NEXT: [[TMP0:%.*]] = call i64 @llvm.read_volatile_register.i64(metadata [[META6:![0-9]+]]) |
| 1550 |
// AArch32-NEXT: ret i64 [[TMP0]] |
| 1551 |
// |
| 1552 |
// AArch64-LABEL: @test_rsr64( |
| 1553 |
// AArch64-NEXT: entry: |
| 1554 |
// AArch64-NEXT: [[TMP0:%.*]] = call i64 @llvm.read_volatile_register.i64(metadata [[META4]]) |
| 1555 |
// AArch64-NEXT: ret i64 [[TMP0]] |
| 1556 |
// |
| 1557 |
uint64_t test_rsr64() { |
| 1558 |
#ifdef __ARM_32BIT_STATE |
| 1559 |
return __arm_rsr64("cp1:2:c3"); |
| 1560 |
#else |
| 1561 |
return __arm_rsr64("1:2:3:4:5"); |
| 1562 |
#endif |
| 1563 |
} |
| 1564 |
|
| 1565 |
#ifdef __ARM_FEATURE_SYSREG128 |
| 1566 |
// AArch6494D128-LABEL: @test_rsr128( |
| 1567 |
// AArch6494D128-NEXT: entry: |
| 1568 |
// AArch6494D128-NEXT: [[TMP0:%.*]] = call i128 @llvm.read_volatile_register.i128(metadata [[META4]]) |
| 1569 |
// AArch6494D128-NEXT: ret i128 [[TMP0]] |
| 1570 |
// |
| 1571 |
__uint128_t test_rsr128() { |
| 1572 |
return __arm_rsr128("1:2:3:4:5"); |
| 1573 |
} |
| 1574 |
#endif |
| 1575 |
|
| 1576 |
// AArch32-LABEL: @test_rsrp( |
| 1577 |
// AArch32-NEXT: entry: |
| 1578 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.read_volatile_register.i32(metadata [[META7:![0-9]+]]) |
| 1579 |
// AArch32-NEXT: [[TMP1:%.*]] = inttoptr i32 [[TMP0]] to ptr |
| 1580 |
// AArch32-NEXT: ret ptr [[TMP1]] |
| 1581 |
// |
| 1582 |
// AArch64-LABEL: @test_rsrp( |
| 1583 |
// AArch64-NEXT: entry: |
| 1584 |
// AArch64-NEXT: [[TMP0:%.*]] = call i64 @llvm.read_volatile_register.i64(metadata [[META5:![0-9]+]]) |
| 1585 |
// AArch64-NEXT: [[TMP1:%.*]] = inttoptr i64 [[TMP0]] to ptr |
| 1586 |
// AArch64-NEXT: ret ptr [[TMP1]] |
| 1587 |
// |
| 1588 |
void *test_rsrp() { |
| 1589 |
return __arm_rsrp("sysreg"); |
| 1590 |
} |
| 1591 |
|
| 1592 |
// AArch32-LABEL: @test_wsr( |
| 1593 |
// AArch32-NEXT: entry: |
| 1594 |
// AArch32-NEXT: call void @llvm.write_register.i32(metadata [[META5]], i32 [[V:%.*]]) |
| 1595 |
// AArch32-NEXT: ret void |
| 1596 |
// |
| 1597 |
// AArch64-LABEL: @test_wsr( |
| 1598 |
// AArch64-NEXT: entry: |
| 1599 |
// AArch64-NEXT: [[TMP0:%.*]] = zext i32 [[V:%.*]] to i64 |
| 1600 |
// AArch64-NEXT: call void @llvm.write_register.i64(metadata [[META4]], i64 [[TMP0]]) |
| 1601 |
// AArch64-NEXT: ret void |
| 1602 |
// |
| 1603 |
void test_wsr(uint32_t v) { |
| 1604 |
#ifdef __ARM_32BIT_STATE |
| 1605 |
__arm_wsr("cp1:2:c3:c4:5", v); |
| 1606 |
#else |
| 1607 |
__arm_wsr("1:2:3:4:5", v); |
| 1608 |
#endif |
| 1609 |
} |
| 1610 |
|
| 1611 |
// AArch32-LABEL: @test_wsr64( |
| 1612 |
// AArch32-NEXT: entry: |
| 1613 |
// AArch32-NEXT: call void @llvm.write_register.i64(metadata [[META6]], i64 [[V:%.*]]) |
| 1614 |
// AArch32-NEXT: ret void |
| 1615 |
// |
| 1616 |
// AArch64-LABEL: @test_wsr64( |
| 1617 |
// AArch64-NEXT: entry: |
| 1618 |
// AArch64-NEXT: call void @llvm.write_register.i64(metadata [[META4]], i64 [[V:%.*]]) |
| 1619 |
// AArch64-NEXT: ret void |
| 1620 |
// |
| 1621 |
void test_wsr64(uint64_t v) { |
| 1622 |
#ifdef __ARM_32BIT_STATE |
| 1623 |
__arm_wsr64("cp1:2:c3", v); |
| 1624 |
#else |
| 1625 |
__arm_wsr64("1:2:3:4:5", v); |
| 1626 |
#endif |
| 1627 |
} |
| 1628 |
|
| 1629 |
#ifdef __ARM_FEATURE_SYSREG128 |
| 1630 |
// AArch6494D128-LABEL: @test_wsr128( |
| 1631 |
// AArch6494D128-NEXT: entry: |
| 1632 |
// AArch6494D128-NEXT: call void @llvm.write_register.i128(metadata [[META4]], i128 [[V:%.*]]) |
| 1633 |
// AArch6494D128-NEXT: ret void |
| 1634 |
// |
| 1635 |
void test_wsr128(__uint128_t v) { |
| 1636 |
__arm_wsr128("1:2:3:4:5", v); |
| 1637 |
|
| 1638 |
} |
| 1639 |
#endif |
| 1640 |
|
| 1641 |
// AArch32-LABEL: @test_wsrp( |
| 1642 |
// AArch32-NEXT: entry: |
| 1643 |
// AArch32-NEXT: [[TMP0:%.*]] = ptrtoint ptr [[V:%.*]] to i32 |
| 1644 |
// AArch32-NEXT: call void @llvm.write_register.i32(metadata [[META7]], i32 [[TMP0]]) |
| 1645 |
// AArch32-NEXT: ret void |
| 1646 |
// |
| 1647 |
// AArch64-LABEL: @test_wsrp( |
| 1648 |
// AArch64-NEXT: entry: |
| 1649 |
// AArch64-NEXT: [[TMP0:%.*]] = ptrtoint ptr [[V:%.*]] to i64 |
| 1650 |
// AArch64-NEXT: call void @llvm.write_register.i64(metadata [[META5]], i64 [[TMP0]]) |
| 1651 |
// AArch64-NEXT: ret void |
| 1652 |
// |
| 1653 |
void test_wsrp(void *v) { |
| 1654 |
__arm_wsrp("sysreg", v); |
| 1655 |
} |
| 1656 |
|
| 1657 |
// AArch32-LABEL: @test_rsrf( |
| 1658 |
// AArch32-NEXT: entry: |
| 1659 |
// AArch32-NEXT: [[REF_TMP:%.*]] = alloca i32, align 4 |
| 1660 |
// AArch32-NEXT: [[TMP0:%.*]] = call i32 @llvm.read_volatile_register.i32(metadata [[META5]]) |
| 1661 |
// AArch32-NEXT: store i32 [[TMP0]], ptr [[REF_TMP]], align 4 |
| 1662 |
// AArch32-NEXT: [[TMP1:%.*]] = load float, ptr [[REF_TMP]], align 4 |
| 1663 |
// AArch32-NEXT: ret float [[TMP1]] |
| 1664 |
// |
| 1665 |
// AArch64-LABEL: @test_rsrf( |
| 1666 |
// AArch64-NEXT: entry: |
| 1667 |
// AArch64-NEXT: [[REF_TMP:%.*]] = alloca i32, align 4 |
| 1668 |
// AArch64-NEXT: [[TMP0:%.*]] = call i64 @llvm.read_volatile_register.i64(metadata [[META4]]) |
| 1669 |
// AArch64-NEXT: [[TMP1:%.*]] = trunc i64 [[TMP0]] to i32 |
| 1670 |
// AArch64-NEXT: store i32 [[TMP1]], ptr [[REF_TMP]], align 4 |
| 1671 |
// AArch64-NEXT: [[TMP2:%.*]] = load float, ptr [[REF_TMP]], align 4 |
| 1672 |
// AArch64-NEXT: ret float [[TMP2]] |
| 1673 |
// |
| 1674 |
float test_rsrf() { |
| 1675 |
#ifdef __ARM_32BIT_STATE |
| 1676 |
return __arm_rsrf("cp1:2:c3:c4:5"); |
| 1677 |
#else |
| 1678 |
return __arm_rsrf("1:2:3:4:5"); |
| 1679 |
#endif |
| 1680 |
} |
| 1681 |
|
| 1682 |
// AArch32-LABEL: @test_rsrf64( |
| 1683 |
// AArch32-NEXT: entry: |
| 1684 |
// AArch32-NEXT: [[REF_TMP:%.*]] = alloca i64, align 8 |
| 1685 |
// AArch32-NEXT: [[TMP0:%.*]] = call i64 @llvm.read_volatile_register.i64(metadata [[META6]]) |
| 1686 |
// AArch32-NEXT: store i64 [[TMP0]], ptr [[REF_TMP]], align 8 |
| 1687 |
// AArch32-NEXT: [[TMP1:%.*]] = load double, ptr [[REF_TMP]], align 8 |
| 1688 |
// AArch32-NEXT: ret double [[TMP1]] |
| 1689 |
// |
| 1690 |
// AArch64-LABEL: @test_rsrf64( |
| 1691 |
// AArch64-NEXT: entry: |
| 1692 |
// AArch64-NEXT: [[REF_TMP:%.*]] = alloca i64, align 8 |
| 1693 |
// AArch64-NEXT: [[TMP0:%.*]] = call i64 @llvm.read_volatile_register.i64(metadata [[META4]]) |
| 1694 |
// AArch64-NEXT: store i64 [[TMP0]], ptr [[REF_TMP]], align 8 |
| 1695 |
// AArch64-NEXT: [[TMP1:%.*]] = load double, ptr [[REF_TMP]], align 8 |
| 1696 |
// AArch64-NEXT: ret double [[TMP1]] |
| 1697 |
// |
| 1698 |
double test_rsrf64() { |
| 1699 |
#ifdef __ARM_32BIT_STATE |
| 1700 |
return __arm_rsrf64("cp1:2:c3"); |
| 1701 |
#else |
| 1702 |
return __arm_rsrf64("1:2:3:4:5"); |
| 1703 |
#endif |
| 1704 |
} |
| 1705 |
|
| 1706 |
// AArch32-LABEL: @test_wsrf( |
| 1707 |
// AArch32-NEXT: entry: |
| 1708 |
// AArch32-NEXT: [[V_ADDR:%.*]] = alloca float, align 4 |
| 1709 |
// AArch32-NEXT: store float [[V:%.*]], ptr [[V_ADDR]], align 4 |
| 1710 |
// AArch32-NEXT: [[TMP0:%.*]] = load i32, ptr [[V_ADDR]], align 4 |
| 1711 |
// AArch32-NEXT: call void @llvm.write_register.i32(metadata [[META5]], i32 [[TMP0]]) |
| 1712 |
// AArch32-NEXT: ret void |
| 1713 |
// |
| 1714 |
// AArch64-LABEL: @test_wsrf( |
| 1715 |
// AArch64-NEXT: entry: |
| 1716 |
// AArch64-NEXT: [[V_ADDR:%.*]] = alloca float, align 4 |
| 1717 |
// AArch64-NEXT: store float [[V:%.*]], ptr [[V_ADDR]], align 4 |
| 1718 |
// AArch64-NEXT: [[TMP0:%.*]] = load i32, ptr [[V_ADDR]], align 4 |
| 1719 |
// AArch64-NEXT: [[TMP1:%.*]] = zext i32 [[TMP0]] to i64 |
| 1720 |
// AArch64-NEXT: call void @llvm.write_register.i64(metadata [[META4]], i64 [[TMP1]]) |
| 1721 |
// AArch64-NEXT: ret void |
| 1722 |
// |
| 1723 |
void test_wsrf(float v) { |
| 1724 |
#ifdef __ARM_32BIT_STATE |
| 1725 |
__arm_wsrf("cp1:2:c3:c4:5", v); |
| 1726 |
#else |
| 1727 |
__arm_wsrf("1:2:3:4:5", v); |
| 1728 |
#endif |
| 1729 |
} |
| 1730 |
|
| 1731 |
// AArch32-LABEL: @test_wsrf64( |
| 1732 |
// AArch32-NEXT: entry: |
| 1733 |
// AArch32-NEXT: [[V_ADDR:%.*]] = alloca double, align 8 |
| 1734 |
// AArch32-NEXT: store double [[V:%.*]], ptr [[V_ADDR]], align 8 |
| 1735 |
// AArch32-NEXT: [[TMP0:%.*]] = load i64, ptr [[V_ADDR]], align 8 |
| 1736 |
// AArch32-NEXT: call void @llvm.write_register.i64(metadata [[META6]], i64 [[TMP0]]) |
| 1737 |
// AArch32-NEXT: ret void |
| 1738 |
// |
| 1739 |
// AArch64-LABEL: @test_wsrf64( |
| 1740 |
// AArch64-NEXT: entry: |
| 1741 |
// AArch64-NEXT: [[V_ADDR:%.*]] = alloca double, align 8 |
| 1742 |
// AArch64-NEXT: store double [[V:%.*]], ptr [[V_ADDR]], align 8 |
| 1743 |
// AArch64-NEXT: [[TMP0:%.*]] = load i64, ptr [[V_ADDR]], align 8 |
| 1744 |
// AArch64-NEXT: call void @llvm.write_register.i64(metadata [[META4]], i64 [[TMP0]]) |
| 1745 |
// AArch64-NEXT: ret void |
| 1746 |
// |
| 1747 |
void test_wsrf64(double v) { |
| 1748 |
#ifdef __ARM_32BIT_STATE |
| 1749 |
__arm_wsrf64("cp1:2:c3", v); |
| 1750 |
#else |
| 1751 |
__arm_wsrf64("1:2:3:4:5", v); |
| 1752 |
#endif |
| 1753 |
} |
| 1754 |
|
| 1755 |
#if defined(__ARM_64BIT_STATE) && defined(__ARM_FEATURE_JCVT) |
| 1756 |
// AArch6483-LABEL: @test_jcvt( |
| 1757 |
// AArch6483-NEXT: entry: |
| 1758 |
// AArch6483-NEXT: [[TMP0:%.*]] = call i32 @llvm.aarch64.fjcvtzs(double [[V:%.*]]) |
| 1759 |
// AArch6483-NEXT: ret i32 [[TMP0]] |
| 1760 |
// |
| 1761 |
int32_t test_jcvt(double v) { |
| 1762 |
return __jcvt(v); |
| 1763 |
} |
| 1764 |
#endif |
| 1765 |
|
| 1766 |
#if defined(__ARM_FEATURE_DIRECTED_ROUNDING) && defined(__ARM_64BIT_STATE) |
| 1767 |
|
| 1768 |
// AArch64-LABEL: @test_rintn( |
| 1769 |
// AArch64-NEXT: entry: |
| 1770 |
// AArch64-NEXT: call double @llvm.roundeven.f64(double [[TMP0:%.*]]) |
| 1771 |
double test_rintn(double a) { |
| 1772 |
return __rintn(a); |
| 1773 |
} |
| 1774 |
|
| 1775 |
// AArch64-LABEL: @test_rintnf( |
| 1776 |
// AArch64-NEXT: entry: |
| 1777 |
// AArch64-NEXT: call float @llvm.roundeven.f32(float [[TMP0:%.*]]) |
| 1778 |
float test_rintnf(float b) { |
| 1779 |
return __rintnf(b); |
| 1780 |
} |
| 1781 |
#endif |
| 1782 |
|
| 1783 |
#if defined(__ARM_64BIT_STATE) && defined(__ARM_FEATURE_RNG) |
| 1784 |
|
| 1785 |
// AArch6485-LABEL: @test_rndr( |
| 1786 |
// AArch6485-NEXT: entry: |
| 1787 |
// AArch6485-NEXT: [[TMP0:%.*]] = call { i64, i1 } @llvm.aarch64.rndr() |
| 1788 |
// AArch6485-NEXT: [[TMP1:%.*]] = extractvalue { i64, i1 } [[TMP0]], 0 |
| 1789 |
// AArch6485-NEXT: [[TMP2:%.*]] = extractvalue { i64, i1 } [[TMP0]], 1 |
| 1790 |
// AArch6485-NEXT: store i64 [[TMP1]], ptr [[__ADDR:%.*]], align 8 |
| 1791 |
// AArch6485-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 |
| 1792 |
// AArch6485-NEXT: ret i32 [[TMP3]] |
| 1793 |
// |
| 1794 |
int test_rndr(uint64_t *__addr) { |
| 1795 |
return __rndr(__addr); |
| 1796 |
} |
| 1797 |
|
| 1798 |
// AArch6485-LABEL: @test_rndrrs( |
| 1799 |
// AArch6485-NEXT: entry: |
| 1800 |
// AArch6485-NEXT: [[TMP0:%.*]] = call { i64, i1 } @llvm.aarch64.rndrrs() |
| 1801 |
// AArch6485-NEXT: [[TMP1:%.*]] = extractvalue { i64, i1 } [[TMP0]], 0 |
| 1802 |
// AArch6485-NEXT: [[TMP2:%.*]] = extractvalue { i64, i1 } [[TMP0]], 1 |
| 1803 |
// AArch6485-NEXT: store i64 [[TMP1]], ptr [[__ADDR:%.*]], align 8 |
| 1804 |
// AArch6485-NEXT: [[TMP3:%.*]] = zext i1 [[TMP2]] to i32 |
| 1805 |
// AArch6485-NEXT: ret i32 [[TMP3]] |
| 1806 |
// |
| 1807 |
int test_rndrrs(uint64_t *__addr) { |
| 1808 |
return __rndrrs(__addr); |
| 1809 |
} |
| 1810 |
#endif |
| 1811 |
|
| 1812 |
|