1 ; RUN: rs2spirv_lit_driver.sh %s | FileCheck %s 2 3 target datalayout = "e-p:32:32-i64:64-v128:64:128-n32-S64" 4 target triple = "armv7-none-linux-gnueabi" 5 6 ; CHECK: [[GLSL_EXT_INS:%.*]] = OpExtInstImport "GLSL.std.450" 7 ; CHECK: OpEntryPoint GLCompute [[WrapperId:%[a-zA-Z_0-9]*]] "entry_contrast" 8 9 ; CHECK-NOT: OpFunctionCall %v3float %_Z14convert_float3Dv3_h 10 ; CHECK-NOT: OpFunctionCall %v3float %_Z5clampDv3_fff 11 ; CHECK-NOT: OpFunctionCall %v3uchar %_Z14convert_uchar3Dv3_f 12 13 ; CHECK: OpConvertUToF %v3float 14 ; CHECK: OpExtInst %v3float [[GLSL_EXT_INS]] FClamp 15 ; CHECK: OpConvertFToU %v3uchar 16 17 18 @brightM = internal unnamed_addr global float 0.000000e+00, align 4 19 @brightC = internal unnamed_addr global float 0.000000e+00, align 4 20 21 ; Function Attrs: nounwind 22 define void @setBright(float %v) #0 { 23 entry: 24 %div = fdiv float %v, 1.000000e+02 25 %call = tail call float @_Z3powff(float 2.000000e+00, float %div) #4 26 store float %call, float* @brightM, align 4, !tbaa !11 27 %mul = fmul float %call, 1.270000e+02 28 %sub = fsub float 1.270000e+02, %mul 29 store float %sub, float* @brightC, align 4, !tbaa !11 30 ret void 31 } 32 33 ; Function Attrs: nounwind readnone 34 declare float @_Z3powff(float, float) #1 35 36 ; Function Attrs: nounwind readonly 37 define <4 x i8> @contrast(<4 x i8> %in) #2 { 38 entry: 39 %0 = shufflevector <4 x i8> %in, <4 x i8> undef, <3 x i32> <i32 0, i32 1, i32 2> 40 %call = tail call <3 x float> @_Z14convert_float3Dv3_h(<3 x i8> %0) #4 41 %1 = load float, float* @brightM, align 4, !tbaa !11 42 %splat.splatinsert = insertelement <3 x float> undef, float %1, i32 0 43 %splat.splat = shufflevector <3 x float> %splat.splatinsert, <3 x float> undef, <3 x i32> zeroinitializer 44 %mul = fmul <3 x float> %call, %splat.splat 45 %2 = load float, float* @brightC, align 4, !tbaa !11 46 %splat.splatinsert1 = insertelement <3 x float> undef, float %2, i32 0 47 %splat.splat2 = shufflevector <3 x float> %splat.splatinsert1, <3 x float> undef, <3 x i32> zeroinitializer 48 %add = fadd <3 x float> %mul, %splat.splat2 49 %call4 = tail call <3 x float> @_Z5clampDv3_fff(<3 x float> %add, float 0.000000e+00, float 2.550000e+02) #4 50 %call5 = tail call <3 x i8> @_Z14convert_uchar3Dv3_f(<3 x float> %call4) #4 51 %3 = shufflevector <3 x i8> %call5, <3 x i8> undef, <4 x i32> <i32 0, i32 1, i32 2, i32 undef> 52 %4 = insertelement <4 x i8> %3, i8 -1, i32 3 53 ret <4 x i8> %4 54 } 55 56 ; Function Attrs: nounwind readnone 57 declare <3 x float> @_Z14convert_float3Dv3_h(<3 x i8>) #1 58 59 ; Function Attrs: nounwind readnone 60 declare <3 x i8> @_Z14convert_uchar3Dv3_f(<3 x float>) #1 61 62 ; Function Attrs: nounwind readnone 63 declare <3 x float> @_Z5clampDv3_fff(<3 x float>, float, float) #1 64 65 ; Function Attrs: noinline nounwind 66 define void @.helper_setBright({ float }* nocapture) #3 { 67 entry: 68 %1 = getelementptr inbounds { float }, { float }* %0, i32 0, i32 0 69 %2 = load float, float* %1, align 4 70 tail call void @setBright(float %2) 71 ret void 72 } 73 74 attributes #0 = { nounwind "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="0" "stackrealign" "target-features"="+long64" "unsafe-fp-math"="false" "use-soft-float"="false" } 75 attributes #1 = { nounwind readnone "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="0" "stackrealign" "target-features"="+long64" "unsafe-fp-math"="false" "use-soft-float"="false" } 76 attributes #2 = { nounwind readonly "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "stack-protector-buffer-size"="0" "stackrealign" "target-features"="+long64" "unsafe-fp-math"="false" "use-soft-float"="false" } 77 attributes #3 = { noinline nounwind } 78 attributes #4 = { nounwind readnone } 79 80 !llvm.module.flags = !{!0, !1} 81 !llvm.ident = !{!2} 82 !\23pragma = !{!3, !4, !5} 83 !\23rs_export_func = !{!6} 84 !\23rs_export_foreach_name = !{!7, !8} 85 !\23rs_export_foreach = !{!9, !10} 86 87 !0 = !{i32 1, !"wchar_size", i32 4} 88 !1 = !{i32 1, !"min_enum_size", i32 4} 89 !2 = !{!"Android clang version 3.8.256229 (based on LLVM 3.8.256229)"} 90 !3 = !{!"version", !"1"} 91 !4 = !{!"java_package_name", !"rs2spirv"} 92 !5 = !{!"rs_fp_relaxed", !""} 93 !6 = !{!".helper_setBright"} 94 !7 = !{!"root"} 95 !8 = !{!"contrast"} 96 !9 = !{!"0"} 97 !10 = !{!"35"} 98 !11 = !{!12, !12, i64 0} 99 !12 = !{!"float", !13, i64 0} 100 !13 = !{!"omnipotent char", !14, i64 0} 101 !14 = !{!"Simple C/C++ TBAA"} 102