Skip to content

Commit cbf13a0

Browse files
author
Greg Roth
committed
update matrix tests to new splat disasm
1 parent d9ac6e7 commit cbf13a0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

clang/test/CodeGenHLSL/Types/BuiltinMatrix/matrix-transpose-template.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ matrix_t<float, 3, 3> get_matrix();
5757
void test_transpose_rvalue() {
5858
// CHECK: [[M_T_ADDR:%.*]] = alloca [9 x float], align 4
5959
// CHECK-NEXT: [[CALL_RES:%.*]] = call{{.*}} <9 x float> @_Z10get_matrixv()
60-
// CHECK-NEXT: [[ADD:%.*]] = fadd <9 x float> [[CALL_RES]], <float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00, float 2.000000e+00>
60+
// CHECK-NEXT: [[ADD:%.*]] = fadd <9 x float> [[CALL_RES]], splat (float 2.000000e+00)
6161
// CHECK-NEXT: [[M_T:%.*]] = call <9 x float> @llvm.matrix.transpose.v9f32(<9 x float> [[ADD]], i32 3, i32 3)
6262
// CHECK-NEXT: store <9 x float> [[M_T]], ptr [[M_T_ADDR]], align 4
6363
matrix_t<float, 3, 3> m_t = __builtin_matrix_transpose(get_matrix() + 2.0);

clang/test/CodeGenHLSL/Types/BuiltinMatrix/matrix-type-operators-template.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void test_constexpr2(inout matrix_type<int, 4, 4> m) {
421421
// NOOPT: [[MAT:%.*]] = load <16 x i32>, ptr {{.*}}, align 4{{$}}
422422
// OPT: [[MAT:%.*]] = load <16 x i32>, ptr {{.*}}, align 4, !tbaa !{{[0-9]+}}{{$}}
423423
// CHECK-NEXT: [[SUB:%.*]] = sub <16 x i32> [[IM]], [[MAT]]
424-
// CHECK-NEXT: [[SUB2:%.*]] = add <16 x i32> [[SUB]], <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
424+
// CHECK-NEXT: [[SUB2:%.*]] = add <16 x i32> [[SUB]], splat (i32 1)
425425
// NOOPT-NEXT: [[MAT_ADDR:%.*]] = load ptr, ptr %m.addr, align [[ALIGN]]{{$}}
426426
// OPT-NEXT: [[MAT_ADDR:%.*]] = load ptr, ptr %m.addr, align [[ALIGN]], !tbaa !{{[0-9]+}}{{$}}
427427
// CHECK-NEXT: store <16 x i32> [[SUB2]], ptr [[MAT_ADDR]], align 4

clang/test/CodeGenHLSL/Types/BuiltinMatrix/matrix-type-operators.hlsl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ void multiply_float_matrix_constant(float2x3 a) {
780780
// CHECK-NEXT: store <6 x float> %a, ptr [[A_ADDR]], align 4
781781
// NOOPT-NEXT: [[MAT:%.*]] = load <6 x float>, ptr [[A_ADDR]], align 4{{$}}
782782
// OPT-NEXT: [[MAT:%.*]] = load <6 x float>, ptr [[A_ADDR]], align 4, !tbaa !{{[0-9]+}}{{$}}
783-
// CHECK-NEXT: [[RES:%.*]] = fmul <6 x float> [[MAT]], <float 2.500000e+00, float 2.500000e+00, float 2.500000e+00, float 2.500000e+00, float 2.500000e+00, float 2.500000e+00>
783+
// CHECK-NEXT: [[RES:%.*]] = fmul <6 x float> [[MAT]], splat (float 2.500000e+00)
784784
// CHECK-NEXT: store <6 x float> [[RES]], ptr [[A_ADDR]], align 4
785785
// CHECK-NEXT: ret void
786786
a = a * 2.5;
@@ -792,7 +792,7 @@ void multiply_compound_float_matrix_constant(float2x3 a) {
792792
// CHECK-NEXT: store <6 x float> [[A:%.*]], ptr [[A_ADDR]], align 4
793793
// NOOPT-NEXT: [[MAT:%.*]] = load <6 x float>, ptr [[A_ADDR]], align 4{{$}}
794794
// OPT-NEXT: [[MAT:%.*]] = load <6 x float>, ptr [[A_ADDR]], align 4, !tbaa !{{[0-9]+}}{{$}}
795-
// CHECK-NEXT: [[RES:%.*]] = fmul <6 x float> [[MAT]], <float 2.500000e+00, float 2.500000e+00, float 2.500000e+00, float 2.500000e+00, float 2.500000e+00, float 2.500000e+00>
795+
// CHECK-NEXT: [[RES:%.*]] = fmul <6 x float> [[MAT]], splat (float 2.500000e+00)
796796
// CHECK-NEXT: store <6 x float> [[RES]], ptr [[A_ADDR]], align 4
797797
// CHECK-NEXT: ret void
798798
a *= 2.5;
@@ -804,7 +804,7 @@ void multiply_int_matrix_constant(int4x3 a) {
804804
// CHECK-NEXT: store <12 x i32> [[A:%.*]], ptr [[A_ADDR]], align 4
805805
// NOOPT-NEXT: [[MAT:%.*]] = load <12 x i32>, ptr [[A_ADDR]], align 4{{$}}
806806
// OPT-NEXT: [[MAT:%.*]] = load <12 x i32>, ptr [[A_ADDR]], align 4, !tbaa !{{[0-9]+}}{{$}}
807-
// CHECK-NEXT: [[RES:%.*]] = mul <12 x i32> <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5>, [[MAT]]
807+
// CHECK-NEXT: [[RES:%.*]] = mul <12 x i32> splat (i32 5), [[MAT]]
808808
// CHECK-NEXT: store <12 x i32> [[RES]], ptr [[A_ADDR]], align 4
809809
// CHECK-NEXT: ret void
810810
a = 5 * a;
@@ -816,7 +816,7 @@ void multiply_compound_int_matrix_constant(int4x3 a) {
816816
// CHECK-NEXT: store <12 x i32> [[A:%.*]], ptr [[A_ADDR]], align 4
817817
// NOOPT-NEXT: [[MAT:%.*]] = load <12 x i32>, ptr [[A_ADDR]], align 4{{$}}
818818
// OPT-NEXT: [[MAT:%.*]] = load <12 x i32>, ptr [[A_ADDR]], align 4, !tbaa !{{[0-9]+}}{{$}}
819-
// CHECK-NEXT: [[RES:%.*]] = mul <12 x i32> [[MAT]], <i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5, i32 5>
819+
// CHECK-NEXT: [[RES:%.*]] = mul <12 x i32> [[MAT]], splat (i32 5)
820820
// CHECK-NEXT: store <12 x i32> [[RES]], ptr [[A_ADDR]], align 4
821821
// CHECK-NEXT: ret void
822822
a *= 5;
@@ -916,7 +916,7 @@ void divide_float_matrix_constant(float2x3 a) {
916916
// CHECK-NEXT: store <6 x float> [[A:%.*]], ptr [[A_ADDR]], align 4
917917
// NOOPT-NEXT: [[MAT:%.*]] = load <6 x float>, ptr [[A_ADDR]], align 4{{$}}
918918
// OPT-NEXT: [[MAT:%.*]] = load <6 x float>, ptr [[A_ADDR]], align 4, !tbaa !{{[0-9]+}}{{$}}
919-
// CHECK-NEXT: [[RES:%.*]] = fdiv <6 x float> [[MAT]], <float 2.500000e+00, float 2.500000e+00, float 2.500000e+00, float 2.500000e+00, float 2.500000e+00, float 2.500000e+00>
919+
// CHECK-NEXT: [[RES:%.*]] = fdiv <6 x float> [[MAT]], splat (float 2.500000e+00)
920920
// CHECK-NEXT: store <6 x float> [[RES]], ptr [[A_ADDR]], align 4
921921
// CHECK-NEXT: ret void
922922
a = a / 2.5;

0 commit comments

Comments
 (0)