1 // RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s
3 // CHECK-LABEL: builtin_bool_to_float_type_promotion
4 // CHECK: %conv1 = uitofp i1 %loadedv to double
5 // CHECK: %hlsl.dot = fmul reassoc nnan ninf nsz arcp afn double %conv, %conv1
6 // CHECK: %conv2 = fptrunc reassoc nnan ninf nsz arcp afn double %hlsl.dot to float
7 // CHECK: ret float %conv2
8 float builtin_bool_to_float_type_promotion ( float p0, bool p1 ) {
9 return __builtin_hlsl_dot ( p0, p1 );
12 // CHECK-LABEL: builtin_bool_to_float_arg1_type_promotion
13 // CHECK: %conv = uitofp i1 %loadedv to double
14 // CHECK: %conv1 = fpext reassoc nnan ninf nsz arcp afn float %1 to double
15 // CHECK: %hlsl.dot = fmul reassoc nnan ninf nsz arcp afn double %conv, %conv1
16 // CHECK: %conv2 = fptrunc reassoc nnan ninf nsz arcp afn double %hlsl.dot to float
17 // CHECK: ret float %conv2
18 float builtin_bool_to_float_arg1_type_promotion ( bool p0, float p1 ) {
19 return __builtin_hlsl_dot ( p0, p1 );
22 // CHECK-LABEL: builtin_dot_int_to_float_promotion
23 // CHECK: %conv = fpext reassoc nnan ninf nsz arcp afn float %0 to double
24 // CHECK: %conv1 = sitofp i32 %1 to double
25 // CHECK: dot = fmul reassoc nnan ninf nsz arcp afn double %conv, %conv1
26 // CHECK: %conv2 = fptrunc reassoc nnan ninf nsz arcp afn double %hlsl.dot to float
27 // CHECK: ret float %conv2
28 float builtin_dot_int_to_float_promotion ( float p0, int p1 ) {
29 return __builtin_hlsl_dot ( p0, p1 );