aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/v850eq-elf/t-sld.s
blob: e3d5be437fa3c03510fb45b7ee83aef7070b7750 (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
.include "t-macros.i"

	start

	# US bit in the PSW
	load r2 PSW_US
	stsr psw, r3
	or r2, r3
	ldsr r3, psw

	# check that the bit really was set
	stsr psw, r3
	and r2, r3
	check1x 1 r3 PSW_US
	

	# put something into EP
	load ep ep_base
	
test_sldb1:
	sld.b 0[ep], r4
	check1x 2 r4 0xffffff80
	
test_sldbu1:
	sld.bu 0[ep], r4
	check1x 3 r4, 0x80

test_sldh1:
	sld.h 0[ep], r4
	check1x 4 r4 0xffff8080
	
test_sldhu1:
	sld.hu 0[ep], r4
	check1x 5 r4, 0x8080

test_sldw1:
	sld.w 0[ep], r4
	check1x 5 r4, 0x80808080

	
	# Now clear the US bit - switch signed/unsigned
	load r2 PSW_US
	not r2, r2
	stsr psw, r3
	and r2, r3
	ldsr r3, psw

	
test_sldb2:
	sld.b 0[ep], r4
	check1x 6 r4, 0x80
	
test_sldbu2:
	sld.bu 0[ep], r4
	check1x 7 r4 0xffffff80

test_sldh2:
	sld.h 0[ep], r4
	check1x 8 r4, 0x8080
	
test_sldhu2:
	sld.hu 0[ep], r4
	check1x 9 r4 0xffff8080

test_sldw2:
	sld.w 0[ep], r4
	check1x 5 r4, 0x80808080

	exit0

	.align 2
ep_base:
	.long 0x80808080