Files
binutils-gdb/sim/testsuite/mcore/lsri.s
Jeff Law 37d6ee9350 Fix right shifts in mcore simulator on 64 bit hosts.
If the value to be shifted has the sign bit set, the sign
bit would get copied into bits 32..63 of the temporary.  Those
would then be right shifted into the final value giving an
incorrect final result.

This was observed with upcoming GCC improvements which eliminate
unnecessary extensions.
2023-12-01 07:19:50 -07:00

26 lines
270 B
ArmAsm

# check that lsri works correctly
# mach: mcore
.include "testutils.inc"
start
# Construct -1
bmaski r2, 32
# logical shift right by 24
lsri r2, 24
# Construct 255
bmaski r1, 8
# Compare them, they should be equal
cmpne r2,r1
jbt .L1
pass
.L1:
fail