From ea59eab2637581c8388f66e1cbbd00d1e924a3be Mon Sep 17 00:00:00 2001 From: Fei Peng Date: Fri, 23 Mar 2018 16:15:47 -0700 Subject: fix vextracti128 code-size --- src/jit/emitxarch.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/jit') diff --git a/src/jit/emitxarch.cpp b/src/jit/emitxarch.cpp index 094776b17d..cb79bf3b41 100644 --- a/src/jit/emitxarch.cpp +++ b/src/jit/emitxarch.cpp @@ -5076,8 +5076,7 @@ void emitter::emitIns_AR_R_I(instruction ins, emitAttr attr, regNumber base, int assert(ins == INS_vextracti128 || ins == INS_vextractf128); assert(base != REG_NA); assert(ireg != REG_NA); - UNATIVE_OFFSET sz; - instrDesc* id = emitNewInstrAmdCns(attr, disp, ival); + instrDesc* id = emitNewInstrAmdCns(attr, disp, ival); id->idIns(ins); id->idInsFmt(IF_AWR_RRD_CNS); @@ -5087,8 +5086,8 @@ void emitter::emitIns_AR_R_I(instruction ins, emitAttr attr, regNumber base, int assert(emitGetInsAmdAny(id) == disp); // make sure "disp" is stored properly - // the code size of "vextracti/f128 [mem], ymm, imm8" is 6 byte - sz = 6; + // Plus one for the 1-byte immediate (ival) + UNATIVE_OFFSET sz = emitInsSizeAM(id, insCodeMR(ins)) + emitGetVexPrefixAdjustedSize(ins, attr, insCodeMR(ins)) + 1; id->idCodeSize(sz); dispIns(id); -- cgit v1.2.3