1 // REQUIRES: systemz-registered-target
2 // RUN: %clang_cc1 -target-cpu z16 -triple s390x-ibm-linux -flax-vector-conversions=none \
3 // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
5 typedef __attribute__((vector_size(16))) signed char vec_schar
;
6 typedef __attribute__((vector_size(16))) signed short vec_sshort
;
7 typedef __attribute__((vector_size(16))) signed int vec_sint
;
8 typedef __attribute__((vector_size(16))) signed long long vec_slong
;
9 typedef __attribute__((vector_size(16))) unsigned char vec_uchar
;
10 typedef __attribute__((vector_size(16))) unsigned short vec_ushort
;
11 typedef __attribute__((vector_size(16))) unsigned int vec_uint
;
12 typedef __attribute__((vector_size(16))) unsigned long long vec_ulong
;
13 typedef __attribute__((vector_size(16))) double vec_double
;
14 typedef __attribute__((vector_size(16))) float vec_float
;
16 volatile vec_schar vsc
;
17 volatile vec_sshort vss
;
18 volatile vec_sint vsi
;
19 volatile vec_slong vsl
;
20 volatile vec_uchar vuc
;
21 volatile vec_ushort vus
;
22 volatile vec_uint vui
;
23 volatile vec_ulong vul
;
24 volatile vec_double vd
;
25 volatile vec_float vf
;
27 void test_nnp_assist(void) {
28 vf
= __builtin_s390_vclfnhs(vus
, 0);
29 // CHECK: call <4 x float> @llvm.s390.vclfnhs(<8 x i16> %{{.*}}, i32 0)
30 vf
= __builtin_s390_vclfnhs(vus
, 15);
31 // CHECK: call <4 x float> @llvm.s390.vclfnhs(<8 x i16> %{{.*}}, i32 15)
33 vf
= __builtin_s390_vclfnls(vus
, 0);
34 // CHECK: call <4 x float> @llvm.s390.vclfnls(<8 x i16> %{{.*}}, i32 0)
35 vf
= __builtin_s390_vclfnls(vus
, 15);
36 // CHECK: call <4 x float> @llvm.s390.vclfnls(<8 x i16> %{{.*}}, i32 15)
38 vus
= __builtin_s390_vcrnfs(vf
, vf
, 0);
39 // CHECK: call <8 x i16> @llvm.s390.vcrnfs(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 0)
40 vus
= __builtin_s390_vcrnfs(vf
, vf
, 15);
41 // CHECK: call <8 x i16> @llvm.s390.vcrnfs(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 15)
43 vus
= __builtin_s390_vcfn(vus
, 0);
44 // CHECK: call <8 x i16> @llvm.s390.vcfn(<8 x i16> %{{.*}} i32 0)
45 vus
= __builtin_s390_vcfn(vus
, 15);
46 // CHECK: call <8 x i16> @llvm.s390.vcfn(<8 x i16> %{{.*}} i32 15)
48 vus
= __builtin_s390_vcnf(vus
, 0);
49 // CHECK: call <8 x i16> @llvm.s390.vcnf(<8 x i16> %{{.*}} i32 0)
50 vus
= __builtin_s390_vcnf(vus
, 15);
51 // CHECK: call <8 x i16> @llvm.s390.vcnf(<8 x i16> %{{.*}} i32 15)