4 static char *tst_cc_loc
= NULL
;
6 #define cris_tst_cc_init() \
7 do { tst_cc_loc = "test_cc failed at " CURRENT_LOCATION; } while(0)
9 /* We need a real symbol to signal error. */
12 tst_cc_loc
= "tst_cc_failed\n";
16 static always_inline
void cris_tst_cc_n1(void)
18 asm volatile ("bpl _err\n"
21 static always_inline
void cris_tst_cc_n0(void)
23 asm volatile ("bmi _err\n"
27 static always_inline
void cris_tst_cc_z1(void)
29 asm volatile ("bne _err\n"
32 static always_inline
void cris_tst_cc_z0(void)
34 asm volatile ("beq _err\n"
37 static always_inline
void cris_tst_cc_v1(void)
39 asm volatile ("bvc _err\n"
42 static always_inline
void cris_tst_cc_v0(void)
44 asm volatile ("bvs _err\n"
48 static always_inline
void cris_tst_cc_c1(void)
50 asm volatile ("bcc _err\n"
53 static always_inline
void cris_tst_cc_c0(void)
55 asm volatile ("bcs _err\n"
59 static always_inline
void cris_tst_mov_cc(int n
, int z
)
61 if (n
) cris_tst_cc_n1(); else cris_tst_cc_n0();
62 if (z
) cris_tst_cc_z1(); else cris_tst_cc_z0();
63 asm volatile ("" : : "g" (_err
));
66 static always_inline
void cris_tst_cc(const int n
, const int z
,
67 const int v
, const int c
)
69 if (n
) cris_tst_cc_n1(); else cris_tst_cc_n0();
70 if (z
) cris_tst_cc_z1(); else cris_tst_cc_z0();
71 if (v
) cris_tst_cc_v1(); else cris_tst_cc_v0();
72 if (c
) cris_tst_cc_c1(); else cris_tst_cc_c0();
73 asm volatile ("" : : "g" (_err
));