1*f4a2713aSLionel Sambuc// RUN: %clang_cc1 %s -emit-llvm -o - -cl-std=CL1.2 -O1 -triple x86_64-unknown-linux-gnu | FileCheck %s 2*f4a2713aSLionel Sambuc 3*f4a2713aSLionel Sambuc#pragma OPENCL EXTENSION cl_khr_fp64 : enable 4*f4a2713aSLionel Sambuc 5*f4a2713aSLionel Sambuctypedef int int4 __attribute((ext_vector_type(4))); 6*f4a2713aSLionel Sambuctypedef long long4 __attribute((ext_vector_type(4))); 7*f4a2713aSLionel Sambuctypedef float float4 __attribute((ext_vector_type(4))); 8*f4a2713aSLionel Sambuctypedef double double4 __attribute((ext_vector_type(4))); 9*f4a2713aSLionel Sambuc 10*f4a2713aSLionel Sambuc// CHECK: floatops 11*f4a2713aSLionel Sambuckernel void floatops(global int4 *out, global float4 *fout) { 12*f4a2713aSLionel Sambuc // CHECK: store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1> 13*f4a2713aSLionel Sambuc out[0] = (float4)(1, 1, 1, 1) && 1.0f; 14*f4a2713aSLionel Sambuc // CHECK: store <4 x i32> zeroinitializer 15*f4a2713aSLionel Sambuc out[1] = (float4)(0, 0, 0, 0) && (float4)(0, 0, 0, 0); 16*f4a2713aSLionel Sambuc 17*f4a2713aSLionel Sambuc // CHECK: store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1> 18*f4a2713aSLionel Sambuc out[2] = (float4)(0, 0, 0, 0) || (float4)(1, 1, 1, 1); 19*f4a2713aSLionel Sambuc // CHECK: store <4 x i32> zeroinitializer 20*f4a2713aSLionel Sambuc out[3] = (float4)(0, 0, 0, 0) || 0.0f; 21*f4a2713aSLionel Sambuc 22*f4a2713aSLionel Sambuc // CHECK: store <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1> 23*f4a2713aSLionel Sambuc out[4] = !(float4)(0, 0, 0, 0); 24*f4a2713aSLionel Sambuc // CHECK: store <4 x i32> zeroinitializer 25*f4a2713aSLionel Sambuc out[5] = !(float4)(1, 2, 3, 4); 26*f4a2713aSLionel Sambuc // CHECK: store <4 x i32> <i32 -1, i32 0, i32 -1, i32 0> 27*f4a2713aSLionel Sambuc out[6] = !(float4)(0, 1, 0, 1); 28*f4a2713aSLionel Sambuc // CHECK: store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> 29*f4a2713aSLionel Sambuc fout[0] = (float4)(!0.0f); 30*f4a2713aSLionel Sambuc // CHECK: store <4 x float> zeroinitializer 31*f4a2713aSLionel Sambuc fout[1] = (float4)(!1.0f); 32*f4a2713aSLionel Sambuc} 33*f4a2713aSLionel Sambuc 34*f4a2713aSLionel Sambuc// CHECK: doubleops 35*f4a2713aSLionel Sambuckernel void doubleops(global long4 *out, global double4 *dout) { 36*f4a2713aSLionel Sambuc // CHECK: store <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1> 37*f4a2713aSLionel Sambuc out[0] = (double4)(1, 1, 1, 1) && 1.0; 38*f4a2713aSLionel Sambuc // CHECK: store <4 x i64> zeroinitializer 39*f4a2713aSLionel Sambuc out[1] = (double4)(0, 0, 0, 0) && (double4)(0, 0, 0, 0); 40*f4a2713aSLionel Sambuc 41*f4a2713aSLionel Sambuc // CHECK: store <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1> 42*f4a2713aSLionel Sambuc out[2] = (double4)(0, 0, 0, 0) || (double4)(1, 1, 1, 1); 43*f4a2713aSLionel Sambuc // CHECK: store <4 x i64> zeroinitializer 44*f4a2713aSLionel Sambuc out[3] = (double4)(0, 0, 0, 0) || 0.0f; 45*f4a2713aSLionel Sambuc 46*f4a2713aSLionel Sambuc // CHECK: store <4 x i64> <i64 -1, i64 -1, i64 -1, i64 -1> 47*f4a2713aSLionel Sambuc out[4] = !(double4)(0, 0, 0, 0); 48*f4a2713aSLionel Sambuc // CHECK: store <4 x i64> zeroinitializer 49*f4a2713aSLionel Sambuc out[5] = !(double4)(1, 2, 3, 4); 50*f4a2713aSLionel Sambuc // CHECK: store <4 x i64> <i64 -1, i64 0, i64 -1, i64 0> 51*f4a2713aSLionel Sambuc out[6] = !(double4)(0, 1, 0, 1); 52*f4a2713aSLionel Sambuc // CHECK: store <4 x double> <double 1.000000e+00, double 1.000000e+00, double 1.000000e+00, double 1.000000e+00> 53*f4a2713aSLionel Sambuc dout[0] = (double4)(!0.0f); 54*f4a2713aSLionel Sambuc // CHECK: store <4 x double> zeroinitializer 55*f4a2713aSLionel Sambuc dout[1] = (double4)(!1.0f); 56*f4a2713aSLionel Sambuc} 57