Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 0c5e2f1

Browse files
committed
Fixes for SSE encodings and containedness
1 parent 224088c commit 0c5e2f1

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

src/jit/emitxarch.cpp

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2867,6 +2867,12 @@ void emitter::emitInsLoadInd(instruction ins, emitAttr attr, regNumber dstReg, G
28672867
id->idReg1(dstReg);
28682868
emitHandleMemOp(mem, id, IF_RWR_ARD, ins);
28692869
UNATIVE_OFFSET sz = emitInsSizeAM(id, insCodeRM(ins));
2870+
if (Is4ByteSSEInstruction(ins))
2871+
{
2872+
// The 4-Byte SSE instructions require an additional byte.
2873+
sz += 1;
2874+
}
2875+
28702876
id->idCodeSize(sz);
28712877
dispIns(id);
28722878
emitCurIGsize += sz;
@@ -4055,6 +4061,12 @@ void emitter::emitIns_R_A(instruction ins, emitAttr attr, regNumber reg1, GenTre
40554061
emitHandleMemOp(indir, id, IF_RRW_ARD, ins);
40564062

40574063
UNATIVE_OFFSET sz = emitInsSizeAM(id, insCodeRM(ins));
4064+
if (Is4ByteSSEInstruction(ins))
4065+
{
4066+
// The 4-Byte SSE instructions require an additional byte.
4067+
sz += 1;
4068+
}
4069+
40584070
id->idCodeSize(sz);
40594071

40604072
dispIns(id);
@@ -4106,8 +4118,8 @@ void emitter::emitIns_R_AR_I(instruction ins, emitAttr attr, regNumber reg1, reg
41064118

41074119
if (Is4ByteSSEInstruction(ins))
41084120
{
4109-
// The 4-Byte SSE instructions require two additional bytes
4110-
sz += 2;
4121+
// The 4-Byte SSE instructions require an additional byte.
4122+
sz += 1;
41114123
}
41124124

41134125
id->idCodeSize(sz);
@@ -5183,8 +5195,8 @@ void emitter::emitIns_R_AR(instruction ins, emitAttr attr, regNumber ireg, regNu
51835195

51845196
if (Is4ByteSSEInstruction(ins))
51855197
{
5186-
// The 4-Byte SSE instructions require two additional bytes
5187-
sz += 2;
5198+
// The 4-Byte SSE instructions require an additional byte.
5199+
sz += 1;
51885200
}
51895201

51905202
id->idCodeSize(sz);

src/jit/instr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,7 @@ void CodeGen::inst_RV_TT_IV(instruction ins, emitAttr attr, regNumber reg1, GenT
11481148
else
11491149
{
11501150
regNumber rmOpReg = rmOp->gtRegNum;
1151-
getEmitter()->emitIns_R_R_I(ins, attr, reg1, rmOpReg, ival);
1151+
getEmitter()->emitIns_SIMD_R_R_I(ins, attr, reg1, rmOpReg, ival);
11521152
}
11531153
}
11541154

src/jit/lsrabuild.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,6 +2732,10 @@ int LinearScan::BuildOperandUses(GenTree* node, regMaskTP candidates)
27322732
}
27332733
if (node->OperIsHWIntrinsic())
27342734
{
2735+
if (node->AsHWIntrinsic()->OperIsMemoryLoad())
2736+
{
2737+
return BuildAddrUses(node->gtGetOp1());
2738+
}
27352739
BuildUse(node->gtGetOp1(), candidates);
27362740
return 1;
27372741
}

0 commit comments

Comments
 (0)