1 ; Copied from fr30 and modified.
2 ; r9, r11-r13 are used as tmps, consider them call clobbered by these macros.
4 ; Do not use the macro counter \@ in macros, there's a bug in
5 ; gas 2.9.1 when it is also a line-separator.
8 ; Don't require the $-prefix on registers.
9 .syntax no_register_prefix
13 .space 64,0 ; Simple stack
30 ; Exit with return code
33 moveq 1,r9 ; == __NR_exit
43 moveq 4,r9 ; == __NR_write
67 ; Load an immediate value into a general register
68 ; TODO: use minimal sized insn
69 .macro mvi_h_gr val reg
73 ; Load an immediate value into a dedicated register
74 .macro mvi_h_dr val reg
79 ; Load a general register into another general register
80 .macro mvr_h_gr src targ
84 ; Store an immediate into a word in memory
85 .macro mvi_h_mem val addr
90 ; Store a register into a word in memory
91 .macro mvr_h_mem reg addr
96 ; Store the current ps on the stack
98 .if ..asm.arch.cris.v32
99 move ccs,acr ; Push will do a "subq" first.
106 ; Load a word value from memory
107 .macro ldmem_h_gr addr reg
112 ; Add 2 general registers
113 .macro add_h_gr reg1 reg2
117 ; Increment a register by and immediate
118 .macro inci_h_gr inc reg
123 ; Test the value of an immediate against a general register
124 .macro test_h_gr val reg
132 ; compare two general registers
133 .macro testr_h_gr reg1 reg2
140 ; Test the value of an immediate against a dedicated register
141 .macro test_h_dr val reg
146 ; Test the value of an general register against a dedicated register
147 .macro testr_h_dr gr dr
152 ; Compare an immediate with word in memory
153 .macro test_h_mem val addr
154 ldmem_h_gr \addr $r12
158 ; Compare a general register with word in memory
159 .macro testr_h_mem reg addr
164 ; Set the condition codes
165 ; The lower bits of the mask *are* nzvc, so we don't
166 ; have to do anything strange.
169 .if ..asm.arch.cris.v32
181 ; .macro set_s_system
185 ;; Test the stack mode
193 ; .macro test_s_system
200 ; Set the interrupt bit
201 ; ??? Do they mean "enable interrupts" or "disable interrupts"?
202 ; Assuming enable here.
211 ; Test the stack mode
229 ; .macro test_ilm val
231 ; mvi_h_gr 0x1f0000,r11
241 ; Test the condition codes
242 .macro test_cc N Z V C
278 .macro test_move_cc N Z V C
279 .if ..asm.arch.cris.v32
280 ; V and C aren't affected on v32, so to re-use the test-cases,
281 ; we fake them cleared. There's a separate test, nonvcv32.ms
282 ; covering this omission.
290 ; Set the division bits
291 ; .macro set_dbits val
293 ; mvi_h_gr 0xfffff8ff,r11
303 ;; Test the division bits
304 ; .macro test_dbits val
312 ; Save the return pointer
317 ; restore the return pointer
322 ; Ensure branch taken
323 .macro take_branch opcode
330 .macro take_branch_d opcode val
339 ; Ensure branch not taken
340 .macro no_branch opcode
350 .macro no_branch_d opcode val