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

79 lines
3.4 KiB
LLVM

; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
; RUN: opt -S -dxil-intrinsic-expansion -scalarizer -mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
declare half @llvm.dx.radians.f16(half)
declare float @llvm.dx.radians.f32(float)
declare <4 x half> @llvm.dx.radians.v4f16(<4 x half>)
declare <4 x float> @llvm.dx.radians.v4f32(<4 x float>)
define noundef half @radians_half(half noundef %a) {
; CHECK-LABEL: define noundef half @radians_half(
; CHECK-SAME: half noundef [[A:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[TMP0:%.*]] = fmul half [[A]], 1.745610e-02
; CHECK-NEXT: ret half [[TMP0]]
;
entry:
%elt.radians = call half @llvm.dx.radians.f16(half %a)
ret half %elt.radians
}
define noundef float @radians_float(float noundef %a) {
; CHECK-LABEL: define noundef float @radians_float(
; CHECK-SAME: float noundef [[A:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK-NEXT: [[TMP0:%.*]] = fmul float [[A]], f0x3C8EFA35
; CHECK-NEXT: ret float [[TMP0]]
;
entry:
%elt.radians = call float @llvm.dx.radians.f32(float %a)
ret float %elt.radians
}
define noundef <4 x half> @radians_half_vector(<4 x half> noundef %a) {
; CHECK-LABEL: define noundef <4 x half> @radians_half_vector(
; CHECK-SAME: <4 x half> noundef [[A:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK: [[ee0:%.*]] = extractelement <4 x half> [[A]], i64 0
; CHECK: [[ie0:%.*]] = fmul half [[ee0]], 1.745610e-02
; CHECK: [[ee1:%.*]] = extractelement <4 x half> [[A]], i64 1
; CHECK: [[ie1:%.*]] = fmul half [[ee1]], 1.745610e-02
; CHECK: [[ee2:%.*]] = extractelement <4 x half> [[A]], i64 2
; CHECK: [[ie2:%.*]] = fmul half [[ee2]], 1.745610e-02
; CHECK: [[ee3:%.*]] = extractelement <4 x half> [[A]], i64 3
; CHECK: [[ie3:%.*]] = fmul half [[ee3]], 1.745610e-02
; CHECK: [[TMP0:%.*]] = insertelement <4 x half> poison, half [[ie0]], i64 0
; CHECK: [[TMP1:%.*]] = insertelement <4 x half> [[TMP0]], half [[ie1]], i64 1
; CHECK: [[TMP2:%.*]] = insertelement <4 x half> [[TMP1]], half [[ie2]], i64 2
; CHECK: [[TMP3:%.*]] = insertelement <4 x half> [[TMP2]], half [[ie3]], i64 3
; CHECK: ret <4 x half> [[TMP3]]
;
entry:
%elt.radians = call <4 x half> @llvm.dx.radians.v4f16(<4 x half> %a)
ret <4 x half> %elt.radians
}
define noundef <4 x float> @radians_float_vector(<4 x float> noundef %a) {
; CHECK-LABEL: define noundef <4 x float> @radians_float_vector(
; CHECK-SAME: <4 x float> noundef [[A:%.*]]) {
; CHECK-NEXT: [[ENTRY:.*:]]
; CHECK: [[ee0:%.*]] = extractelement <4 x float> [[A]], i64 0
; CHECK: [[ie0:%.*]] = fmul float [[ee0]], f0x3C8EFA35
; CHECK: [[ee1:%.*]] = extractelement <4 x float> [[A]], i64 1
; CHECK: [[ie1:%.*]] = fmul float [[ee1]], f0x3C8EFA35
; CHECK: [[ee2:%.*]] = extractelement <4 x float> [[A]], i64 2
; CHECK: [[ie2:%.*]] = fmul float [[ee2]], f0x3C8EFA35
; CHECK: [[ee3:%.*]] = extractelement <4 x float> [[A]], i64 3
; CHECK: [[ie3:%.*]] = fmul float [[ee3]], f0x3C8EFA35
; CHECK: [[TMP0:%.*]] = insertelement <4 x float> poison, float [[ie0]], i64 0
; CHECK: [[TMP1:%.*]] = insertelement <4 x float> [[TMP0]], float [[ie1]], i64 1
; CHECK: [[TMP2:%.*]] = insertelement <4 x float> [[TMP1]], float [[ie2]], i64 2
; CHECK: [[TMP3:%.*]] = insertelement <4 x float> [[TMP2]], float [[ie3]], i64 3
; CHECK: ret <4 x float> [[TMP3]]
;
entry:
%elt.radians = call <4 x float> @llvm.dx.radians.v4f32(<4 x float> %a)
ret <4 x float> %elt.radians
}