out:(int)reg = IFEQ.I(in:(cr)cr)
emit "mfcr %out" /* get cr0 */
- emit "rlwinm %out, %out, [32-2], 2, 31" /* extract just EQ */
+ emit "rlwinm %out, %out, 3, 31, 31" /* extract just EQ */
cost 8;
+#if 0
out:(int)reg = IFEQ.I(in:(int)reg)
emit "cntlzw %out, %in" /* returns 0..32 */
- emit "rlwinm %out, %out, [32-5], 5, 31" /* if 32, return 1, otherwise 0 */
+ emit "rlwinm %out, %out, [32-5], 31, 31" /* if 32, return 1, otherwise 0 */
cost 8;
+#endif
out:(int)reg = IFLT.I(in:(cr)cr)
emit "mfcr %out" /* get cr0 */
- emit "andi. %out, %out, 1" /* leave just LT */
+ emit "rlwinm %out, %out, 1, 31, 31" /* leave just LT */
cost 8;
out:(int)reg = IFLE.I(in:(cr)cr)
emit "mfcr %out" /* get cr0 */
- emit "andi. %out, %out, 5" /* leave just LT and EQ */
- emit "cntlzw %out, %out" /* returns 0..32 */
- emit "rlwinm %out, %out, [32-5], 5, 31" /* if 32, return 1, otherwise 0 */
+ emit "rlwinm %out, %out, 2, 31, 31" /* leave just GT */
emit "xori %out, %out, 1" /* negate */
- cost 8;
+ cost 12;
emit "neg %out, %left"
cost 4;
- out:(int)reg = NOT.I(left:(int)reg)
- emit "cntlzw %out, %left"
- emit "rlwinm %out, %out, 32-5, 5, 31"
- cost 8;
+ out:(int)reg = NOT.I(in:(int)reg)
+ emit "nor %out, %in, %in"
+ cost 4;
ALUR(AND.I, "and")
ALUCC(AND.I, "andi.")