* Contribute Hitachi SH5 simulator.
[deliverable/binutils-gdb.git] / sim / testsuite / sim / sh64 / compact / muluw.cgs
1 # sh testcase for mulu.w $rm, $rn -*- Asm -*-
2 # mach: all
3 # as: -isa=shcompact
4 # ld: -m shelf32
5
6 .include "compact/testutils.inc"
7
8 start
9
10 sts mach, r7
11
12 .global mulsw
13 zero:
14 mov #0, r0
15 mov #1, r1
16 mulu.w r0, r1
17
18 # Check the result.
19 sts macl, r1
20 mov #0, r0
21 cmp/eq r0, r1
22 bf wrong
23
24 sxs:
25 # Small * small.
26 mov #1, r0
27 mov #2, r1
28 mulu.w r0, r1
29
30 # Check the result.
31 sts macl, r1
32 mov #2, r0
33 cmp/eq r0, r1
34 bf wrong
35
36 sxl:
37 # Small * large.
38 mov #1, r1
39 mov #0, r0
40 or #255, r0
41 shll8 r0
42 mulu.w r1, r0
43
44 # Check the result.
45 sts macl, r1
46 mov #0, r0
47 or #255, r0
48 shll8 r0
49 cmp/eq r0, r1
50 bf wrong
51
52 lxs:
53 # Large * small.
54 mov #0, r0
55 or #255, r0
56 shll8 r0
57 mov #1, r1
58 mulu.w r0, r1
59
60 # Check the result.
61 sts macl, r1
62 mov #0, r0
63 or #255, r0
64 shll8 r0
65 cmp/eq r0, r1
66 bf wrong
67
68 lxl:
69 # Large * large.
70 mov #0, r0
71 or #255, r0
72 shll8 r0
73 mov r0, r1
74 mulu.w r0, r1
75
76 # Check the result.
77 sts macl, r1
78 mov #0, r0
79 or #254, r0
80 shll8 r0
81 or #1, r0
82 shll16 r0
83 cmp/eq r0, r1
84 bf wrong
85
86 invariant:
87 # Ensure MACH is invariant.
88 sts mach, r8
89 cmp/eq r7, r8
90 bf wrong
91
92 okay:
93 pass
94
95 wrong:
96 fail
This page took 0.04239 seconds and 4 git commands to generate.