@@ -763,7 +763,7 @@ class LLVM_ABI MachineIRBuilder {
763
763
764
764
// / Build and insert \p Res = G_SEXT \p Op, \p Res = G_TRUNC \p Op, or
765
765
// / \p Res = COPY \p Op depending on the differing sizes of \p Res and \p Op.
766
- // / ///
766
+ // /
767
767
// / \pre setBasicBlock or setMI must have been called.
768
768
// / \pre \p Res must be a generic virtual register with scalar or vector type.
769
769
// / \pre \p Op must be a generic virtual register with scalar or vector type.
@@ -773,7 +773,7 @@ class LLVM_ABI MachineIRBuilder {
773
773
774
774
// / Build and insert \p Res = G_ZEXT \p Op, \p Res = G_TRUNC \p Op, or
775
775
// / \p Res = COPY \p Op depending on the differing sizes of \p Res and \p Op.
776
- // / ///
776
+ // /
777
777
// / \pre setBasicBlock or setMI must have been called.
778
778
// / \pre \p Res must be a generic virtual register with scalar or vector type.
779
779
// / \pre \p Op must be a generic virtual register with scalar or vector type.
@@ -783,7 +783,7 @@ class LLVM_ABI MachineIRBuilder {
783
783
784
784
// Build and insert \p Res = G_ANYEXT \p Op, \p Res = G_TRUNC \p Op, or
785
785
// / \p Res = COPY \p Op depending on the differing sizes of \p Res and \p Op.
786
- // / ///
786
+ // /
787
787
// / \pre setBasicBlock or setMI must have been called.
788
788
// / \pre \p Res must be a generic virtual register with scalar or vector type.
789
789
// / \pre \p Op must be a generic virtual register with scalar or vector type.
@@ -794,7 +794,7 @@ class LLVM_ABI MachineIRBuilder {
794
794
// / Build and insert \p Res = \p ExtOpc, \p Res = G_TRUNC \p
795
795
// / Op, or \p Res = COPY \p Op depending on the differing sizes of \p Res and
796
796
// / \p Op.
797
- // / ///
797
+ // /
798
798
// / \pre setBasicBlock or setMI must have been called.
799
799
// / \pre \p Res must be a generic virtual register with scalar or vector type.
800
800
// / \pre \p Op must be a generic virtual register with scalar or vector type.
@@ -809,6 +809,48 @@ class LLVM_ABI MachineIRBuilder {
809
809
MachineInstrBuilder buildZExtInReg (const DstOp &Res, const SrcOp &Op,
810
810
int64_t ImmOp);
811
811
812
+ // / Build and insert \p Res = \p G_TRUNC_SSAT_S \p Op
813
+ // /
814
+ // / G_TRUNC_SSAT_S truncates the signed input, \p Op, to a signed result with
815
+ // / saturation.
816
+ // /
817
+ // / \pre setBasicBlock or setMI must have been called.
818
+ // / \pre \p Res must be a generic virtual register with scalar or vector type.
819
+ // / \pre \p Op must be a generic virtual register with scalar or vector type.
820
+ // /
821
+ // / \return The newly created instruction.
822
+ MachineInstrBuilder buildTruncSSatS (const DstOp &Res, const SrcOp &Op) {
823
+ return buildInstr (TargetOpcode::G_TRUNC_SSAT_S, {Res}, {Op});
824
+ }
825
+
826
+ // / Build and insert \p Res = \p G_TRUNC_SSAT_U \p Op
827
+ // /
828
+ // / G_TRUNC_SSAT_U truncates the signed input, \p Op, to an unsigned result
829
+ // / with saturation.
830
+ // /
831
+ // / \pre setBasicBlock or setMI must have been called.
832
+ // / \pre \p Res must be a generic virtual register with scalar or vector type.
833
+ // / \pre \p Op must be a generic virtual register with scalar or vector type.
834
+ // /
835
+ // / \return The newly created instruction.
836
+ MachineInstrBuilder buildTruncSSatU (const DstOp &Res, const SrcOp &Op) {
837
+ return buildInstr (TargetOpcode::G_TRUNC_SSAT_U, {Res}, {Op});
838
+ }
839
+
840
+ // / Build and insert \p Res = \p G_TRUNC_USAT_U \p Op
841
+ // /
842
+ // / G_TRUNC_USAT_U truncates the unsigned input, \p Op, to an unsigned result
843
+ // / with saturation.
844
+ // /
845
+ // / \pre setBasicBlock or setMI must have been called.
846
+ // / \pre \p Res must be a generic virtual register with scalar or vector type.
847
+ // / \pre \p Op must be a generic virtual register with scalar or vector type.
848
+ // /
849
+ // / \return The newly created instruction.
850
+ MachineInstrBuilder buildTruncUSatU (const DstOp &Res, const SrcOp &Op) {
851
+ return buildInstr (TargetOpcode::G_TRUNC_USAT_U, {Res}, {Op});
852
+ }
853
+
812
854
// / Build and insert an appropriate cast between two registers of equal size.
813
855
MachineInstrBuilder buildCast (const DstOp &Dst, const SrcOp &Src);
814
856
0 commit comments