7 /* this would be better to do in asm, it's an orgy in GCC inline asm now. */
9 #define cris_addo_b(o, v) \
10 asm volatile ("addo.b\t[%0], %1, $acr\n" : : "r" (o), "r" (v) : "acr");
11 #define cris_addo_w(o, v) \
12 asm volatile ("addo.w\t[%0], %1, $acr\n" : : "r" (o), "r" (v) : "acr");
13 #define cris_addo_d(o, v) \
14 asm volatile ("addo.d\t[%0], %1, $acr\n" : : "r" (o), "r" (v) : "acr");
15 #define cris_addo_pi_b(o, v) \
16 asm volatile ("addo.b\t[%0+], %1, $acr\n" \
17 : "+b" (o): "r" (v) : "acr");
18 #define cris_addo_pi_w(o, v) \
19 asm volatile ("addo.w\t[%0+], %1, $acr\n" \
20 : "+b" (o): "r" (v) : "acr");
21 #define cris_addo_pi_d(o, v) \
22 asm volatile ("addo.d\t[%0+], %1, $acr\n" \
23 : "+b" (o): "r" (v) : "acr");
42 static int x
[3] = {0x55aa77ff, 0xccff2244, 0x88ccee19};
49 /* Note, this test-case will trig an unaligned access, partly
50 to x[0] and to [x1]. */
51 t
= (unsigned char *)x
;
53 p
= (unsigned char *) &y
.v1
;
54 mb(); /* dont reorder anything beyond here. */
56 asm volatile ("setf\tzvnc\n");
58 cris_tst_cc(1, 1, 1, 1);
59 asm volatile ("move.d\t$acr, %0\n" : "=r" (r
));
65 mb(); /* dont reorder anything beyond here. */
67 asm volatile ("setf\tzvnc\n");
69 cris_tst_cc(1, 1, 1, 1);
70 asm volatile ("move.d\t$acr, %0\n" : "=r" (r
));
74 mb(); /* dont reorder anything beyond here. */
76 asm volatile ("setf\tzvnc\n");
78 cris_tst_cc(1, 1, 1, 1);
80 asm volatile ("move.d\t$acr, %0\n" : "=r" (r
));
84 mb(); /* dont reorder anything beyond here. */
86 asm volatile ("setf\tzvnc\n");
88 cris_tst_cc(1, 1, 1, 1);
89 asm volatile ("move.d\t$acr, %0\n" : "=r" (r
));
90 if (*(uint16_t*)r
!= 0xff22)
93 mb(); /* dont reorder anything beyond here. */
95 asm volatile ("setf\tzvnc\n");
97 cris_tst_cc(1, 1, 1, 1);
99 asm volatile ("move.d\t$acr, %0\n" : "=r" (r
));
100 if (*r
!= 0x4455aa77)
103 mb(); /* dont reorder anything beyond here. */
105 asm volatile ("setf\tzvnc\n");
107 cris_tst_cc(1, 1, 1, 1);
109 asm volatile ("move.d\t$acr, %0\n" : "=r" (r
));
110 if (*r
!= 0xff224455)
113 mb(); /* dont reorder anything beyond here. */
115 asm volatile ("setf\tzvnc\n");
116 cris_addo_pi_d(p
, t
);
117 cris_tst_cc(1, 1, 1, 1);
118 asm volatile ("move.d\t$acr, %0\n" : "=r" (r
));
119 r
= (void*)(((char *)r
) + 76789885);
120 if (*r
!= 0x55aa77ff)