Home | History | Annotate | Download | only in CodeGen
      1 // RUN: %clang_cc1 -O1 -triple arm64-apple-ios7 -target-feature +neon -ffreestanding -S -o - -emit-llvm %s | FileCheck %s
      2 // Test ARM64 SIMD add intrinsics
      3 
      4 #include <arm_neon.h>
      5 int64_t test_vaddlv_s32(int32x2_t a1) {
      6   // CHECK: test_vaddlv_s32
      7   return vaddlv_s32(a1);
      8   // CHECK: llvm.aarch64.neon.saddlv.i64.v2i32
      9   // CHECK-NEXT: ret
     10 }
     11 
     12 uint64_t test_vaddlv_u32(uint32x2_t a1) {
     13   // CHECK: test_vaddlv_u32
     14   return vaddlv_u32(a1);
     15   // CHECK: llvm.aarch64.neon.uaddlv.i64.v2i32
     16   // CHECK-NEXT: ret
     17 }
     18 
     19 int8_t test_vaddv_s8(int8x8_t a1) {
     20   // CHECK: test_vaddv_s8
     21   return vaddv_s8(a1);
     22   // CHECK: llvm.aarch64.neon.saddv.i32.v8i8
     23   // don't check for return here (there's a trunc?)
     24 }
     25 
     26 int16_t test_vaddv_s16(int16x4_t a1) {
     27   // CHECK: test_vaddv_s16
     28   return vaddv_s16(a1);
     29   // CHECK: llvm.aarch64.neon.saddv.i32.v4i16
     30   // don't check for return here (there's a trunc?)
     31 }
     32 
     33 int32_t test_vaddv_s32(int32x2_t a1) {
     34   // CHECK: test_vaddv_s32
     35   return vaddv_s32(a1);
     36   // CHECK: llvm.aarch64.neon.saddv.i32.v2i32
     37   // CHECK-NEXT: ret
     38 }
     39 
     40 uint8_t test_vaddv_u8(int8x8_t a1) {
     41   // CHECK: test_vaddv_u8
     42   return vaddv_u8(a1);
     43   // CHECK: llvm.aarch64.neon.uaddv.i32.v8i8
     44   // don't check for return here (there's a trunc?)
     45 }
     46 
     47 uint16_t test_vaddv_u16(int16x4_t a1) {
     48   // CHECK: test_vaddv_u16
     49   return vaddv_u16(a1);
     50   // CHECK: llvm.aarch64.neon.uaddv.i32.v4i16
     51   // don't check for return here (there's a trunc?)
     52 }
     53 
     54 uint32_t test_vaddv_u32(int32x2_t a1) {
     55   // CHECK: test_vaddv_u32
     56   return vaddv_u32(a1);
     57   // CHECK: llvm.aarch64.neon.uaddv.i32.v2i32
     58   // CHECK-NEXT: ret
     59 }
     60 
     61 int8_t test_vaddvq_s8(int8x16_t a1) {
     62   // CHECK: test_vaddvq_s8
     63   return vaddvq_s8(a1);
     64   // CHECK: llvm.aarch64.neon.saddv.i32.v16i8
     65   // don't check for return here (there's a trunc?)
     66 }
     67 
     68 int16_t test_vaddvq_s16(int16x8_t a1) {
     69   // CHECK: test_vaddvq_s16
     70   return vaddvq_s16(a1);
     71   // CHECK: llvm.aarch64.neon.saddv.i32.v8i16
     72   // don't check for return here (there's a trunc?)
     73 }
     74 
     75 int32_t test_vaddvq_s32(int32x4_t a1) {
     76   // CHECK: test_vaddvq_s32
     77   return vaddvq_s32(a1);
     78   // CHECK: llvm.aarch64.neon.saddv.i32.v4i32
     79   // CHECK-NEXT: ret
     80 }
     81 
     82 uint8_t test_vaddvq_u8(int8x16_t a1) {
     83   // CHECK: test_vaddvq_u8
     84   return vaddvq_u8(a1);
     85   // CHECK: llvm.aarch64.neon.uaddv.i32.v16i8
     86   // don't check for return here (there's a trunc?)
     87 }
     88 
     89 uint16_t test_vaddvq_u16(int16x8_t a1) {
     90   // CHECK: test_vaddvq_u16
     91   return vaddvq_u16(a1);
     92   // CHECK: llvm.aarch64.neon.uaddv.i32.v8i16
     93   // don't check for return here (there's a trunc?)
     94 }
     95 
     96 uint32_t test_vaddvq_u32(int32x4_t a1) {
     97   // CHECK: test_vaddvq_u32
     98   return vaddvq_u32(a1);
     99   // CHECK: llvm.aarch64.neon.uaddv.i32.v4i32
    100   // CHECK-NEXT: ret
    101 }
    102 
    103