Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/SPIRV/llvm-intrinsics/powi-glsl.ll
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

44 lines
1.8 KiB
LLVM

; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-vulkan1.3-compute %s -o - | FileCheck %s
; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-vulkan1.3-compute %s -o - -filetype=obj | spirv-val --target-env vulkan1.3 %}
; Test that llvm.powi on Vulkan targets is lowered by converting the
; integer exponent to float with OpConvertSToF, then calling GLSL.std.450 Pow.
; CHECK-DAG: %[[#ExtInstId:]] = OpExtInstImport "GLSL.std.450"
; CHECK-DAG: %[[#F32Ty:]] = OpTypeFloat 32
; CHECK-DAG: %[[#I32Ty:]] = OpTypeInt 32 0
; CHECK-DAG: %[[#I64Ty:]] = OpTypeInt 64 0
; CHECK-LABEL: Begin function test_powi_f32_i32
; CHECK: %[[#base32:]] = OpFunctionParameter %[[#F32Ty]]
; CHECK: %[[#exp32:]] = OpFunctionParameter %[[#I32Ty]]
; CHECK: %[[#fexp32:]] = OpConvertSToF %[[#F32Ty]] %[[#exp32]]
; CHECK: %[[#ret32:]] = OpExtInst %[[#F32Ty]] %[[#ExtInstId]] Pow %[[#base32]] %[[#fexp32]]
; CHECK: OpReturnValue %[[#ret32]]
; CHECK-LABEL: OpFunctionEnd
define internal float @test_powi_f32_i32(float %x, i32 %n) {
%res = call float @llvm.powi.f32.i32(float %x, i32 %n)
ret float %res
}
; CHECK-LABEL: Begin function test_powi_f32_i64
; CHECK: %[[#base64:]] = OpFunctionParameter %[[#F32Ty]]
; CHECK: %[[#exp64:]] = OpFunctionParameter %[[#I64Ty]]
; CHECK: %[[#fexp64:]] = OpConvertSToF %[[#F32Ty]] %[[#exp64]]
; CHECK: %[[#ret64:]] = OpExtInst %[[#F32Ty]] %[[#ExtInstId]] Pow %[[#base64]] %[[#fexp64]]
; CHECK: OpReturnValue %[[#ret64]]
; CHECK-LABEL: OpFunctionEnd
define internal float @test_powi_f32_i64(float %x, i64 %n) {
%res = call float @llvm.powi.f32.i64(float %x, i64 %n)
ret float %res
}
define void @main() #0 {
ret void
}
declare float @llvm.powi.f32.i32(float, i32)
declare float @llvm.powi.f32.i64(float, i64)
attributes #0 = { "hlsl.numthreads"="1,1,1" "hlsl.shader"="compute" }