- if (pfomask & (1 << PFO_Z)) {
- fprintf(fout, "\n cond_z = (%s == 0);", buf1);
- pfomask &= ~(1 << PFO_Z);
- }
- if (pfomask & (1 << PFO_S)) {
- fprintf(fout, "\n cond_s = ((s32)%s < 0);", buf1);
- pfomask &= ~(1 << PFO_S);
+ output_std_flags(fout, po, &pfomask, buf1);
+ last_arith_dst = &po->operand[0];
+ delayed_flag_op = NULL;
+ break;
+
+ case OP_SHL:
+ case OP_SHR:
+ assert_operand_cnt(2);
+ out_dst_opr(buf1, sizeof(buf1), po, &po->operand[0]);
+ if (pfomask & (1 << PFO_C)) {
+ if (po->operand[1].type == OPT_CONST) {
+ l = lmod_bytes(po, po->operand[0].lmod) * 8;
+ j = po->operand[1].val;
+ j %= l;
+ if (j != 0) {
+ if (po->op == OP_SHL)
+ j = l - j;
+ else
+ j -= 1;
+ fprintf(fout, " cond_c = (%s & 0x%02x) ? 1 : 0;\n",
+ buf1, 1 << j);
+ }
+ else
+ ferr(po, "zero shift?\n");
+ }
+ else
+ ferr(po, "TODO\n");
+ pfomask &= ~(1 << PFO_C);