Skip to content

Commit 26577ea

Browse files
Adding asuint implementation to hlsl
1 parent 82fca9e commit 26577ea

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

clang/lib/Sema/SemaHLSL.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1510,9 +1510,9 @@ bool CheckAllArgsHaveFloatRepresentation(Sema *S, CallExpr *TheCall) {
15101510
checkAllFloatTypes);
15111511
}
15121512

1513-
bool CheckArgIsFloatOrIntWithoutImplicits(Sema *S, Expr *Arg) {
1513+
bool CheckNotFloatAndIntWithoutImplicits(Sema *S, Expr *Arg) {
15141514
auto checkFloat = [](clang::QualType PassedType) -> bool {
1515-
return !PassedType->isFloat32Type() && !PassedType->isIntegerType();
1515+
return !(PassedType->isFloat32Type() || PassedType->isIntegerType());
15161516
};
15171517

15181518
return CheckArgTypeWithoutImplicits(S, Arg, S->Context.FloatTy, checkFloat);
@@ -1677,7 +1677,7 @@ bool SemaHLSL::CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
16771677
return true;
16781678

16791679
Expr *Arg = TheCall->getArg(0);
1680-
if (CheckArgIsFloatOrIntWithoutImplicits(&SemaRef, Arg))
1680+
if (CheckNotFloatAndIntWithoutImplicits(&SemaRef, Arg))
16811681
return true;
16821682

16831683
break;

clang/test/CodeGenHLSL/builtins/asuint.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ export uint test_asuint_float(float p0) {
2323
// CHECK: %1 = bitcast <4 x float> %0 to <4 x i32>
2424
export uint4 test_asuint_float4(float4 p0) {
2525
return asuint(p0);
26-
}
26+
}

0 commit comments

Comments
 (0)