summaryrefslogtreecommitdiff
path: root/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
diff options
context:
space:
mode:
authorVISHAKH PRAKASH <vishakh.prakash@multicorewareinc.com>2025-08-04 03:06:54 +0530
committerGitHub <noreply@github.com>2025-08-03 23:36:54 +0200
commit1c75c829dc4f47575e1e702009b511f9cd0da2cb (patch)
tree621be33f8155dc85b69242093b8626d637870b9d /llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
parent723b40a8d92f76fc913ef21061fc3d74e8c47441 (diff)
[SPIRV] support for the intrinsic @llvm.fptosi.sat.* and @llvm.fptoui.sat.* (#129222)
Add support for the intrinsic @llvm.fptosi.sat.* and @llvm.fptoui.sat.* - add legalizer for G_FPTOSI_SAT and G_FPTOUI_SAT - add instructionSelector for G_FPTOSI_SAT and G_FPTOUI_SAT - add function to add saturatedConversion decoration to the intrinsic --------- Co-authored-by: Dmitry Sidorov <dmitry.sidorov@intel.com> Co-authored-by: Ebin-McW <ebin.jose@multicorewareinc.com> Co-authored-by: Michal Paszkowski <michal@michalpaszkowski.com>
Diffstat (limited to 'llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp')
-rw-r--r--llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
index d4fa62a28920..e9f5ffa23e22 100644
--- a/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
+++ b/llvm/lib/Target/SPIRV/SPIRVInstructionSelector.cpp
@@ -665,6 +665,11 @@ bool SPIRVInstructionSelector::spvSelect(Register ResVReg,
case TargetOpcode::G_FPTOUI:
return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertFToU);
+ case TargetOpcode::G_FPTOSI_SAT:
+ return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertFToS);
+ case TargetOpcode::G_FPTOUI_SAT:
+ return selectUnOp(ResVReg, ResType, I, SPIRV::OpConvertFToU);
+
case TargetOpcode::G_SITOFP:
return selectIToF(ResVReg, ResType, I, true, SPIRV::OpConvertSToF);
case TargetOpcode::G_UITOFP: