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
|
# v850 bsh
# mach: v850e
# as(v850e): -mv850e
.include "testutils.inc"
seti 0x12345678, r1
bsh r1, r2
flags 0
reg r2, 0x34127856
# CY is 1 if one or more bytes in the result half-word is zero, else 0
seti 0x12345600, r1
bsh r1, r2
flags c
reg r2, 0x34120056
seti 0x12340078, r1
bsh r1, r2
flags c
reg r2, 0x34127800
seti 0x12005678, r1
bsh r1, r2
flags 0
reg r2, 0x00127856
seti 0x00345678, r1
bsh r1, r2
flags 0
reg r2, 0x34007856
# S is set if the result is negative
seti 0x00800000, r1
bsh r1, r2
flags s + c + z
reg r2, 0x80000000
# Z is set if the result is zero
# According to NEC, the Z flag depends on only the lower half-word
seti 0x00000000, r1
bsh r1, r2
flags c + z
reg r2, 0x00000000
seti 0xffff0000, r1
bsh r1, r2
flags c + s + z
reg r2, 0xffff0000
pass
|