blob: 802c418f1dad5cd04fac5229884cec6202229744 [file] [log] [blame] [edit]
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.7-library -disable-llvm-passes -emit-llvm -finclude-default-header -o - %s | FileCheck %s
// CHECK-LABEL: define hidden void @_Z13ConstantSplatv(
// CHECK-SAME: ) #[[ATTR0:[0-9]+]] {
// CHECK-NEXT: [[ENTRY:.*:]]
// CHECK-NEXT: [[M:%.*]] = alloca [16 x i32], align 4
// CHECK-NEXT: store <16 x i32> splat (i32 1), ptr [[M]], align 4
// CHECK-NEXT: ret void
//
void ConstantSplat() {
int4x4 M = 1;
}
// CHECK-LABEL: define hidden void @_Z18ConstantFloatSplatv(
// CHECK-SAME: ) #[[ATTR0]] {
// CHECK-NEXT: [[ENTRY:.*:]]
// CHECK-NEXT: [[M:%.*]] = alloca [4 x float], align 4
// CHECK-NEXT: store <4 x float> splat (float 3.250000e+00), ptr [[M]], align 4
// CHECK-NEXT: ret void
//
void ConstantFloatSplat() {
float2x2 M = 3.25;
}
// CHECK-LABEL: define hidden void @_Z12DynamicSplatf(
// CHECK-SAME: float noundef nofpclass(nan inf) [[VALUE:%.*]]) #[[ATTR0]] {
// CHECK-NEXT: [[ENTRY:.*:]]
// CHECK-NEXT: [[VALUE_ADDR:%.*]] = alloca float, align 4
// CHECK-NEXT: [[M:%.*]] = alloca [9 x float], align 4
// CHECK-NEXT: store float [[VALUE]], ptr [[VALUE_ADDR]], align 4
// CHECK-NEXT: [[TMP0:%.*]] = load float, ptr [[VALUE_ADDR]], align 4
// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <9 x float> poison, float [[TMP0]], i64 0
// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <9 x float> [[SPLAT_SPLATINSERT]], <9 x float> poison, <9 x i32> zeroinitializer
// CHECK-NEXT: store <9 x float> [[SPLAT_SPLAT]], ptr [[M]], align 4
// CHECK-NEXT: ret void
//
void DynamicSplat(float Value) {
float3x3 M = Value;
}
// CHECK-LABEL: define hidden void @_Z13CastThenSplatDv4_f(
// CHECK-SAME: <4 x float> noundef nofpclass(nan inf) [[VALUE:%.*]]) #[[ATTR0]] {
// CHECK-NEXT: [[ENTRY:.*:]]
// CHECK-NEXT: [[VALUE_ADDR:%.*]] = alloca <4 x float>, align 16
// CHECK-NEXT: [[M:%.*]] = alloca [9 x float], align 4
// CHECK-NEXT: store <4 x float> [[VALUE]], ptr [[VALUE_ADDR]], align 16
// CHECK-NEXT: [[TMP0:%.*]] = load <4 x float>, ptr [[VALUE_ADDR]], align 16
// CHECK-NEXT: [[CAST_VTRUNC:%.*]] = extractelement <4 x float> [[TMP0]], i32 0
// CHECK-NEXT: [[SPLAT_SPLATINSERT:%.*]] = insertelement <9 x float> poison, float [[CAST_VTRUNC]], i64 0
// CHECK-NEXT: [[SPLAT_SPLAT:%.*]] = shufflevector <9 x float> [[SPLAT_SPLATINSERT]], <9 x float> poison, <9 x i32> zeroinitializer
// CHECK-NEXT: store <9 x float> [[SPLAT_SPLAT]], ptr [[M]], align 4
// CHECK-NEXT: ret void
//
void CastThenSplat(float4 Value) {
float3x3 M = (float) Value;
}