7 /* need to avoid acr as source here. */
8 static inline int cris_addc_m(int a
, const int *b
)
10 asm volatile ("addc [%1], %0\n" : "+r" (a
) : "r" (b
));
14 /* 'b' is a crisv32 constrain to avoid postinc with $acr. */
15 static inline int cris_addc_pi_m(int a
, int **b
)
17 asm volatile ("addc [%1+], %0\n" : "+r" (a
), "+b" (*b
));
21 #define verify_addc_m(a, b, res, n, z, v, c) \
24 r = cris_addc_m((a), (b)); \
25 cris_tst_cc((n), (z), (v), (c)); \
30 #define verify_addc_pi_m(a, b, res, n, z, v, c) \
33 r = cris_addc_pi_m((a), (b)); \
34 cris_tst_cc((n), (z), (v), (c)); \
39 int x
[] = { 0, 0, 2, -1, 0xffff, -1, 0x5432f789};
43 int *p
= (void *)&x
[0];
46 asm volatile ("clearf cz");
47 verify_addc_m(0, p
, 0, 0, 0, 0, 0);
50 asm volatile ("setf z");
51 verify_addc_m(0, p
, 0, 0, 1, 0, 0);
54 asm volatile ("setf c");
55 verify_addc_m(0, p
, 1, 0, 0, 0, 0);
58 asm volatile ("clearf c");
59 verify_addc_pi_m(0, &p
, 0, 0, 1, 0, 0);
63 asm volatile ("setf c");
64 verify_addc_pi_m(0, &p
, 1, 0, 0, 0, 0);
70 asm volatile ("clearf c");
71 verify_addc_pi_m(-1, &p
, 1, 0, 0, 0, 1);
77 /* TODO: investigate why this one fails. */
79 asm volatile ("setf c");
80 verify_addc_m(2, p
, 2, 0, 0, 0, 1);