================ @@ -18661,14 +18661,30 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID, Value *OpMax = EmitScalarExpr(E->getArg(2)); QualType Ty = E->getArg(0)->getType(); - bool IsUnsigned = false; if (auto *VecTy = Ty->getAs<VectorType>()) Ty = VecTy->getElementType(); - IsUnsigned = Ty->isUnsignedIntegerType(); - return Builder.CreateIntrinsic( - /*ReturnType=*/OpX->getType(), - IsUnsigned ? Intrinsic::dx_uclamp : Intrinsic::dx_clamp, - ArrayRef<Value *>{OpX, OpMin, OpMax}, nullptr, "dx.clamp"); + bool IsUnsigned = Ty->isUnsignedIntegerType(); + switch (CGM.getTarget().getTriple().getArch()) { + case llvm::Triple::dxil: { + return Builder.CreateIntrinsic( + /*ReturnType=*/OpX->getType(), + IsUnsigned ? Intrinsic::dx_uclamp : Intrinsic::dx_clamp, + ArrayRef<Value *>{OpX, OpMin, OpMax}, nullptr, "dx.clamp"); + } break; + case llvm::Triple::spirv: { ---------------- adam-yang wrote:
This is all fixed, the two sides now match nicely. https://github.com/llvm/llvm-project/pull/113394 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits