5 #define BRASLCLOBBER "cc", "0","1","2","3","4","5","14", \
6 "f0","f1","f2","f3","f4","f5","f6","f7"
8 void if_eq(void) { printf("equal\n"); }
9 void if_ne(void) { printf("not equal\n"); }
10 void if_gt(void) { printf("greater than\n"); }
11 void if_le(void) { printf("less or equal\n"); }
12 void if_lt(void) { printf("less than\n"); }
13 void if_ge(void) { printf("greater or equal\n"); }
14 void if_taken(void) { printf("taken\n"); }
15 void if_not_taken(void) { printf("not taken\n"); }
28 void compare_never(uint32_t value
)
30 register uint32_t val
asm("r7") = value
;
34 CLIJ(7,NEVER
,8,2a
) "\n\t" /* 0x2a == 42 */
35 "brasl 14,if_not_taken\n\t"
37 "brasl 14,if_taken\n\t"
38 "0: aghi 15,160\n\t" : : "d"(val
) : BRASLCLOBBER
);
42 void compare_always(uint32_t value
)
44 register uint32_t val
asm("r7") = value
;
48 CLIJ(7,ALWAYS
,8,2a
) "\n\t" /* 0x2a == 42 */
49 "brasl 14,if_not_taken\n\t"
51 "brasl 14,if_taken\n\t"
52 "0: aghi 15,160\n\t" : : "d"(val
) : BRASLCLOBBER
);
56 void compare_le42(uint32_t value
)
58 register uint32_t val
asm("r7") = value
;
62 CLIJ(7,LE
,8,2a
) "\n\t" /* 0x2a == 42 */
66 "0: aghi 15,160\n\t" : : "d"(val
) : BRASLCLOBBER
);
70 void compare_ge42(uint32_t value
)
72 register uint32_t val
asm("r7") = value
;
76 CLIJ(7,GE
,8,2a
) "\n\t" /* 0x2a == 42 */
80 "0: aghi 15,160\n\t" : : "d"(val
) : BRASLCLOBBER
);
84 void compare_gt42(uint32_t value
)
86 register uint32_t val
asm("r7") = value
;
90 CLIJ(7,GT
,8,2a
) "\n\t" /* 0x2a == 42 */
94 "0: aghi 15,160\n\t" : : "d"(val
) : BRASLCLOBBER
);
98 void compare_lt42(uint32_t value
)
100 register uint32_t val
asm("r7") = value
;
104 CLIJ(7,LT
,8,2a
) "\n\t" /* 0x2a == 42 */
108 "0: aghi 15,160\n\t" : : "d"(val
) : BRASLCLOBBER
);
112 void compare_eq42(uint32_t value
)
114 register uint32_t val
asm("r7") = value
;
118 CLIJ(7,EQ
,8,2a
) "\n\t" /* 0x2a == 42 */
122 "0: aghi 15,160\n\t" : : "d"(val
) : BRASLCLOBBER
);
126 void compare_ne42(uint32_t value
)
128 register uint32_t val
asm("r7") = value
;
132 CLIJ(7,NE
,8,2a
) "\n\t" /* 0x2a == 42 */
136 "0: aghi 15,160\n\t" : : "d"(val
) : BRASLCLOBBER
);