1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# sh testcase for mul.l $rm, $rn -*- Asm -*-
# mach: all
# as: -isa=shcompact
# ld: -m shelf32
.include "compact/testutils.inc"
start
.global mull
mull:
mov #3, r0
mov #5, r1
mul.l r0, r1
# Check the result.
sts macl, r3
mov #15, r4
cmp/eq r3, r4
bf wrong
lxs:
# Large * small.
mov #255, r0
mov #0, r1
mul.l r0, r1
# Check the result.
sts macl, r3
mov #0, r4
cmp/eq r3, r4
bf wrong
sxl:
# Small * large.
mov #0, r0
mov #255, r1
mul.l r0, r1
# Check the result.
sts macl, r3
mov #0, r4
cmp/eq r3, r4
bf wrong
lxl:
# Large * large.
mov #1, r0
neg r0, r0
mov #2, r1
mul.l r0, r1
# Check the result.
sts macl, r3
mov #2, r4
neg r4, r4
cmp/eq r3, r4
bf wrong
okay:
pass
wrong:
fail
|