aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/mcore/sexth.s
blob: 97279c49ed43e783bc51bb247e70d33e0c0cd4b4 (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
# check that sext.b/sext.h work correctly
# mach: mcore

.include "testutils.inc"

	start
	# Construct -32760 using bgeni+addi+sext
	bgeni	r2, 15
	addi	r2,8
	sexth	r2

	# Construct -32760 using bmask+subi+not
        bmaski  r7,15
        subi    r7,8    // 32759 0x7ff7
	not	r7


	# Compare them, they should be equal
	cmpne	r2,r7
	jbt	.L1
	pass
.L1:
	fail