Files
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

57 lines
2.5 KiB
LLVM

; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s
; Make sure dxil operation function calls for cross are generated for half/float.
declare <3 x half> @llvm.dx.cross.v3f16(<3 x half>, <3 x half>)
declare <3 x float> @llvm.dx.cross.v3f32(<3 x float>, <3 x float>)
define noundef <3 x half> @test_cross_half3(<3 x half> noundef %p0, <3 x half> noundef %p1) {
entry:
; CHECK: %x0 = extractelement <3 x half> %p0, i64 0
; CHECK: %x1 = extractelement <3 x half> %p0, i64 1
; CHECK: %x2 = extractelement <3 x half> %p0, i64 2
; CHECK: %y0 = extractelement <3 x half> %p1, i64 0
; CHECK: %y1 = extractelement <3 x half> %p1, i64 1
; CHECK: %y2 = extractelement <3 x half> %p1, i64 2
; CHECK: %0 = fmul half %x1, %y2
; CHECK: %1 = fmul half %x2, %y1
; CHECK: %hlsl.cross1 = fsub half %0, %1
; CHECK: %2 = fmul half %x2, %y0
; CHECK: %3 = fmul half %x0, %y2
; CHECK: %hlsl.cross2 = fsub half %2, %3
; CHECK: %4 = fmul half %x0, %y1
; CHECK: %5 = fmul half %x1, %y0
; CHECK: %hlsl.cross3 = fsub half %4, %5
; CHECK: %6 = insertelement <3 x half> poison, half %hlsl.cross1, i64 0
; CHECK: %7 = insertelement <3 x half> %6, half %hlsl.cross2, i64 1
; CHECK: %8 = insertelement <3 x half> %7, half %hlsl.cross3, i64 2
; CHECK: ret <3 x half> %8
%hlsl.cross = call <3 x half> @llvm.dx.cross.v3f16(<3 x half> %p0, <3 x half> %p1)
ret <3 x half> %hlsl.cross
}
define noundef <3 x float> @test_cross_float3(<3 x float> noundef %p0, <3 x float> noundef %p1) {
entry:
; CHECK: %x0 = extractelement <3 x float> %p0, i64 0
; CHECK: %x1 = extractelement <3 x float> %p0, i64 1
; CHECK: %x2 = extractelement <3 x float> %p0, i64 2
; CHECK: %y0 = extractelement <3 x float> %p1, i64 0
; CHECK: %y1 = extractelement <3 x float> %p1, i64 1
; CHECK: %y2 = extractelement <3 x float> %p1, i64 2
; CHECK: %0 = fmul float %x1, %y2
; CHECK: %1 = fmul float %x2, %y1
; CHECK: %hlsl.cross1 = fsub float %0, %1
; CHECK: %2 = fmul float %x2, %y0
; CHECK: %3 = fmul float %x0, %y2
; CHECK: %hlsl.cross2 = fsub float %2, %3
; CHECK: %4 = fmul float %x0, %y1
; CHECK: %5 = fmul float %x1, %y0
; CHECK: %hlsl.cross3 = fsub float %4, %5
; CHECK: %6 = insertelement <3 x float> poison, float %hlsl.cross1, i64 0
; CHECK: %7 = insertelement <3 x float> %6, float %hlsl.cross2, i64 1
; CHECK: %8 = insertelement <3 x float> %7, float %hlsl.cross3, i64 2
; CHECK: ret <3 x float> %8
%hlsl.cross = call <3 x float> @llvm.dx.cross.v3f32(<3 x float> %p0, <3 x float> %p1)
ret <3 x float> %hlsl.cross
}