Home | History | Annotate | Download | only in CodeGen
      1 // REQUIRES: aarch64-registered-target
      2 // RUN: %clang_cc1 -triple arm64-none-linux-gnu -target-feature +neon \
      3 // RUN:   -ffp-contract=fast -S -O3 -o - %s | FileCheck %s --check-prefix CHECK-COMMON --check-prefix CHECK-ARM64
      4 
      5 // Test new aarch64 intrinsics and types
      6 
      7 #include <arm_neon.h>
      8 
      9 int8x8_t test_vget_high_s8(int8x16_t a) {
     10   // CHECK-COMMON-LABEL: test_vget_high_s8:
     11   return vget_high_s8(a);
     12   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     13 }
     14 
     15 int16x4_t test_vget_high_s16(int16x8_t a) {
     16   // CHECK-COMMON-LABEL: test_vget_high_s16:
     17   return vget_high_s16(a);
     18   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     19 }
     20 
     21 int32x2_t test_vget_high_s32(int32x4_t a) {
     22   // CHECK-COMMON-LABEL: test_vget_high_s32:
     23   return vget_high_s32(a);
     24   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     25 }
     26 
     27 int64x1_t test_vget_high_s64(int64x2_t a) {
     28   // CHECK-COMMON-LABEL: test_vget_high_s64:
     29   return vget_high_s64(a);
     30   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     31 }
     32 
     33 uint8x8_t test_vget_high_u8(uint8x16_t a) {
     34   // CHECK-COMMON-LABEL: test_vget_high_u8:
     35   return vget_high_u8(a);
     36   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     37 }
     38 
     39 uint16x4_t test_vget_high_u16(uint16x8_t a) {
     40   // CHECK-COMMON-LABEL: test_vget_high_u16:
     41   return vget_high_u16(a);
     42   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     43 }
     44 
     45 uint32x2_t test_vget_high_u32(uint32x4_t a) {
     46   // CHECK-COMMON-LABEL: test_vget_high_u32:
     47   return vget_high_u32(a);
     48   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     49 }
     50 
     51 uint64x1_t test_vget_high_u64(uint64x2_t a) {
     52   // CHECK-COMMON-LABEL: test_vget_high_u64:
     53   return vget_high_u64(a);
     54   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     55 }
     56 
     57 poly64x1_t test_vget_high_p64(poly64x2_t a) {
     58   // CHECK-COMMON-LABEL: test_vget_high_p64:
     59   return vget_high_p64(a);
     60   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     61 }
     62 
     63 float16x4_t test_vget_high_f16(float16x8_t a) {
     64   // CHECK-COMMON-LABEL: test_vget_high_f16:
     65   return vget_high_f16(a);
     66   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     67 }
     68 
     69 float32x2_t test_vget_high_f32(float32x4_t a) {
     70   // CHECK-COMMON-LABEL: test_vget_high_f32:
     71   return vget_high_f32(a);
     72   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     73 }
     74 
     75 poly8x8_t test_vget_high_p8(poly8x16_t a) {
     76   // CHECK-COMMON-LABEL: test_vget_high_p8:
     77   return vget_high_p8(a);
     78   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     79 }
     80 
     81 poly16x4_t test_vget_high_p16(poly16x8_t a) {
     82   // CHECK-COMMON-LABEL: test_vget_high_p16
     83   return vget_high_p16(a);
     84   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     85 }
     86 
     87 float64x1_t test_vget_high_f64(float64x2_t a) {
     88   // CHECK-COMMON-LABEL: test_vget_high_f64
     89   return vget_high_f64(a);
     90   // CHECK-ARM64: ext v0.16b, v0.16b, v0.16b, #8
     91 }
     92 
     93 int8x8_t test_vget_low_s8(int8x16_t a) {
     94   // CHECK-COMMON-LABEL: test_vget_low_s8:
     95   return vget_low_s8(a);
     96   // CHECK-COMMON-NEXT: ret
     97 }
     98 
     99 int16x4_t test_vget_low_s16(int16x8_t a) {
    100   // CHECK-COMMON-LABEL: test_vget_low_s16:
    101   return vget_low_s16(a);
    102   // CHECK-COMMON-NEXT: ret
    103 }
    104 
    105 int32x2_t test_vget_low_s32(int32x4_t a) {
    106   // CHECK-COMMON-LABEL: test_vget_low_s32:
    107   return vget_low_s32(a);
    108   // CHECK-COMMON-NEXT: ret
    109 }
    110 
    111 int64x1_t test_vget_low_s64(int64x2_t a) {
    112   // CHECK-COMMON-LABEL: test_vget_low_s64:
    113   return vget_low_s64(a);
    114   // CHECK-COMMON-NEXT: ret
    115 }
    116 
    117 uint8x8_t test_vget_low_u8(uint8x16_t a) {
    118   // CHECK-COMMON-LABEL: test_vget_low_u8:
    119   return vget_low_u8(a);
    120   // CHECK-COMMON-NEXT: ret
    121 }
    122 
    123 uint16x4_t test_vget_low_u16(uint16x8_t a) {
    124   // CHECK-COMMON-LABEL: test_vget_low_u16:
    125   return vget_low_u16(a);
    126   // CHECK-COMMON-NEXT: ret
    127 }
    128 
    129 uint32x2_t test_vget_low_u32(uint32x4_t a) {
    130   // CHECK-COMMON-LABEL: test_vget_low_u32:
    131   return vget_low_u32(a);
    132   // CHECK-COMMON-NEXT: ret
    133 }
    134 
    135 uint64x1_t test_vget_low_u64(uint64x2_t a) {
    136   // CHECK-COMMON-LABEL: test_vget_low_u64:
    137   return vget_low_u64(a);
    138   // CHECK-COMMON-NEXT: ret
    139 }
    140 
    141 poly64x1_t test_vget_low_p64(poly64x2_t a) {
    142   // CHECK-COMMON-LABEL: test_vget_low_p64:
    143   return vget_low_p64(a);
    144   // CHECK-COMMON-NEXT: ret
    145 }
    146 
    147 float16x4_t test_vget_low_f16(float16x8_t a) {
    148   // CHECK-COMMON-LABEL: test_vget_low_f16:
    149   return vget_low_f16(a);
    150   // CHECK-COMMON-NEXT: ret
    151 }
    152 
    153 float32x2_t test_vget_low_f32(float32x4_t a) {
    154   // CHECK-COMMON-LABEL: test_vget_low_f32:
    155   return vget_low_f32(a);
    156   // CHECK-COMMON-NEXT: ret
    157 }
    158 
    159 poly8x8_t test_vget_low_p8(poly8x16_t a) {
    160   // CHECK-COMMON-LABEL: test_vget_low_p8:
    161   return vget_low_p8(a);
    162   // CHECK-COMMON-NEXT: ret
    163 }
    164 
    165 poly16x4_t test_vget_low_p16(poly16x8_t a) {
    166   // CHECK-COMMON-LABEL: test_vget_low_p16:
    167   return vget_low_p16(a);
    168   // CHECK-COMMON-NEXT: ret
    169 }
    170 
    171 float64x1_t test_vget_low_f64(float64x2_t a) {
    172   // CHECK-COMMON-LABEL: test_vget_low_f64:
    173   return vget_low_f64(a);
    174   // CHECK-COMMON-NEXT: ret
    175 }
    176 
    177