1 # Blackfin testcase for setting all ASTAT bits via CC
4 # We encode the opcodes directly since we test reserved bits
5 # which lack an insn in the ISA for it. It's a 16bit insn;
6 # the low 8 bits are always 0x03 while the encoding for the
16 # bit 4-0 - the bit in ASTAT to access
18 .include "testutils.inc"
20 .macro _do dir:req, op:req, bit:req, bit_in:req, cc_in:req, bg_val:req, bit_out:req, cc_out:req
21 /* CC = CC; is invalid, so skip it */
24 /* Calculate the before and after ASTAT values */
25 imm32
R1, (\bg_val
& ~
((1 << \bit
) |
(1 << 5))) |
(\bit_in
<< \bit
) |
(\cc_in
<< 5);
26 imm32
R3, (\bg_val
& ~
((1 << \bit
) |
(1 << 5))) |
(\bit_out
<< \bit
) |
(\cc_out
<< 5);
28 /* Test the actual opcode */
30 .byte (\dir << 7) | (\op << 5) | \bit
34 /* Make sure things line up */
42 /* Recurse through all the bits */
44 _do \dir
, \op
, \bit
- 1, \bit_in
, \cc_in
, \bg_val
, \bit_out
, \cc_out
48 /* Test different background fields on ASTAT */
49 .macro do dir:req, op:req, bit_in:req, cc_in:req, bit_out:req, cc_out:req
50 _do \dir
, \op
, 31, \bit_in
, \cc_in
, 0, \bit_out
, \cc_out
51 _do \dir
, \op
, 31, \bit_in
, \cc_in
, -1, \bit_out
, \cc_out
57 _cc_eq_bit
: /* CC = bit */
62 _bit_eq_cc
: /* bit = CC */
68 _cc_or_bit
: /* CC |= bit */
73 _bit_or_cc
: /* bit |= CC */
79 _cc_and_bit
: /* CC &= bit */
84 _bit_and_cc
: /* bit &= CC */
90 _cc_xor_bit
: /* CC ^= bit */
95 _bit_xor_cc
: /* bit ^= CC */