Fix umulh and smulh bugs. Fix bugs in last week's sumov.s testsuite.
[deliverable/binutils-gdb.git] / sim / testsuite / sim / aarch64 / sumulh.s
1 # mach: aarch64
2
3 # Check the multiply highpart instructions: smulh, umulh.
4
5 # Test -2*2, -1<<32*-1<<32, -2*-2, and 2*2.
6
7 .include "testutils.inc"
8
9 .data
10 .align 4
11
12 start
13
14 mov x0, #-2
15 mov x1, #2
16 smulh x2, x0, x1
17 cmp x2, #-1
18 bne .Lfailure
19 umulh x3, x0, x1
20 cmp x3, #1
21 bne .Lfailure
22
23 mov w0, #-1
24 lsl x0, x0, #32 // 0xffffffff00000000
25 mov x1, x0
26 smulh x2, x0, x1
27 cmp x2, #1
28 bne .Lfailure
29 umulh x3, x0, x1
30 mov w4, #-2
31 lsl x4, x4, #32
32 add x4, x4, #1 // 0xfffffffe00000001
33 cmp x3, x4
34 bne .Lfailure
35
36 mov x0, #-2
37 mov x1, #-2
38 smulh x2, x0, x1
39 cmp x2, #0
40 bne .Lfailure
41 umulh x3, x0, x1
42 cmp x3, #-4
43 bne .Lfailure
44
45 mov x0, #2
46 mov x1, #2
47 smulh x2, x0, x1
48 cmp x2, #0
49 bne .Lfailure
50 umulh x3, x0, x1
51 cmp x3, #0
52 bne .Lfailure
53
54 pass
55 .Lfailure:
56 fail
This page took 0.030971 seconds and 4 git commands to generate.