xref: /llvm-project/clang/test/CodeGen/vector.cpp (revision fc935fc35bc2f76c4d1ec984a17e9db508a172de)
1 // RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
2 
3 typedef __attribute__((__vector_size__(16))) float float4;
4 typedef __attribute__((__vector_size__(16))) int int4;
5 typedef __attribute__((__vector_size__(16))) unsigned int uint4;
6 
7 // CHECK: @_Z5test1Dv4_j
test1(uint4 V0)8 int4 test1(uint4 V0) {
9   // CHECK: [[CMP0:%.*]] = icmp eq <4 x i32> [[V0:%.*]], zeroinitializer
10   // CHECK-NEXT: [[V1:%.*]] = sext <4 x i1> [[CMP0]] to <4 x i32>
11   int4 V = !V0;
12   return V;
13 }
14 
15 // CHECK: @_Z5test2Dv4_fS_
test2(float4 V0,float4 V1)16 int4 test2(float4 V0, float4 V1) {
17   // CHECK: [[CMP0:%.*]] = fcmp oeq <4 x float> [[V0:%.*]], zeroinitializer
18   // CHECK-NEXT: [[V1:%.*]] = sext <4 x i1> [[CMP0]] to <4 x i32>
19   int4 V = !V0;
20   return V;
21 }
22