Statistics
| Branch: | Revision:

root / tests / tcg / cris / testutils.inc @ c09015dd

History | View | Annotate | Download (1.3 kB)

1 dd43edf4 ths
	.syntax	no_register_prefix
2 dd43edf4 ths
3 dd43edf4 ths
	.macro	start
4 dd43edf4 ths
	.text
5 dd43edf4 ths
	.global	main
6 dd43edf4 ths
main:
7 dd43edf4 ths
	.endm
8 dd43edf4 ths
9 dd43edf4 ths
	.macro	quit
10 dd43edf4 ths
	jump	pass
11 dd43edf4 ths
	nop
12 dd43edf4 ths
	.endm
13 dd43edf4 ths
14 dd43edf4 ths
	.macro	pass
15 dd43edf4 ths
	jump	pass
16 dd43edf4 ths
	nop
17 dd43edf4 ths
	.endm
18 dd43edf4 ths
19 dd43edf4 ths
	.macro	startnostack
20 dd43edf4 ths
	start
21 dd43edf4 ths
	.endm
22 dd43edf4 ths
23 dd43edf4 ths
	.macro	fail
24 dd43edf4 ths
	.data
25 dd43edf4 ths
99:
26 31328119 edgar_igl
	.asciz " checkr3 failed\n"
27 dd43edf4 ths
	.text
28 dd43edf4 ths
	move.d	99b, $r10
29 dd43edf4 ths
	jsr	_fail
30 dd43edf4 ths
	nop
31 dd43edf4 ths
	.endm
32 dd43edf4 ths
33 dd43edf4 ths
	.macro	checkr3 val
34 dd43edf4 ths
	cmp.d	0x\val, $r3
35 dd43edf4 ths
	beq	100f
36 dd43edf4 ths
	nop
37 dd43edf4 ths
	.data
38 dd43edf4 ths
99:
39 31328119 edgar_igl
	.asciz "checkr3 failed\n"
40 dd43edf4 ths
	.text
41 dd43edf4 ths
	move.d	99b, $r10
42 dd43edf4 ths
	jsr	_fail
43 dd43edf4 ths
	nop
44 dd43edf4 ths
100:
45 dd43edf4 ths
	.endm
46 dd43edf4 ths
47 dd43edf4 ths
; Test the condition codes
48 dd43edf4 ths
        .macro test_cc N Z V C
49 dd43edf4 ths
        .if \N
50 dd43edf4 ths
        bpl 9f
51 dd43edf4 ths
        nop
52 dd43edf4 ths
        .else
53 dd43edf4 ths
        bmi 9f
54 dd43edf4 ths
        nop
55 dd43edf4 ths
        .endif
56 dd43edf4 ths
        .if \Z
57 dd43edf4 ths
        bne 9f
58 dd43edf4 ths
        nop
59 dd43edf4 ths
        .else
60 dd43edf4 ths
        beq 9f
61 dd43edf4 ths
        nop
62 dd43edf4 ths
        .endif
63 dd43edf4 ths
        .if \V
64 dd43edf4 ths
        bvc 9f
65 dd43edf4 ths
        nop
66 dd43edf4 ths
        .else
67 dd43edf4 ths
        bvs 9f
68 dd43edf4 ths
        nop
69 dd43edf4 ths
        .endif
70 dd43edf4 ths
        .if \C
71 dd43edf4 ths
        bcc 9f
72 dd43edf4 ths
        nop
73 dd43edf4 ths
        .else
74 dd43edf4 ths
        bcs 9f
75 dd43edf4 ths
        nop
76 dd43edf4 ths
        .endif
77 dd43edf4 ths
        ba 8f
78 dd43edf4 ths
        nop
79 dd43edf4 ths
9:
80 dd43edf4 ths
	.data
81 dd43edf4 ths
99:
82 31328119 edgar_igl
	.asciz "test_move_cc failed\n"
83 dd43edf4 ths
	.text
84 dd43edf4 ths
	move.d	99b, $r10
85 dd43edf4 ths
	jsr	_fail
86 dd43edf4 ths
	nop
87 dd43edf4 ths
8:
88 dd43edf4 ths
        .endm
89 dd43edf4 ths
90 dd43edf4 ths
91 dd43edf4 ths
        .macro test_move_cc N Z V C
92 dd43edf4 ths
        .if \N
93 dd43edf4 ths
        bpl 9f
94 dd43edf4 ths
        nop
95 dd43edf4 ths
        .else
96 dd43edf4 ths
        bmi 9f
97 dd43edf4 ths
        nop
98 dd43edf4 ths
        .endif
99 dd43edf4 ths
        .if \Z
100 dd43edf4 ths
        bne 9f
101 dd43edf4 ths
        nop
102 dd43edf4 ths
        .else
103 dd43edf4 ths
        beq 9f
104 dd43edf4 ths
        nop
105 dd43edf4 ths
        .endif
106 dd43edf4 ths
        ba 8f
107 dd43edf4 ths
        nop
108 dd43edf4 ths
9:
109 dd43edf4 ths
	.data
110 dd43edf4 ths
99:
111 31328119 edgar_igl
	.asciz "test_move_cc failed\n"
112 dd43edf4 ths
	.text
113 dd43edf4 ths
	move.d	99b, $r10
114 dd43edf4 ths
	jsr	_fail
115 dd43edf4 ths
	nop
116 dd43edf4 ths
8:
117 dd43edf4 ths
        .endm