Debian Codegraph @

llvm/test/CodeGen/SPIRV/hlsl-intrinsics/log10.ll

raw
1 ; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-vulkan %s -o - | FileCheck %s
2 ; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan %s -o - -filetype=obj | spirv-val %}
3
4 ; CHECK: %[[#extinst:]] = OpExtInstImport "GLSL.std.450"
5
6 ; CHECK: %[[#float:]] = OpTypeFloat 32
7 ; CHECK: %[[#v4float:]] = OpTypeVector %[[#float]] 4
8 ; CHECK: %[[#float_0_30103001:]] = OpConstant %[[#float]] 0.30103000998497009
9
10 @logf = global float 0.0, align 4
11 @logf4 = global <4 x float> zeroinitializer, align 16
12
13 define void @main(float %f, <4 x float> %f4) {
14 entry:
15 ; CHECK-DAG: %[[#f:]] = OpFunctionParameter %[[#float]]
16 ; CHECK-DAG: %[[#f4:]] = OpFunctionParameter %[[#v4float]]
17
18 ; CHECK: %[[#log2:]] = OpExtInst %[[#float]] %[[#extinst]] Log2 %[[#f]]
19 ; CHECK: %[[#res:]] = OpFMul %[[#float]] %[[#log2]] %[[#float_0_30103001]]
20 %elt.log10 = call float @llvm.log10.f32(float %f)
21 store float %elt.log10, ptr @logf, align 4
22
23 ; CHECK: %[[#log2:]] = OpExtInst %[[#v4float]] %[[#extinst]] Log2 %[[#f4]]
24 ; CHECK: %[[#res:]] = OpVectorTimesScalar %[[#v4float]] %[[#log2]] %[[#float_0_30103001]]
25 %elt.log101 = call <4 x float> @llvm.log10.v4f32(<4 x float> %f4)
26 store <4 x float> %elt.log101, ptr @logf4, align 16
27
28 ret void
29 }
30
31 declare float @llvm.log10.f32(float)
32 declare <4 x float> @llvm.log10.v4f32(<4 x float>)