brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · ef282fc Raw
31 lines · plain
1// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple dxil-pc-shadermodel6.3-library %s -fnative-half-type -fnative-int16-type -emit-llvm -disable-llvm-passes -o - | FileCheck %s2 3// NOTE: This test is only to confirm we can do codgen with the matrix alias.4 5// CHECK-LABEL: define {{.*}}transpose_half_2x26void transpose_half_2x2(half2x2 a) {7  // CHECK:        [[A:%.*]] = load <4 x half>, ptr {{.*}}, align 28  // CHECK-NEXT:   [[TRANS:%.*]] = call {{.*}}<4 x half> @llvm.matrix.transpose.v4f16(<4 x half> [[A]], i32 2, i32 2)9  // CHECK-NEXT:   store <4 x half> [[TRANS]], ptr %a_t, align 210 11  half2x2 a_t = __builtin_matrix_transpose(a);12}13 14// CHECK-LABEL: define {{.*}}transpose_float_3x215void transpose_float_3x2(float3x2 a) {16  // CHECK:        [[A:%.*]] = load <6 x float>, ptr {{.*}}, align 417  // CHECK-NEXT:   [[TRANS:%.*]] = call {{.*}}<6 x float> @llvm.matrix.transpose.v6f32(<6 x float> [[A]], i32 3, i32 2)18  // CHECK-NEXT:   store <6 x float> [[TRANS]], ptr %a_t, align 419 20  float2x3 a_t = __builtin_matrix_transpose(a);21}22 23// CHECK-LABEL: define {{.*}}transpose_int_4x324void transpose_int_4x3(int4x3 a) {25  // CHECK:         [[A:%.*]] = load <12 x i32>, ptr {{.*}}, align 426  // CHECK-NEXT:    [[TRANS:%.*]] = call <12 x i32> @llvm.matrix.transpose.v12i32(<12 x i32> [[A]], i32 4, i32 3)27  // CHECK-NEXT:    store <12 x i32> [[TRANS]], ptr %a_t, align 428 29  int3x4 a_t = __builtin_matrix_transpose(a);30}31