Automatic date update in version.in
[binutils-gdb.git] / sim / testsuite / aarch64 / sumulh.s
blobd75e0c64e1d991240b7d9c5778474a59c93fe987
1 # mach: aarch64
3 # Check the multiply highpart instructions: smulh, umulh.
5 # Test -2*2, -1<<32*-1<<32, -2*-2, and 2*2.
7 .include "testutils.inc"
9 start
11 mov x0, #-2
12 mov x1, #2
13 smulh x2, x0, x1
14 cmp x2, #-1
15 bne .Lfailure
16 umulh x3, x0, x1
17 cmp x3, #1
18 bne .Lfailure
20 mov w0, #-1
21 lsl x0, x0, #32 // 0xffffffff00000000
22 mov x1, x0
23 smulh x2, x0, x1
24 cmp x2, #1
25 bne .Lfailure
26 umulh x3, x0, x1
27 mov w4, #-2
28 lsl x4, x4, #32
29 add x4, x4, #1 // 0xfffffffe00000001
30 cmp x3, x4
31 bne .Lfailure
33 mov x0, #-2
34 mov x1, #-2
35 smulh x2, x0, x1
36 cmp x2, #0
37 bne .Lfailure
38 umulh x3, x0, x1
39 cmp x3, #-4
40 bne .Lfailure
42 mov x0, #2
43 mov x1, #2
44 smulh x2, x0, x1
45 cmp x2, #0
46 bne .Lfailure
47 umulh x3, x0, x1
48 cmp x3, #0
49 bne .Lfailure
51 pass
52 .Lfailure:
53 fail