cpu/arm: Use rotr_32 for handling unaligned reads

This commit is contained in:
AJR 2022-10-29 19:46:50 -04:00
parent 1af48b762c
commit cb2175d259

View File

@ -264,11 +264,11 @@ uint32_t arm_cpu_device::cpu_read32( int addr )
logerror("%08x: Unaligned byte read %08x\n",R15,addr);
if ((addr&3)==1)
return ((result&0x000000ff)<<24)|((result&0xffffff00)>> 8);
return rotr_32(result, 8);
if ((addr&3)==2)
return ((result&0x0000ffff)<<16)|((result&0xffff0000)>>16);
return rotr_32(result, 16);
if ((addr&3)==3)
return ((result&0x00ffffff)<< 8)|((result&0xff000000)>>24);
return rotr_32(result, 24);
}
return result;