xref: /llvm-project/llvm/test/CodeGen/SPIRV/hlsl-intrinsics/pow.ll (revision cf3d6fded9eaf1372ccfde1d49dd91df6762d98c)
1*cf3d6fdeSNathan Gauër; RUN: llc -O0 -verify-machineinstrs -mtriple=spirv-unknown-unknown %s -o - | FileCheck %s
282d8a956SFarzon Lotfi; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o - -filetype=obj | spirv-val %}
382d8a956SFarzon Lotfi
482d8a956SFarzon Lotfi; CHECK: OpExtInstImport "GLSL.std.450"
582d8a956SFarzon Lotfi
682d8a956SFarzon Lotfidefine noundef float @pow_float(float noundef %a,float noundef %b) {
782d8a956SFarzon Lotfientry:
882d8a956SFarzon Lotfi; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] Pow %[[#]]
982d8a956SFarzon Lotfi  %elt.pow = call float @llvm.pow.f32(float %a,float %b)
1082d8a956SFarzon Lotfi  ret float %elt.pow
1182d8a956SFarzon Lotfi}
1282d8a956SFarzon Lotfi
1382d8a956SFarzon Lotfidefine noundef half @pow_half(half noundef %a, half noundef %b) {
1482d8a956SFarzon Lotfientry:
1582d8a956SFarzon Lotfi; CHECK: %[[#]] = OpExtInst %[[#]] %[[#]] Pow %[[#]]
1682d8a956SFarzon Lotfi  %elt.pow = call half @llvm.pow.f16(half %a, half %b)
1782d8a956SFarzon Lotfi  ret half %elt.pow
1882d8a956SFarzon Lotfi}
1982d8a956SFarzon Lotfi
2082d8a956SFarzon Lotfideclare half @llvm.pow.f16(half,half)
2182d8a956SFarzon Lotfideclare float @llvm.pow.f32(float,float)
22