Skip to content

Commit d7c511a

Browse files
committed
Pass the right size to check if immediate will fit or not
1 parent a16670a commit d7c511a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/coreclr/jit/codegenarm64.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,14 @@ bool CodeGen::genInstrWithConstant(instruction ins,
335335
break;
336336

337337
case INS_ldrsb:
338-
case INS_ldrsh:
339-
case INS_ldrsw:
340338
case INS_ldrb:
339+
immFitsInIns = emitter::emitIns_valid_imm_for_ldst_offset(imm, EA_1BYTE);
340+
break;
341+
case INS_ldrsh:
341342
case INS_ldrh:
343+
immFitsInIns = emitter::emitIns_valid_imm_for_ldst_offset(imm, EA_2BYTE);
344+
break;
345+
case INS_ldrsw:
342346
case INS_ldr:
343347
immFitsInIns = emitter::emitIns_valid_imm_for_ldst_offset(imm, size);
344348
break;

0 commit comments

Comments
 (0)