summaryrefslogtreecommitdiff
path: root/sim/testsuite/sim/sh64/compact/macw.cgs
blob: f5935f7054d0157faef2d52e9e37108b7e89364e (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
# sh testcase for mac.w @${rm}+, @${rn}+
# mach: all
# as: -isa=shcompact
# ld: -m shelf32

	.include "compact/testutils.inc"

	start

	# 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.w @r1+, @r2+

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

	sts macl, r6
	assert r6, #1

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

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

doubleinc:
	mov #40, r0
	shll8 r0
	mov r0, r1
	mac.w @r0+, @r0+
	add #8, r1
	cmp/eq r0, r1
	bf wrong
	
okay:
	pass
wrong:
	fail