Files
TheRock/compiler/amd-llvm/llvm/test/CodeGen/DirectX/degrees.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

55 lines
2.4 KiB
LLVM

; RUN: opt -S -dxil-intrinsic-expansion -scalarizer -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
; Make sure dxil op function calls for degrees are expanded and lowered as fmul for float and half.
define noundef half @degrees_half(half noundef %a) {
; CHECK-LABEL: define noundef half @degrees_half(
; CHECK-SAME: half noundef [[A:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[DX_DEGREES1:%.*]] = fmul half [[A]], 5.728130e+01
; CHECK-NEXT: ret half [[DX_DEGREES1]]
;
entry:
%dx.degrees = call half @llvm.dx.degrees.f16(half %a)
ret half %dx.degrees
}
define noundef float @degrees_float(float noundef %a) #0 {
; CHECK-LABEL: define noundef float @degrees_float(
; CHECK-SAME: float noundef [[A:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[DEGREES:%.*]] = fmul float [[A]], f0x42652EE1
; CHECK-NEXT: ret float [[DEGREES]]
;
entry:
%dx.degrees = call float @llvm.dx.degrees.f32(float %a)
ret float %dx.degrees
}
define noundef <4 x float> @degrees_float4(<4 x float> noundef %a) #0 {
; CHECK-LABEL: define noundef <4 x float> @degrees_float4(
; CHECK-SAME: <4 x float> noundef [[A:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[A0:%.*]] = extractelement <4 x float> [[A]], i64 0
; CHECK-NEXT: [[DEGREES_A0:%.*]] = fmul float [[A0]], f0x42652EE1
; CHECK-NEXT: [[A1:%.*]] = extractelement <4 x float> [[A]], i64 1
; CHECK-NEXT: [[DEGREES_A1:%.*]] = fmul float [[A1]], f0x42652EE1
; CHECK-NEXT: [[A2:%.*]] = extractelement <4 x float> [[A]], i64 2
; CHECK-NEXT: [[DEGREES_A2:%.*]] = fmul float [[A2]], f0x42652EE1
; CHECK-NEXT: [[A3:%.*]] = extractelement <4 x float> [[A]], i64 3
; CHECK-NEXT: [[DEGREES_A3:%.*]] = fmul float [[A3]], f0x42652EE1
; CHECK-NEXT: [[INSERT_0:%.*]] = insertelement <4 x float> poison, float [[DEGREES_A0]], i64 0
; CHECK-NEXT: [[INSERT_1:%.*]] = insertelement <4 x float> [[INSERT_0]], float [[DEGREES_A1]], i64 1
; CHECK-NEXT: [[INSERT_2:%.*]] = insertelement <4 x float> [[INSERT_1]], float [[DEGREES_A2]], i64 2
; CHECK-NEXT: [[RES:%.*]] = insertelement <4 x float> [[INSERT_2]], float [[DEGREES_A3]], i64 3
; CHECK-NEXT: ret <4 x float> [[RES]]
;
entry:
%2 = call <4 x float> @llvm.dx.degrees.v4f32(<4 x float> %a)
ret <4 x float> %2
}
declare half @llvm.dx.degrees.f16(half)
declare float @llvm.dx.degrees.f32(float)
declare <4 x float> @llvm.dx.degrees.v4f32(<4 x float>)