@@ -77,6 +77,7 @@ enum TypeKind {
77
77
78
78
enum CastKind {
79
79
CastKindSignExt = 0 ,
80
+ CastKindZeroExt = 1 ,
80
81
};
81
82
82
83
// A predicate used in a numeric comparison.
@@ -828,7 +829,7 @@ class YkIRWriter {
828
829
829
830
void serialiseCastKind (enum CastKind Cast) { OutStreamer.emitInt8 (Cast); }
830
831
831
- // / Serialise a cast-like insruction .
832
+ // / Serialise a cast-like instruction .
832
833
void serialiseSExtInst (SExtInst *I, FuncLowerCtxt &FLCtxt, unsigned BBIdx,
833
834
unsigned &InstIdx) {
834
835
// opcode:
@@ -844,6 +845,22 @@ class YkIRWriter {
844
845
InstIdx++;
845
846
}
846
847
848
+ // / Serialise a cast-like instruction.
849
+ void serialiseZExtInst (ZExtInst *I, FuncLowerCtxt &FLCtxt, unsigned BBIdx,
850
+ unsigned &InstIdx) {
851
+ // opcode:
852
+ serialiseOpcode (OpCodeCast);
853
+ // cast_kind:
854
+ serialiseCastKind (CastKindZeroExt);
855
+ // val:
856
+ serialiseOperand (I, FLCtxt, I->getOperand (0 ));
857
+ // dest_type_idx:
858
+ OutStreamer.emitSizeT (typeIndex (I->getDestTy ()));
859
+
860
+ FLCtxt.updateVLMap (I, InstIdx);
861
+ InstIdx++;
862
+ }
863
+
847
864
void serialiseSwitchInst (SwitchInst *I, FuncLowerCtxt &FLCtxt, unsigned BBIdx,
848
865
unsigned &InstIdx) {
849
866
// opcode:
@@ -910,6 +927,7 @@ class YkIRWriter {
910
927
INST_SERIALISE (I, LoadInst, serialiseLoadInst);
911
928
INST_SERIALISE (I, PHINode, serialisePhiInst);
912
929
INST_SERIALISE (I, ReturnInst, serialiseReturnInst);
930
+ INST_SERIALISE (I, ZExtInst, serialiseZExtInst);
913
931
INST_SERIALISE (I, SExtInst, serialiseSExtInst);
914
932
INST_SERIALISE (I, StoreInst, serialiseStoreInst);
915
933
INST_SERIALISE (I, SwitchInst, serialiseSwitchInst);
0 commit comments