--- gcc/config/i386.c 2018/04/24 17:51:33 1.1 +++ gcc/config/i386.c 2018/04/24 18:04:29 1.1.1.4 @@ -1,5 +1,5 @@ /* Subroutines for insn-output.c for Intel 80386. - Copyright (C) 1988 Free Software Foundation, Inc. + Copyright (C) 1988, 1992 Free Software Foundation, Inc. This file is part of GNU CC. @@ -31,6 +31,15 @@ the Free Software Foundation, 675 Mass A #include "tree.h" #include "flags.h" +#ifdef EXTRA_CONSTRAINT +/* If EXTRA_CONSTRAINT is defined, then the 'S' + constraint in REG_CLASS_FROM_LETTER will no longer work, and various + asm statements that need 'S' for class SIREG will break. */ + error EXTRA_CONSTRAINT conflicts with S constraint letter +/* The previous line used to be #error, but some compilers barf + even if the conditional was untrue. */ +#endif + #define AT_BP(mode) (gen_rtx (MEM, (mode), frame_pointer_rtx)) extern FILE *asm_out_file; @@ -38,10 +47,11 @@ extern char *strcat (); char *singlemove_string (); char *output_move_const_single (); +char *output_fp_cc0_set (); -static char *hi_reg_name[] = HI_REGISTER_NAMES; -static char *qi_reg_name[] = QI_REGISTER_NAMES; -static char *qi_high_reg_name[] = QI_HIGH_REGISTER_NAMES; +char *hi_reg_name[] = HI_REGISTER_NAMES; +char *qi_reg_name[] = QI_REGISTER_NAMES; +char *qi_high_reg_name[] = QI_HIGH_REGISTER_NAMES; /* Array of the smallest class containing reg number REGNO, indexed by REGNO. Used by REGNO_REG_CLASS in i386.h. */ @@ -49,7 +59,7 @@ static char *qi_high_reg_name[] = QI_HIG enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] = { /* ax, dx, cx, bx */ - AREG, DREG, CREG, Q_REGS, + AREG, DREG, CREG, BREG, /* si, di, bp, sp */ SIREG, DIREG, INDEX_REGS, GENERAL_REGS, /* FP registers */ @@ -58,6 +68,12 @@ enum reg_class regclass_map[FIRST_PSEUDO /* arg pointer */ INDEX_REGS }; + +/* Test and compare insns in i386.md store the information needed to + generate branch and scc insns here. */ + +struct rtx_def *i386_compare_op0, *i386_compare_op1; +struct rtx_def *(*i386_compare_gen)(), *(*i386_compare_gen_eq)(); /* Output an insn whose source is a 386 integer register. SRC is the rtx for the register, and TEMPLATE is the op-code template. SRC may @@ -84,7 +100,7 @@ output_op_from_reg (src, template) xops[0] = src; xops[1] = AT_SP (Pmode); - xops[2] = gen_rtx (CONST_INT, VOIDmode, GET_MODE_SIZE (GET_MODE (src))); + xops[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (src))); xops[3] = stack_pointer_rtx; if (GET_MODE_SIZE (GET_MODE (src)) > UNITS_PER_WORD) @@ -113,7 +129,7 @@ output_to_reg (dest, dies) xops[0] = AT_SP (Pmode); xops[1] = stack_pointer_rtx; - xops[2] = gen_rtx (CONST_INT, VOIDmode, GET_MODE_SIZE (GET_MODE (dest))); + xops[2] = GEN_INT (GET_MODE_SIZE (GET_MODE (dest))); xops[3] = dest; output_asm_insn (AS2 (sub%L1,%2,%1), xops); @@ -207,12 +223,12 @@ asm_add (n, x) xops[1] = x; if (n < 0) { - xops[0] = gen_rtx (CONST_INT, VOIDmode, -n); + xops[0] = GEN_INT (-n); output_asm_insn (AS2 (sub%L0,%0,%1), xops); } else if (n > 0) { - xops[0] = gen_rtx (CONST_INT, VOIDmode, n); + xops[0] = GEN_INT (n); output_asm_insn (AS2 (add%L0,%0,%1), xops); } } @@ -227,6 +243,7 @@ output_move_double (operands) enum {REGOP, OFFSOP, MEMOP, PUSHOP, POPOP, CNSTOP, RNDOP } optype0, optype1; rtx latehalf[2]; rtx addreg0 = 0, addreg1 = 0; + int dest_overlapped_low = 0; /* First classify both operands. */ @@ -318,7 +335,12 @@ output_move_double (operands) if (GET_CODE (operands[1]) == CONST_DOUBLE) split_double (operands[1], &operands[1], &latehalf[1]); else if (CONSTANT_P (operands[1])) - latehalf[1] = const0_rtx; + { + if (GET_CODE (operands[1]) == CONST_INT && INTVAL (operands[1]) < 0) + latehalf[1] = constm1_rtx; + else + latehalf[1] = const0_rtx; + } } else latehalf[1] = operands[1]; @@ -331,6 +353,32 @@ output_move_double (operands) && reg_overlap_mentioned_p (stack_pointer_rtx, operands[1])) operands[1] = latehalf[1]; + /* For (set (reg:DI N) (mem:DI ... (reg:SI N) ...)), + if the upper part of reg N does not appear in the MEM, arrange to + emit the move late-half first. Otherwise, compute the MEM address + into the upper part of N and use that as a pointer to the memory + operand. */ + if (optype0 == REGOP + && (optype1 == OFFSOP || optype1 == MEMOP)) + { + if (reg_mentioned_p (operands[0], XEXP (operands[1], 0)) + && reg_mentioned_p (latehalf[0], XEXP (operands[1], 0))) + { + /* If both halves of dest are used in the src memory address, + compute the address into latehalf of dest. */ + rtx xops[2]; + xops[0] = latehalf[0]; + xops[1] = XEXP (operands[1], 0); + output_asm_insn (AS2 (lea%L0,%a1,%0), xops); + operands[1] = gen_rtx (MEM, DImode, latehalf[0]); + latehalf[1] = adj_offsettable_operand (operands[1], 4); + } + else if (reg_mentioned_p (operands[0], XEXP (operands[1], 0))) + /* If the low half of dest is mentioned in the source memory + address, the arrange to emit the move late half first. */ + dest_overlapped_low = 1; + } + /* If one or both operands autodecrementing, do the two words, high-numbered first. */ @@ -341,7 +389,8 @@ output_move_double (operands) if (optype0 == PUSHOP || optype1 == PUSHOP || (optype0 == REGOP && optype1 == REGOP - && REGNO (operands[0]) == REGNO (latehalf[1]))) + && REGNO (operands[0]) == REGNO (latehalf[1])) + || dest_overlapped_low) { /* Make any unoffsettable addresses point at high-numbered word. */ if (addreg0) @@ -428,7 +477,7 @@ output_move_const_single (operands) u1.i[0] = CONST_DOUBLE_LOW (operands[1]); u1.i[1] = CONST_DOUBLE_HIGH (operands[1]); u2.f = u1.d; - operands[1] = gen_rtx (CONST_INT, VOIDmode, u2.i); + operands[1] = GEN_INT (u2.i); } return singlemove_string (operands); } @@ -560,7 +609,8 @@ legitimize_pic_address (orig, reg) reg = gen_reg_rtx (Pmode); base = legitimize_pic_address (XEXP (addr, 0), reg); - addr = legitimize_pic_address (XEXP (addr, 1), base == reg ? 0 : reg); + addr = legitimize_pic_address (XEXP (addr, 1), + base == reg ? NULL_RTX : reg); if (GET_CODE (addr) == CONST_INT) return plus_constant (base, INTVAL (addr)); @@ -602,10 +652,12 @@ function_prologue (file, size) register int regno; int limit; rtx xops[4]; + int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table + || current_function_uses_const_pool); xops[0] = stack_pointer_rtx; xops[1] = frame_pointer_rtx; - xops[2] = gen_rtx (CONST_INT, VOIDmode, size); + xops[2] = GEN_INT (size); if (frame_pointer_needed) { output_asm_insn ("push%L1 %1", xops); @@ -627,14 +679,13 @@ function_prologue (file, size) limit = (frame_pointer_needed ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM); for (regno = limit - 1; regno >= 0; regno--) if ((regs_ever_live[regno] && ! call_used_regs[regno]) - || (current_function_uses_pic_offset_table - && regno == PIC_OFFSET_TABLE_REGNUM)) + || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used)) { xops[0] = gen_rtx (REG, SImode, regno); output_asm_insn ("push%L0 %0", xops); } - if (current_function_uses_pic_offset_table) + if (pic_reg_used) { xops[0] = pic_offset_table_rtx; xops[1] = (rtx) gen_label_rtx (); @@ -663,6 +714,8 @@ simple_386_epilogue () int nregs = 0; int reglimit = (frame_pointer_needed ? FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM); + int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table + || current_function_uses_const_pool); #ifdef NON_SAVING_SETJMP if (NON_SAVING_SETJMP && current_function_calls_setjmp) @@ -674,8 +727,7 @@ simple_386_epilogue () for (regno = reglimit - 1; regno >= 0; regno--) if ((regs_ever_live[regno] && ! call_used_regs[regno]) - || (current_function_uses_pic_offset_table - && regno == PIC_OFFSET_TABLE_REGNUM)) + || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used)) nregs++; return nregs == 0 || ! frame_pointer_needed; @@ -694,6 +746,8 @@ function_epilogue (file, size) register int nregs, limit; int offset; rtx xops[3]; + int pic_reg_used = flag_pic && (current_function_uses_pic_offset_table + || current_function_uses_const_pool); /* Compute the number of registers to pop */ @@ -705,8 +759,7 @@ function_epilogue (file, size) for (regno = limit - 1; regno >= 0; regno--) if ((regs_ever_live[regno] && ! call_used_regs[regno]) - || (current_function_uses_pic_offset_table - && regno == PIC_OFFSET_TABLE_REGNUM)) + || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used)) nregs++; /* sp is often unreliable so we must go off the frame pointer, @@ -732,8 +785,7 @@ function_epilogue (file, size) for (regno = 0; regno < limit; regno++) if ((regs_ever_live[regno] && ! call_used_regs[regno]) - || (current_function_uses_pic_offset_table - && regno == PIC_OFFSET_TABLE_REGNUM)) + || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used)) { xops[0] = gen_rtx (REG, SImode, regno); output_asm_insn ("pop%L0 %0", xops); @@ -742,8 +794,7 @@ function_epilogue (file, size) else for (regno = 0; regno < limit; regno++) if ((regs_ever_live[regno] && ! call_used_regs[regno]) - || (current_function_uses_pic_offset_table - && regno == PIC_OFFSET_TABLE_REGNUM)) + || (regno == PIC_OFFSET_TABLE_REGNUM && pic_reg_used)) { xops[0] = gen_rtx (REG, SImode, regno); xops[1] = adj_offsettable_operand (AT_BP (Pmode), offset); @@ -768,13 +819,13 @@ function_epilogue (file, size) { /* If there is no frame pointer, we must still release the frame. */ - xops[0] = gen_rtx (CONST_INT, VOIDmode, size); + xops[0] = GEN_INT (size); output_asm_insn (AS2 (add%L2,%0,%2), xops); } if (current_function_pops_args && current_function_args_size) { - xops[1] = gen_rtx (CONST_INT, VOIDmode, current_function_pops_args); + xops[1] = GEN_INT (current_function_pops_args); /* i386 can only pop 32K bytes (maybe 64K? Is it signed?). If asked to pop more, pop return address, do explicit add, and jump @@ -791,11 +842,6 @@ function_epilogue (file, size) else output_asm_insn ("ret %1", xops); } - else if (current_function_returns_struct) - { - xops[0] = gen_rtx (CONST_INT, VOIDmode, 4); - output_asm_insn ("ret %0", xops); - } else output_asm_insn ("ret", xops); } @@ -904,45 +950,6 @@ output_pic_addr_const (file, x, code) } } -/* Print the name of a register based on its machine mode and number. - If CODE is 'w', pretend the mode is HImode. - If CODE is 'b', pretend the mode is QImode. - If CODE is 'k', pretend the mode is SImode. - If CODE is 'h', pretend the reg is the `high' byte register. - If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. */ - -#define PRINT_REG(X, CODE, FILE) \ - do { if (REGNO (X) == ARG_POINTER_REGNUM) \ - abort (); \ - fprintf (FILE, "%s", RP); \ - switch ((CODE == 'w' ? 2 \ - : CODE == 'b' ? 1 \ - : CODE == 'k' ? 4 \ - : CODE == 'y' ? 3 \ - : CODE == 'h' ? 0 \ - : GET_MODE_SIZE (GET_MODE (X)))) \ - { \ - case 3: \ - if (STACK_TOP_P (X)) \ - { \ - fputs ("st(0)", FILE); \ - break; \ - } \ - case 4: \ - case 8: \ - if (!FP_REG_P (X)) fputs ("e", FILE); \ - case 2: \ - fputs (hi_reg_name[REGNO (X)], FILE); \ - break; \ - case 1: \ - fputs (qi_reg_name[REGNO (X)], FILE); \ - break; \ - case 0: \ - fputs (qi_high_reg_name[REGNO (X)], FILE); \ - break; \ - } \ - } while (0) - /* Meaning of CODE: f -- float insn (print a CONST_DOUBLE as a float rather than in hex). D,L,W,B,Q,S -- print the opcode suffix for specified size of operand. @@ -968,8 +975,6 @@ print_operand (file, x, code) putc ('*', file); return; - case 'D': - PUT_OP_SIZE (code, 'l', file); case 'L': PUT_OP_SIZE (code, 'l', file); return; @@ -990,10 +995,6 @@ print_operand (file, x, code) PUT_OP_SIZE (code, 's', file); return; - case 'R': - fprintf (file, "%s", RP); - return; - case 'z': /* 387 opcodes don't get size suffixes if the operands are registers. */ @@ -1024,11 +1025,34 @@ print_operand (file, x, code) case 8: if (GET_MODE_CLASS (GET_MODE (x)) == MODE_INT) - PUT_OP_SIZE ('Q', 'l', file); + { +#ifdef GAS_MNEMONICS + PUT_OP_SIZE ('Q', 'q', file); + return; +#else + PUT_OP_SIZE ('Q', 'l', file); /* Fall through */ +#endif + } PUT_OP_SIZE ('Q', 'l', file); return; } + + case 'b': + case 'w': + case 'k': + case 'h': + case 'y': + case 'P': + break; + + default: + { + char str[50]; + + sprintf (str, "invalid operand code `%c'", code); + output_operand_lossage (str); + } } } if (GET_CODE (x) == REG) @@ -1055,13 +1079,8 @@ print_operand (file, x, code) u.i[0] = CONST_DOUBLE_LOW (x); u.i[1] = CONST_DOUBLE_HIGH (x); u1.f = u.d; - if (code == 'f') - fprintf (file, "%.22e", u1.f); - else - { - PRINT_IMMED_PREFIX (file); - fprintf (file, "0x%x", u1.i); - } + PRINT_IMMED_PREFIX (file); + fprintf (file, "0x%x", u1.i); } else if (GET_CODE (x) == CONST_DOUBLE && GET_MODE (x) == DFmode) { @@ -1072,9 +1091,9 @@ print_operand (file, x, code) } else { - if (code != 'c' && code != 'P') + if (code != 'P') { - if (GET_CODE (x) == CONST_INT) + if (GET_CODE (x) == CONST_INT || GET_CODE (x) == CONST_DOUBLE) PRINT_IMMED_PREFIX (file); else if (GET_CODE (x) == CONST || GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF) @@ -1343,7 +1362,9 @@ notice_update_cc (exp) if (SET_DEST (XVECEXP (exp, 0, 0)) == cc0_rtx) { CC_STATUS_INIT; - if (! stack_regs_mentioned_p (SET_SRC (XVECEXP (exp, 0, 0)))) + if (stack_regs_mentioned_p (SET_SRC (XVECEXP (exp, 0, 0)))) + cc_status.flags |= CC_IN_80387; + else cc_status.value1 = SET_SRC (XVECEXP (exp, 0, 0)); return; } @@ -1436,21 +1457,6 @@ convert_387_op (op, mode) } } -/* Return 1 if this is a valid "float from int" operation on a 387. - OP is the expression matched, and MODE is its mode. */ - -int -float_op (op, mode) - register rtx op; - enum machine_mode mode; -{ - if (mode != VOIDmode && mode != GET_MODE (op)) - return 0; - - return GET_CODE (op) == FLOAT - && GET_MODE_CLASS (GET_MODE (op)) == MODE_FLOAT; -} - /* Return 1 if this is a valid shift or rotate operation on a 386. OP is the expression matched, and MODE is its mode. */ @@ -1631,8 +1637,8 @@ output_fix_trunc (insn, operands) xops[0] = stack_pointer_rtx; xops[1] = AT_SP (SImode); xops[2] = adj_offsettable_operand (xops[1], 2); - xops[3] = gen_rtx (CONST_INT, VOIDmode, 4); - xops[4] = gen_rtx (CONST_INT, VOIDmode, 0xc00); + xops[3] = GEN_INT (4); + xops[4] = GEN_INT (0xc00); xops[5] = operands[2]; output_asm_insn (AS2 (sub%L0,%3,%0), xops); @@ -1671,7 +1677,8 @@ output_fix_trunc (insn, operands) /* Output code for INSN to compare OPERANDS. The two operands might not have the same mode: one might be within a FLOAT or FLOAT_EXTEND - expression. */ + expression. If the compare is in mode CCFPEQmode, use an opcode that + will not fault if a qNaN is present. */ char * output_float_compare (insn, operands) @@ -1679,6 +1686,8 @@ output_float_compare (insn, operands) rtx *operands; { int stack_top_dies; + rtx body = XVECEXP (PATTERN (insn), 0, 0); + int unordered_compare = GET_MODE (SET_SRC (body)) == CCFPEQmode; if (! STACK_TOP_P (operands[0])) abort (); @@ -1694,15 +1703,21 @@ output_float_compare (insn, operands) is also a stack register that dies, then this must be a `fcompp' float compare */ - output_asm_insn ("fcompp", operands); + if (unordered_compare) + output_asm_insn ("fucompp", operands); + else + output_asm_insn ("fcompp", operands); } else { static char buf[100]; - /* Decide if this is the integer or float compare opcode. */ + /* Decide if this is the integer or float compare opcode, or the + unordered float compare. */ - if (GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_FLOAT) + if (unordered_compare) + strcpy (buf, "fucom"); + else if (GET_MODE_CLASS (GET_MODE (operands[1])) == MODE_FLOAT) strcpy (buf, "fcom"); else strcpy (buf, "ficom"); @@ -1720,178 +1735,100 @@ output_float_compare (insn, operands) /* Now retrieve the condition code. */ - output_asm_insn (AS1 (fnsts%W2,%2), operands); - - cc_status.flags |= CC_IN_80387; - return "sahf"; + return output_fp_cc0_set (insn); } -#ifdef HANDLE_PRAGMA +/* Output opcodes to transfer the results of FP compare or test INSN + from the FPU to the CPU flags. If TARGET_IEEE_FP, ensure that if the + result of the compare or test is unordered, no comparison operator + succeeds except NE. Return an output template, if any. */ -/* When structure field packing is in effect, this variable is the - number of bits to use as the maximum alignment. When packing is not - in effect, this is zero. */ +char * +output_fp_cc0_set (insn) + rtx insn; +{ + rtx xops[3]; + rtx unordered_label; + rtx next; + enum rtx_code code; -int maximum_field_alignment = 0; + xops[0] = gen_rtx (REG, HImode, 0); + output_asm_insn (AS1 (fnsts%W0,%0), xops); -/* Handle a pragma directive. HANDLE_PRAGMA conspires to parse the - input following #pragma into tokens based on yylex. TOKEN is the - current token, and STRING is its printable form. */ + if (! TARGET_IEEE_FP) + return "sahf"; -void -handle_pragma_token (string, token) - char *string; - tree token; -{ - static enum pragma_state - { - ps_start, - ps_done, - ps_bad, - ps_weak, - ps_name, - ps_equals, - ps_value, - ps_pack, - ps_left, - ps_align, - ps_right - } state = ps_start, type; - static char *name; - static char *value; - static int align; + next = next_cc0_user (insn); - if (string == 0) + if (GET_CODE (next) == JUMP_INSN + && GET_CODE (PATTERN (next)) == SET + && SET_DEST (PATTERN (next)) == pc_rtx + && GET_CODE (SET_SRC (PATTERN (next))) == IF_THEN_ELSE) { - if (type == ps_pack) - { - if (state == ps_right) - maximum_field_alignment = align * 8; - else - warning ("ignoring malformed #pragma pack( [ 1 | 2 | 4 ] )"); - } -#ifdef WEAK_ASM_OP - else if (type == ps_weak) - { - if (state == ps_name || state == ps_value) - { - fprintf (asm_out_file, "\t%s\t", WEAK_ASM_OP); - ASM_OUTPUT_LABELREF (asm_out_file, name); - fputc ('\n', asm_out_file); - if (state == ps_value) - { - fprintf (asm_out_file, "\t%s\t", DEF_ASM_OP); - ASM_OUTPUT_LABELREF (asm_out_file, name); - fputc (',', asm_out_file); - ASM_OUTPUT_LABELREF (asm_out_file, value); - fputc ('\n', asm_out_file); - } - } - else if (! (state == ps_done || state == ps_start)) - warning ("ignoring malformed #pragma weak symbol [=value]"); - } -#endif /* WEAK_ASM_OP */ - - type = state = ps_start; - return; + code = GET_CODE (XEXP (SET_SRC (PATTERN (next)), 0)); } - - switch (state) + else if (GET_CODE (PATTERN (next)) == SET) { - case ps_start: - if (token && TREE_CODE (token) == IDENTIFIER_NODE) - { - if (strcmp (IDENTIFIER_POINTER (token), "pack") == 0) - type = state = ps_pack; -#ifdef WEAK_ASM_OP - else if (strcmp (IDENTIFIER_POINTER (token), "weak") == 0) - type = state = ps_weak; -#endif - else - type = state = ps_done; - } - else - type = state = ps_done; - break; - -#ifdef WEAK_ASM_OP - case ps_weak: - if (token && TREE_CODE (token) == IDENTIFIER_NODE) - { - name = IDENTIFIER_POINTER (token); - state = ps_name; - } - else - state = ps_bad; - break; + code = GET_CODE (SET_SRC (PATTERN (next))); + } + else + abort (); - case ps_name: - state = (strcmp (string, "=") ? ps_bad : ps_equals); - break; + xops[0] = gen_rtx (REG, QImode, 0); - case ps_equals: - if (token && TREE_CODE (token) == IDENTIFIER_NODE) - { - value = IDENTIFIER_POINTER (token); - state = ps_value; - } - else - state = ps_bad; - break; - - case ps_value: - state = ps_bad; + switch (code) + { + case GT: + xops[1] = GEN_INT (0x45); + output_asm_insn (AS2 (and%B0,%1,%h0), xops); + /* je label */ break; -#endif /* WEAK_ASM_OP */ - case ps_pack: - if (strcmp (string, "(") == 0) - state = ps_left; - else - state = ps_bad; + case LT: + xops[1] = GEN_INT (0x45); + xops[2] = GEN_INT (0x01); + output_asm_insn (AS2 (and%B0,%1,%h0), xops); + output_asm_insn (AS2 (cmp%B0,%2,%h0), xops); + /* je label */ break; - case ps_left: - if (token && TREE_CODE (token) == INTEGER_CST - && TREE_INT_CST_HIGH (token) == 0) - switch (TREE_INT_CST_LOW (token)) - { - case 1: - case 2: - case 4: - align = TREE_INT_CST_LOW (token); - state = ps_align; - break; - - default: - state = ps_bad; - } - else if (! token && strcmp (string, ")") == 0) - { - align = 0; - state = ps_right; - } - else - state = ps_bad; + case GE: + xops[1] = GEN_INT (0x05); + output_asm_insn (AS2 (and%B0,%1,%h0), xops); + /* je label */ break; - case ps_align: - if (strcmp (string, ")") == 0) - state = ps_right; - else - state = ps_bad; + case LE: + xops[1] = GEN_INT (0x45); + xops[2] = GEN_INT (0x40); + output_asm_insn (AS2 (and%B0,%1,%h0), xops); + output_asm_insn (AS1 (dec%B0,%h0), xops); + output_asm_insn (AS2 (cmp%B0,%2,%h0), xops); + /* jb label */ break; - case ps_right: - state = ps_bad; + case EQ: + xops[1] = GEN_INT (0x45); + xops[2] = GEN_INT (0x40); + output_asm_insn (AS2 (and%B0,%1,%h0), xops); + output_asm_insn (AS2 (cmp%B0,%2,%h0), xops); + /* je label */ break; - case ps_bad: - case ps_done: + case NE: + xops[1] = GEN_INT (0x44); + xops[2] = GEN_INT (0x40); + output_asm_insn (AS2 (and%B0,%1,%h0), xops); + output_asm_insn (AS2 (xor%B0,%2,%h0), xops); + /* jne label */ break; + case GTU: + case LTU: + case GEU: + case LEU: default: abort (); } + RET; } -#endif /* HANDLE_PRAGMA */