Files
TheRock/compiler/amd-llvm/clang/test/CodeGenHLSL/builtins/transpose.hlsl
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

51 lines
3.2 KiB
HLSL

// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes -fmatrix-memory-layout=column-major -o - %s | FileCheck %s --check-prefixes=CHECK,COLMAJOR
// RUN: %clang_cc1 -finclude-default-header -triple spirv-unknown-vulkan1.3-library -emit-llvm -disable-llvm-passes -fmatrix-memory-layout=column-major -o - %s | FileCheck %s --check-prefixes=CHECK,COLMAJOR
// RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.3-library -emit-llvm -disable-llvm-passes -fmatrix-memory-layout=row-major -o - %s | FileCheck %s --check-prefixes=CHECK,ROWMAJOR
// RUN: %clang_cc1 -finclude-default-header -triple spirv-unknown-vulkan1.3-library -emit-llvm -disable-llvm-passes -fmatrix-memory-layout=row-major -o - %s | FileCheck %s --check-prefixes=CHECK,ROWMAJOR
// CHECK-LABEL: define {{.*}}test_transpose_bool2x3
// COLMAJOR: [[A_ADDR:%.*]] = alloca [3 x <2 x i32>], align 4
// ROWMAJOR: [[A_ADDR:%.*]] = alloca [2 x <3 x i32>], align 4
// CHECK: [[A_EXT:%.*]] = zext <6 x i1> %{{.*}} to <6 x i32>
// CHECK: store <6 x i32> [[A_EXT]], ptr [[A_ADDR]], align 4
// CHECK: [[A:%.*]] = load <6 x i32>, ptr [[A_ADDR]], align 4
// COLMAJOR: [[TRANS:%.*]] = call <6 x i32> @llvm.matrix.transpose.v6i32(<6 x i32> [[A]], i32 2, i32 3)
// ROWMAJOR: [[TRANS:%.*]] = call <6 x i32> @llvm.matrix.transpose.v6i32(<6 x i32> [[A]], i32 3, i32 2)
bool3x2 test_transpose_bool2x3(bool2x3 a) {
return transpose(a);
}
// CHECK-LABEL: define {{.*}}test_transpose_int4x3
// COLMAJOR: [[A_ADDR:%.*]] = alloca [3 x <4 x i32>], align 4
// ROWMAJOR: [[A_ADDR:%.*]] = alloca [4 x <3 x i32>], align 4
// CHECK: store <12 x i32> %{{.*}}, ptr [[A_ADDR]], align 4
// CHECK: [[A:%.*]] = load <12 x i32>, ptr [[A_ADDR]], align 4
// COLMAJOR: [[TRANS:%.*]] = call <12 x i32> @llvm.matrix.transpose.v12i32(<12 x i32> [[A]], i32 4, i32 3)
// ROWMAJOR: [[TRANS:%.*]] = call <12 x i32> @llvm.matrix.transpose.v12i32(<12 x i32> [[A]], i32 3, i32 4)
// CHECK: ret <12 x i32> [[TRANS]]
int3x4 test_transpose_int4x3(int4x3 a) {
return transpose(a);
}
// CHECK-LABEL: define {{.*}}test_transpose_float4x4
// CHECK: [[A_ADDR:%.*]] = alloca [4 x <4 x float>], align 4
// CHECK: store <16 x float> %{{.*}}, ptr [[A_ADDR]], align 4
// CHECK: [[A:%.*]] = load <16 x float>, ptr [[A_ADDR]], align 4
// CHECK: [[TRANS:%.*]] = call {{.*}}<16 x float> @llvm.matrix.transpose.v16f32(<16 x float> [[A]], i32 4, i32 4)
// CHECK: ret <16 x float> [[TRANS]]
float4x4 test_transpose_float4x4(float4x4 a) {
return transpose(a);
}
// CHECK-LABEL: define {{.*}}test_transpose_double1x4
// COLMAJOR: [[A_ADDR:%.*]] = alloca [4 x <1 x double>], align 8
// ROWMAJOR: [[A_ADDR:%.*]] = alloca [1 x <4 x double>], align 8
// CHECK: store <4 x double> %{{.*}}, ptr [[A_ADDR]], align 8
// CHECK: [[A:%.*]] = load <4 x double>, ptr [[A_ADDR]], align 8
// COLMAJOR: [[TRANS:%.*]] = call {{.*}}<4 x double> @llvm.matrix.transpose.v4f64(<4 x double> [[A]], i32 1, i32 4)
// ROWMAJOR: [[TRANS:%.*]] = call {{.*}}<4 x double> @llvm.matrix.transpose.v4f64(<4 x double> [[A]], i32 4, i32 1)
// CHECK: ret <4 x double> [[TRANS]]
double4x1 test_transpose_double1x4(double1x4 a) {
return transpose(a);
}