summaryrefslogtreecommitdiff
path: root/sim/testsuite/sim/sh64/compact/macl.cgs
blob: ef2dfa6e929a2d5680ec2022b2fb3e7f31d3f666 (plain)
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
65
66
67
68
69
70
71
72
73
74
75
76
# sh testcase for mac.l @${rm}+, @${rn}+
# mach: all
# as: -isa=shcompact
# ld: -m shelf32

	.include "compact/testutils.inc"

	start
	# force S-bit clear
	clrs

	# Store some magic numbers in memory.
	mov #40, r1
	shll8 r1
	mov #85, r0
	mov.l r0, @r1
	# Keep for later.
	mov r1, r10
store2:
	mov #40, r1
	shll8 r1
	add #12, r1
	mov #17, r0
	mov.l r0, @r1
	# Keep for later.
	mov r1, r11

init:
	# Set up addresses.
	mov #40, r1
	shll8 r1
	mov #40, r2
	shll8 r2
	add #12, r2

	# Prime {MACL, MACH} to #1.
	mov #1, r3
	dmulu.l r3, r3

test:
	mac.l @r1+, @r2+

check:
	# Check result.
	sts mach, r5
	assert r5, #0

	mov #5, r0
	shll8 r0
	or #166, r0
	sts macl, r6
	cmp/eq r6, r0
	bf wrong

	# Ensure post-increment occurred.
	add #4, r10
	cmp/eq r10, r1
	bf wrong

	add #4, r11
	cmp/eq r11, r2
	bf wrong

doubleinc:
	mov #40, r0
	shll8 r0
	mov r0, r1
	mac.l @r0+, @r0+
	add #16, r1
	cmp/eq r0, r1
	bf wrong

okay:
	pass
wrong:
	fail