blob: 77d574cf0e29f866e9e727b0d41f808d739692fb [file] [log] [blame]
Jiangning Liu9f2b0f82013-11-06 02:26:12 +00001// REQUIRES: aarch64-registered-target
Stephen Hines651f13c2014-04-23 16:59:28 -07002// REQUIRES: arm64-registered-target
Jiangning Liu9f2b0f82013-11-06 02:26:12 +00003// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon \
4// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
Stephen Hines651f13c2014-04-23 16:59:28 -07005// RUN: %clang_cc1 -triple arm64-none-linux-gnu \
6// RUN: -ffp-contract=fast -S -O3 -o - %s | FileCheck %s
Jiangning Liu9f2b0f82013-11-06 02:26:12 +00007
8// Test new aarch64 intrinsics and types
9
10#include <arm_neon.h>
11
12int8x8_t test_vext_s8(int8x8_t a, int8x8_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070013 // CHECK-LABEL: test_vext_s8
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000014 return vext_s8(a, b, 2);
Stephen Hines651f13c2014-04-23 16:59:28 -070015 // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?2}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000016}
17
18int16x4_t test_vext_s16(int16x4_t a, int16x4_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070019 // CHECK-LABEL: test_vext_s16
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000020 return vext_s16(a, b, 3);
Stephen Hines651f13c2014-04-23 16:59:28 -070021 // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?6}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000022}
23
24int32x2_t test_vext_s32(int32x2_t a, int32x2_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070025 // CHECK-LABEL: test_vext_s32
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000026 return vext_s32(a, b, 1);
Stephen Hines651f13c2014-04-23 16:59:28 -070027 // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?4}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000028}
29
30int64x1_t test_vext_s64(int64x1_t a, int64x1_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070031 // CHECK-LABEL: test_vext_s64
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000032 return vext_s64(a, b, 0);
33}
34
35int8x16_t test_vextq_s8(int8x16_t a, int8x16_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070036 // CHECK-LABEL: test_vextq_s8
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000037 return vextq_s8(a, b, 2);
Stephen Hines651f13c2014-04-23 16:59:28 -070038 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?2}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000039}
40
41int16x8_t test_vextq_s16(int16x8_t a, int16x8_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070042 // CHECK-LABEL: test_vextq_s16
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000043 return vextq_s16(a, b, 3);
Stephen Hines651f13c2014-04-23 16:59:28 -070044 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?6}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000045}
46
47int32x4_t test_vextq_s32(int32x4_t a, int32x4_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070048 // CHECK-LABEL: test_vextq_s32
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000049 return vextq_s32(a, b, 1);
Stephen Hines651f13c2014-04-23 16:59:28 -070050 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?4}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000051}
52
53int64x2_t test_vextq_s64(int64x2_t a, int64x2_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070054 // CHECK-LABEL: test_vextq_s64
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000055 return vextq_s64(a, b, 1);
Stephen Hines651f13c2014-04-23 16:59:28 -070056 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?8}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000057}
58
59uint8x8_t test_vext_u8(uint8x8_t a, uint8x8_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070060 // CHECK-LABEL: test_vext_u8
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000061 return vext_u8(a, b, 2);
Stephen Hines651f13c2014-04-23 16:59:28 -070062 // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?2}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000063}
64
65uint16x4_t test_vext_u16(uint16x4_t a, uint16x4_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070066 // CHECK-LABEL: test_vext_u16
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000067 return vext_u16(a, b, 3);
Stephen Hines651f13c2014-04-23 16:59:28 -070068 // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?6}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000069}
70
71uint32x2_t test_vext_u32(uint32x2_t a, uint32x2_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070072 // CHECK-LABEL: test_vext_u32
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000073 return vext_u32(a, b, 1);
Stephen Hines651f13c2014-04-23 16:59:28 -070074 // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?4}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000075}
76
77uint64x1_t test_vext_u64(uint64x1_t a, uint64x1_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070078 // CHECK-LABEL: test_vext_u64
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000079 return vext_u64(a, b, 0);
80}
81
82uint8x16_t test_vextq_u8(uint8x16_t a, uint8x16_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070083 // CHECK-LABEL: test_vextq_u8
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000084 return vextq_u8(a, b, 2);
Stephen Hines651f13c2014-04-23 16:59:28 -070085 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?2}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000086}
87
88uint16x8_t test_vextq_u16(uint16x8_t a, uint16x8_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070089 // CHECK-LABEL: test_vextq_u16
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000090 return vextq_u16(a, b, 3);
Stephen Hines651f13c2014-04-23 16:59:28 -070091 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?6}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000092}
93
94uint32x4_t test_vextq_u32(uint32x4_t a, uint32x4_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -070095 // CHECK-LABEL: test_vextq_u32
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000096 return vextq_u32(a, b, 1);
Stephen Hines651f13c2014-04-23 16:59:28 -070097 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?4}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +000098}
99
100uint64x2_t test_vextq_u64(uint64x2_t a, uint64x2_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700101 // CHECK-LABEL: test_vextq_u64
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000102 return vextq_u64(a, b, 1);
Stephen Hines651f13c2014-04-23 16:59:28 -0700103 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?8}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000104}
105
106float32x2_t test_vext_f32(float32x2_t a, float32x2_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700107 // CHECK-LABEL: test_vext_f32
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000108 return vext_f32(a, b, 1);
Stephen Hines651f13c2014-04-23 16:59:28 -0700109 // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?4}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000110}
111
112float64x1_t test_vext_f64(float64x1_t a, float64x1_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700113 // CHECK-LABEL: test_vext_f64
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000114 return vext_f64(a, b, 0);
115}
116
117float32x4_t test_vextq_f32(float32x4_t a, float32x4_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700118 // CHECK-LABEL: test_vextq_f32
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000119 return vextq_f32(a, b, 1);
Stephen Hines651f13c2014-04-23 16:59:28 -0700120 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?4}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000121}
122
123float64x2_t test_vextq_f64(float64x2_t a, float64x2_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700124 // CHECK-LABEL: test_vextq_f64
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000125 return vextq_f64(a, b, 1);
Stephen Hines651f13c2014-04-23 16:59:28 -0700126 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?8}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000127}
128
129poly8x8_t test_vext_p8(poly8x8_t a, poly8x8_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700130 // CHECK-LABEL: test_vext_p8
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000131 return vext_p8(a, b, 2);
Stephen Hines651f13c2014-04-23 16:59:28 -0700132 // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?2}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000133}
134
135poly16x4_t test_vext_p16(poly16x4_t a, poly16x4_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700136 // CHECK-LABEL: test_vext_p16
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000137 return vext_p16(a, b, 3);
Stephen Hines651f13c2014-04-23 16:59:28 -0700138 // CHECK: ext {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, {{v[0-9]+}}.8b, #{{(0x)?6}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000139}
140
141poly8x16_t test_vextq_p8(poly8x16_t a, poly8x16_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700142 // CHECK-LABEL: test_vextq_p8
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000143 return vextq_p8(a, b, 2);
Stephen Hines651f13c2014-04-23 16:59:28 -0700144 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?2}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000145}
146
147poly16x8_t test_vextq_p16(poly16x8_t a, poly16x8_t b) {
Stephen Hines651f13c2014-04-23 16:59:28 -0700148 // CHECK-LABEL: test_vextq_p16
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000149 return vextq_p16(a, b, 3);
Stephen Hines651f13c2014-04-23 16:59:28 -0700150 // CHECK: ext {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, {{v[0-9]+}}.16b, #{{(0x)?6}}
Jiangning Liu9f2b0f82013-11-06 02:26:12 +0000151}