binutils-gdb/sim/testsuite/aarch64/sumulh.s
Mike Frysinger 1368b914e9 sim: testsuite: flatten tree
Now that all port tests live under testsuite/sim/*/, and none live
in testsuite/ directly, flatten the structure by moving all of the
dirs under testsuite/sim/ to testsuite/ directly.

We need to stop passing --tool to dejagnu so that it searches all
dirs and not just ones that start with "sim".  Since we have no
other dirs in this tree, and no plans to add any, should be fine.
2021-01-15 19:18:34 -05:00

54 lines
752 B
ArmAsm

# mach: aarch64
# Check the multiply highpart instructions: smulh, umulh.
# Test -2*2, -1<<32*-1<<32, -2*-2, and 2*2.
.include "testutils.inc"
start
mov x0, #-2
mov x1, #2
smulh x2, x0, x1
cmp x2, #-1
bne .Lfailure
umulh x3, x0, x1
cmp x3, #1
bne .Lfailure
mov w0, #-1
lsl x0, x0, #32 // 0xffffffff00000000
mov x1, x0
smulh x2, x0, x1
cmp x2, #1
bne .Lfailure
umulh x3, x0, x1
mov w4, #-2
lsl x4, x4, #32
add x4, x4, #1 // 0xfffffffe00000001
cmp x3, x4
bne .Lfailure
mov x0, #-2
mov x1, #-2
smulh x2, x0, x1
cmp x2, #0
bne .Lfailure
umulh x3, x0, x1
cmp x3, #-4
bne .Lfailure
mov x0, #2
mov x1, #2
smulh x2, x0, x1
cmp x2, #0
bne .Lfailure
umulh x3, x0, x1
cmp x3, #0
bne .Lfailure
pass
.Lfailure:
fail