1 ; RUN: llc -O0 -mtriple=spirv-unknown-linux %s -o - | FileCheck %s
3 ; CHECK: %[[#extinst:]] = OpExtInstImport "GLSL.std.450"
5 ; CHECK: %[[#float:]] = OpTypeFloat 32
6 ; CHECK: %[[#v4float:]] = OpTypeVector %[[#float]] 4
7 ; CHECK: %[[#float_0_30103001:]] = OpConstant %[[#float]] 0.30103000998497009
8 ; CHECK: %[[#_ptr_Function_v4float:]] = OpTypePointer Function %[[#v4float]]
9 ; CHECK: %[[#_ptr_Function_float:]] = OpTypePointer Function %[[#float]]
13 ; CHECK: %[[#f:]] = OpVariable %[[#_ptr_Function_float]] Function
14 ; CHECK: %[[#logf:]] = OpVariable %[[#_ptr_Function_float]] Function
15 ; CHECK: %[[#f4:]] = OpVariable %[[#_ptr_Function_v4float]] Function
16 ; CHECK: %[[#logf4:]] = OpVariable %[[#_ptr_Function_v4float]] Function
17 %f = alloca float, align 4
18 %logf = alloca float, align 4
19 %f4 = alloca <4 x float>, align 16
20 %logf4 = alloca <4 x float>, align 16
22 ; CHECK: %[[#load:]] = OpLoad %[[#float]] %[[#f]] Aligned 4
23 ; CHECK: %[[#log2:]] = OpExtInst %[[#float]] %[[#extinst]] Log2 %[[#load]]
24 ; CHECK: %[[#res:]] = OpFMul %[[#float]] %[[#log2]] %[[#float_0_30103001]]
25 ; CHECK: OpStore %[[#logf]] %[[#res]] Aligned 4
26 %0 = load float, ptr %f, align 4
27 %elt.log10 = call float @llvm.log10.f32(float %0)
28 store float %elt.log10, ptr %logf, align 4
30 ; CHECK: %[[#load:]] = OpLoad %[[#v4float]] %[[#f4]] Aligned 16
31 ; CHECK: %[[#log2:]] = OpExtInst %[[#v4float]] %[[#extinst]] Log2 %[[#load]]
32 ; CHECK: %[[#res:]] = OpVectorTimesScalar %[[#v4float]] %[[#log2]] %[[#float_0_30103001]]
33 ; CHECK: OpStore %[[#logf4]] %[[#res]] Aligned 16
34 %1 = load <4 x float>, ptr %f4, align 16
35 %elt.log101 = call <4 x float> @llvm.log10.v4f32(<4 x float> %1)
36 store <4 x float> %elt.log101, ptr %logf4, align 16
41 declare float @llvm.log10.f32(float)
42 declare <4 x float> @llvm.log10.v4f32(<4 x float>)