Arm64Emitter: Disable 32-bit constant optimization when NOP-padding is requested

Code caching requires this even for simple libraries like libdl.so (as observed
in the 32-bit build of Super Meat Boy).
This commit is contained in:
Tony Wasserka committed 2026-03-17 21:06:13 +01:00
1 parent f3e904207b
commit addbc8cad8
1 file changed
+3 -1
@@ -448,8 +448,10 @@ void Arm64Emitter::LoadConstant(ARMEmitter::Size s, ARMEmitter::Register Reg, ui
return;
}
if ((Constant >> 32) == 0) {
if ((Constant >> 32) == 0 && !NOPPad) {
// If the upper 32-bits is all zero, we can now switch to a 32-bit move.
// NOTE: The NOP padding code does not appropriately adjust to this yet,
// so we skip this optimization in that case
s = ARMEmitter::Size::i32Bit;
Is64Bit = false;
Segments = std::min(Segments, 2);