Skip to content

Commit

Permalink
Fix STLUR for 0 imm (#106760)
Browse files Browse the repository at this point in the history
  • Loading branch information
EgorBo authored Aug 24, 2024
1 parent 8fd46b2 commit 205adae
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 34 deletions.
10 changes: 10 additions & 0 deletions src/coreclr/jit/codegenarm64test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1900,6 +1900,16 @@ void CodeGen::genArm64EmitterUnitTestsAdvSimd()
theEmitter->emitIns_R_R_I(INS_stur, EA_8BYTE, REG_V7, REG_R10, 9);
theEmitter->emitIns_R_R_I(INS_stur, EA_16BYTE, REG_V7, REG_R10, 17);

theEmitter->emitIns_R_R_I(INS_stlurb, EA_1BYTE, REG_V7, REG_R10, 0);
theEmitter->emitIns_R_R_I(INS_stlurh, EA_2BYTE, REG_V7, REG_R10, 0);
theEmitter->emitIns_R_R_I(INS_stlur, EA_4BYTE, REG_V7, REG_R10, 0);
theEmitter->emitIns_R_R_I(INS_stlur, EA_8BYTE, REG_V7, REG_R10, 0);

theEmitter->emitIns_R_R_I(INS_ldapurb, EA_1BYTE, REG_V8, REG_R9, 0);
theEmitter->emitIns_R_R_I(INS_ldapurh, EA_2BYTE, REG_V8, REG_R9, 0);
theEmitter->emitIns_R_R_I(INS_ldapur, EA_4BYTE, REG_V8, REG_R9, 0);
theEmitter->emitIns_R_R_I(INS_ldapur, EA_8BYTE, REG_V8, REG_R9, 0);

// load/store pair
theEmitter->emitIns_R_R_R(INS_ldnp, EA_8BYTE, REG_V0, REG_V1, REG_R10);
theEmitter->emitIns_R_R_R_I(INS_stnp, EA_8BYTE, REG_V1, REG_V2, REG_R10, 0);
Expand Down
43 changes: 9 additions & 34 deletions src/coreclr/jit/emitarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5614,16 +5614,6 @@ void emitter::emitIns_R_R_I(instruction ins,
isLdSt = true;
break;

case INS_ldapurb:
case INS_stlurb:
case INS_ldurb:
case INS_sturb:
// size is ignored
unscaledOp = true;
scale = 0;
isLdSt = true;
break;

case INS_ldrh:
case INS_strh:
// size is ignored
Expand All @@ -5632,16 +5622,6 @@ void emitter::emitIns_R_R_I(instruction ins,
isLdSt = true;
break;

case INS_ldurh:
case INS_ldapurh:
case INS_sturh:
case INS_stlurh:
// size is ignored
unscaledOp = true;
scale = 0;
isLdSt = true;
break;

case INS_ldr:
case INS_str:
// Is the target a vector register?
Expand All @@ -5661,24 +5641,19 @@ void emitter::emitIns_R_R_I(instruction ins,
isLdrStr = true;
break;

case INS_ldurb:
case INS_ldurh:
case INS_ldur:
case INS_sturb:
case INS_sturh:
case INS_stur:
case INS_ldapurb:
case INS_ldapurh:
case INS_ldapur:
case INS_stlurb:
case INS_stlurh:
case INS_stlur:
// Is the target a vector register?
if (isVectorRegister(reg1))
{
assert(isValidVectorLSDatasize(size));
assert(isGeneralRegisterOrSP(reg2));
isSIMD = true;
}
else
{
assert(isValidGeneralDatasize(size));
}
unscaledOp = true;
scale = 0;
isLdSt = true;
fmt = IF_LS_2C;
break;

case INS_ld2:
Expand Down

0 comments on commit 205adae

Please sign in to comment.