xref: /llvm-project/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/exp2.ll (revision cf3d6fded9eaf1372ccfde1d49dd91df6762d98c)
1; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s
2; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %}
3
4; CHECK: OpExtInstImport "GLSL.std.450"
5
6define noundef float @exp2_float(float noundef %a) {
7entry:
8; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] Exp2 %[[#]]
9  %elt.exp2 = call float @llvm.exp2.f32(float %a)
10  ret float %elt.exp2
11}
12
13define noundef half @exp2_half(half noundef %a) {
14entry:
15; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] Exp2 %[[#]]
16  %elt.exp2 = call half @llvm.exp2.f16(half %a)
17  ret half %elt.exp2
18}
19
20declare half @llvm.exp2.f16(half)
21declare float @llvm.exp2.f32(float)
22