1 // REQUIRES: systemz-registered-target
2 // RUN: %clang_cc1 -target-cpu z16 -triple s390x-linux-gnu \
3 // RUN: -O2 -fzvector -flax-vector-conversions=none \
4 // RUN: -Wall -Wno-unused -Werror -emit-llvm %s -o - | FileCheck %s
5 // RUN: %clang_cc1 -target-cpu z16 -triple s390x-linux-gnu \
6 // RUN: -O2 -fzvector -flax-vector-conversions=none \
7 // RUN: -Wall -Wno-unused -Werror -S %s -o - | FileCheck %s --check-prefix=CHECK-ASM
11 volatile vector
signed char vsc
;
12 volatile vector
signed short vss
;
13 volatile vector
signed int vsi
;
14 volatile vector
signed long long vsl
;
15 volatile vector
unsigned char vuc
;
16 volatile vector
unsigned short vus
;
17 volatile vector
unsigned int vui
;
18 volatile vector
unsigned long long vul
;
19 volatile vector
bool char vbc
;
20 volatile vector
bool short vbs
;
21 volatile vector
bool int vbi
;
22 volatile vector
bool long long vbl
;
23 volatile vector
float vf
;
24 volatile vector
double vd
;
26 void test_nnp_assist(void) {
27 // CHECK-ASM-LABEL: test_nnp_assist
29 vf
= vec_extend_to_fp32_hi(vus
, 0);
30 // CHECK: call <4 x float> @llvm.s390.vclfnhs(<8 x i16> %{{.*}}, i32 0)
32 vf
= vec_extend_to_fp32_hi(vus
, 15);
33 // CHECK: call <4 x float> @llvm.s390.vclfnhs(<8 x i16> %{{.*}}, i32 15)
36 vf
= vec_extend_to_fp32_lo(vus
, 0);
37 // CHECK: call <4 x float> @llvm.s390.vclfnls(<8 x i16> %{{.*}}, i32 0)
39 vf
= vec_extend_to_fp32_lo(vus
, 15);
40 // CHECK: call <4 x float> @llvm.s390.vclfnls(<8 x i16> %{{.*}}, i32 15)
43 vus
= vec_round_from_fp32(vf
, vf
, 0);
44 // CHECK: call <8 x i16> @llvm.s390.vcrnfs(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 0)
46 vus
= vec_round_from_fp32(vf
, vf
, 15);
47 // CHECK: call <8 x i16> @llvm.s390.vcrnfs(<4 x float> %{{.*}}, <4 x float> %{{.*}}, i32 15)
50 vus
= vec_convert_to_fp16(vus
, 0);
51 // CHECK: call <8 x i16> @llvm.s390.vcfn(<8 x i16> %{{.*}} i32 0)
53 vus
= vec_convert_to_fp16(vus
, 15);
54 // CHECK: call <8 x i16> @llvm.s390.vcfn(<8 x i16> %{{.*}} i32 15)
57 vus
= vec_convert_from_fp16(vus
, 0);
58 // CHECK: call <8 x i16> @llvm.s390.vcnf(<8 x i16> %{{.*}} i32 0)
60 vus
= vec_convert_from_fp16(vus
, 15);
61 // CHECK: call <8 x i16> @llvm.s390.vcnf(<8 x i16> %{{.*}} i32 15)