Commit 8ee41eaf by Richard Henderson Committed by Richard Henderson

i386.md: Use define_constants for unspec numbers.

        * config/i386/i386.md: Use define_constants for unspec numbers.
        * config/i386/i386.c: Likewise.

From-SVN: r53448
parent 3b7dcffa
2002-05-14 Richard Henderson <rth@redhat.com>
* config/i386/i386.md: Use define_constants for unspec numbers.
* config/i386/i386.c: Likewise.
2002-05-13 Mark Mitchell <mark@codesourcery.com> 2002-05-13 Mark Mitchell <mark@codesourcery.com>
* fixinc/inclhack.def (winidss_valist): Limit applicability. * fixinc/inclhack.def (winidss_valist): Limit applicability.
......
...@@ -2885,9 +2885,9 @@ symbolic_operand (op, mode) ...@@ -2885,9 +2885,9 @@ symbolic_operand (op, mode)
if (GET_CODE (op) == SYMBOL_REF if (GET_CODE (op) == SYMBOL_REF
|| GET_CODE (op) == LABEL_REF || GET_CODE (op) == LABEL_REF
|| (GET_CODE (op) == UNSPEC || (GET_CODE (op) == UNSPEC
&& (XINT (op, 1) == 6 && (XINT (op, 1) == UNSPEC_GOT
|| XINT (op, 1) == 7 || XINT (op, 1) == UNSPEC_GOTOFF
|| XINT (op, 1) == 15))) || XINT (op, 1) == UNSPEC_GOTPCREL)))
return 1; return 1;
if (GET_CODE (op) != PLUS if (GET_CODE (op) != PLUS
|| GET_CODE (XEXP (op, 1)) != CONST_INT) || GET_CODE (XEXP (op, 1)) != CONST_INT)
...@@ -2899,7 +2899,7 @@ symbolic_operand (op, mode) ...@@ -2899,7 +2899,7 @@ symbolic_operand (op, mode)
return 1; return 1;
/* Only @GOTOFF gets offsets. */ /* Only @GOTOFF gets offsets. */
if (GET_CODE (op) != UNSPEC if (GET_CODE (op) != UNSPEC
|| XINT (op, 1) != 7) || XINT (op, 1) != UNSPEC_GOTOFF)
return 0; return 0;
op = XVECEXP (op, 0, 0); op = XVECEXP (op, 0, 0);
...@@ -3649,8 +3649,7 @@ x86_64_sign_extended_value (value) ...@@ -3649,8 +3649,7 @@ x86_64_sign_extended_value (value)
cases. */ cases. */
case CONST: case CONST:
if (GET_CODE (XEXP (value, 0)) == UNSPEC if (GET_CODE (XEXP (value, 0)) == UNSPEC
&& XVECLEN (XEXP (value, 0), 0) == 1 && XINT (XEXP (value, 0), 1) == UNSPEC_GOTPCREL)
&& XINT (XEXP (value, 0), 1) == 15)
return 1; return 1;
else if (GET_CODE (XEXP (value, 0)) == PLUS) else if (GET_CODE (XEXP (value, 0)) == PLUS)
{ {
...@@ -4629,8 +4628,7 @@ ix86_find_base_term (x) ...@@ -4629,8 +4628,7 @@ ix86_find_base_term (x)
|| GET_CODE (XEXP (term, 1)) == CONST_DOUBLE)) || GET_CODE (XEXP (term, 1)) == CONST_DOUBLE))
term = XEXP (term, 0); term = XEXP (term, 0);
if (GET_CODE (term) != UNSPEC if (GET_CODE (term) != UNSPEC
|| XVECLEN (term, 0) != 1 || XINT (term, 1) != UNSPEC_GOTPCREL)
|| XINT (term, 1) != 15)
return x; return x;
term = XVECEXP (term, 0, 0); term = XVECEXP (term, 0, 0);
...@@ -4653,8 +4651,7 @@ ix86_find_base_term (x) ...@@ -4653,8 +4651,7 @@ ix86_find_base_term (x)
term = XEXP (term, 0); term = XEXP (term, 0);
if (GET_CODE (term) != UNSPEC if (GET_CODE (term) != UNSPEC
|| XVECLEN (term, 0) != 1 || XINT (term, 1) != UNSPEC_GOTOFF)
|| XINT (term, 1) != 7)
return x; return x;
term = XVECEXP (term, 0, 0); term = XVECEXP (term, 0, 0);
...@@ -4699,8 +4696,7 @@ legitimate_pic_address_disp_p (disp) ...@@ -4699,8 +4696,7 @@ legitimate_pic_address_disp_p (disp)
/* We are unsafe to allow PLUS expressions. This limit allowed distance /* We are unsafe to allow PLUS expressions. This limit allowed distance
of GOT tables. We should not need these anyway. */ of GOT tables. We should not need these anyway. */
if (GET_CODE (disp) != UNSPEC if (GET_CODE (disp) != UNSPEC
|| XVECLEN (disp, 0) != 1 || XINT (disp, 1) != UNSPEC_GOTPCREL)
|| XINT (disp, 1) != 15)
return 0; return 0;
if (GET_CODE (XVECEXP (disp, 0, 0)) != SYMBOL_REF if (GET_CODE (XVECEXP (disp, 0, 0)) != SYMBOL_REF
...@@ -4716,17 +4712,15 @@ legitimate_pic_address_disp_p (disp) ...@@ -4716,17 +4712,15 @@ legitimate_pic_address_disp_p (disp)
disp = XEXP (disp, 0); disp = XEXP (disp, 0);
} }
if (GET_CODE (disp) != UNSPEC if (GET_CODE (disp) != UNSPEC)
|| XVECLEN (disp, 0) != 1)
return 0; return 0;
/* Must be @GOT or @GOTOFF. */ /* Must be @GOT or @GOTOFF. */
switch (XINT (disp, 1)) switch (XINT (disp, 1))
{ {
case 6: /* @GOT */ case UNSPEC_GOT:
return GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF; return GET_CODE (XVECEXP (disp, 0, 0)) == SYMBOL_REF;
case UNSPEC_GOTOFF:
case 7: /* @GOTOFF */
return local_symbolic_operand (XVECEXP (disp, 0, 0), Pmode); return local_symbolic_operand (XVECEXP (disp, 0, 0), Pmode);
} }
...@@ -4998,7 +4992,7 @@ legitimize_pic_address (orig, reg) ...@@ -4998,7 +4992,7 @@ legitimize_pic_address (orig, reg)
base address (@GOTOFF). */ base address (@GOTOFF). */
current_function_uses_pic_offset_table = 1; current_function_uses_pic_offset_table = 1;
new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 7); new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTOFF);
new = gen_rtx_CONST (Pmode, new); new = gen_rtx_CONST (Pmode, new);
new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
...@@ -5014,7 +5008,7 @@ legitimize_pic_address (orig, reg) ...@@ -5014,7 +5008,7 @@ legitimize_pic_address (orig, reg)
if (TARGET_64BIT) if (TARGET_64BIT)
{ {
current_function_uses_pic_offset_table = 1; current_function_uses_pic_offset_table = 1;
new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 15); new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOTPCREL);
new = gen_rtx_CONST (Pmode, new); new = gen_rtx_CONST (Pmode, new);
new = gen_rtx_MEM (Pmode, new); new = gen_rtx_MEM (Pmode, new);
RTX_UNCHANGING_P (new) = 1; RTX_UNCHANGING_P (new) = 1;
...@@ -5034,7 +5028,7 @@ legitimize_pic_address (orig, reg) ...@@ -5034,7 +5028,7 @@ legitimize_pic_address (orig, reg)
Global Offset Table (@GOT). */ Global Offset Table (@GOT). */
current_function_uses_pic_offset_table = 1; current_function_uses_pic_offset_table = 1;
new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), 6); new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, addr), UNSPEC_GOT);
new = gen_rtx_CONST (Pmode, new); new = gen_rtx_CONST (Pmode, new);
new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
new = gen_rtx_MEM (Pmode, new); new = gen_rtx_MEM (Pmode, new);
...@@ -5075,7 +5069,8 @@ legitimize_pic_address (orig, reg) ...@@ -5075,7 +5069,8 @@ legitimize_pic_address (orig, reg)
if (!TARGET_64BIT) if (!TARGET_64BIT)
{ {
current_function_uses_pic_offset_table = 1; current_function_uses_pic_offset_table = 1;
new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op0), 7); new = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, op0),
UNSPEC_GOTOFF);
new = gen_rtx_PLUS (Pmode, new, op1); new = gen_rtx_PLUS (Pmode, new, op1);
new = gen_rtx_CONST (Pmode, new); new = gen_rtx_CONST (Pmode, new);
new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new); new = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, new);
...@@ -5394,16 +5389,16 @@ output_pic_addr_const (file, x, code) ...@@ -5394,16 +5389,16 @@ output_pic_addr_const (file, x, code)
output_pic_addr_const (file, XVECEXP (x, 0, 0), code); output_pic_addr_const (file, XVECEXP (x, 0, 0), code);
switch (XINT (x, 1)) switch (XINT (x, 1))
{ {
case 6: case UNSPEC_GOT:
fputs ("@GOT", file); fputs ("@GOT", file);
break; break;
case 7: case UNSPEC_GOTOFF:
fputs ("@GOTOFF", file); fputs ("@GOTOFF", file);
break; break;
case 8: case UNSPEC_PLT:
fputs ("@PLT", file); fputs ("@PLT", file);
break; break;
case 15: case UNSPEC_GOTPCREL:
fputs ("@GOTPCREL(%RIP)", file); fputs ("@GOTPCREL(%RIP)", file);
break; break;
default: default:
...@@ -5456,7 +5451,7 @@ i386_simplify_dwarf_addr (orig_x) ...@@ -5456,7 +5451,7 @@ i386_simplify_dwarf_addr (orig_x)
{ {
if (GET_CODE (x) != CONST if (GET_CODE (x) != CONST
|| GET_CODE (XEXP (x, 0)) != UNSPEC || GET_CODE (XEXP (x, 0)) != UNSPEC
|| XINT (XEXP (x, 0), 1) != 15 || XINT (XEXP (x, 0), 1) != UNSPEC_GOTPCREL
|| GET_CODE (orig_x) != MEM) || GET_CODE (orig_x) != MEM)
return orig_x; return orig_x;
return XVECEXP (XEXP (x, 0), 0, 0); return XVECEXP (XEXP (x, 0), 0, 0);
...@@ -5492,8 +5487,8 @@ i386_simplify_dwarf_addr (orig_x) ...@@ -5492,8 +5487,8 @@ i386_simplify_dwarf_addr (orig_x)
x = XEXP (XEXP (x, 1), 0); x = XEXP (XEXP (x, 1), 0);
if (GET_CODE (x) == UNSPEC if (GET_CODE (x) == UNSPEC
&& ((XINT (x, 1) == 6 && GET_CODE (orig_x) == MEM) && ((XINT (x, 1) == UNSPEC_GOT && GET_CODE (orig_x) == MEM)
|| (XINT (x, 1) == 7 && GET_CODE (orig_x) != MEM))) || (XINT (x, 1) == UNSPEC_GOTOFF && GET_CODE (orig_x) != MEM)))
{ {
if (y) if (y)
return gen_rtx_PLUS (Pmode, y, XVECEXP (x, 0, 0)); return gen_rtx_PLUS (Pmode, y, XVECEXP (x, 0, 0));
...@@ -5503,8 +5498,9 @@ i386_simplify_dwarf_addr (orig_x) ...@@ -5503,8 +5498,9 @@ i386_simplify_dwarf_addr (orig_x)
if (GET_CODE (x) == PLUS if (GET_CODE (x) == PLUS
&& GET_CODE (XEXP (x, 0)) == UNSPEC && GET_CODE (XEXP (x, 0)) == UNSPEC
&& GET_CODE (XEXP (x, 1)) == CONST_INT && GET_CODE (XEXP (x, 1)) == CONST_INT
&& ((XINT (XEXP (x, 0), 1) == 6 && GET_CODE (orig_x) == MEM) && ((XINT (XEXP (x, 0), 1) == UNSPEC_GOT && GET_CODE (orig_x) == MEM)
|| (XINT (XEXP (x, 0), 1) == 7 && GET_CODE (orig_x) != MEM))) || (XINT (XEXP (x, 0), 1) == UNSPEC_GOTOFF
&& GET_CODE (orig_x) != MEM)))
{ {
x = gen_rtx_PLUS (VOIDmode, XVECEXP (XEXP (x, 0), 0, 0), XEXP (x, 1)); x = gen_rtx_PLUS (VOIDmode, XVECEXP (XEXP (x, 0), 0, 0), XEXP (x, 1));
if (y) if (y)
...@@ -7492,7 +7488,7 @@ ix86_expand_fp_compare (code, op0, op1, scratch, second_test, bypass_test) ...@@ -7492,7 +7488,7 @@ ix86_expand_fp_compare (code, op0, op1, scratch, second_test, bypass_test)
else else
{ {
tmp = gen_rtx_COMPARE (fpcmp_mode, op0, op1); tmp = gen_rtx_COMPARE (fpcmp_mode, op0, op1);
tmp2 = gen_rtx_UNSPEC (HImode, gen_rtvec (1, tmp), 9); tmp2 = gen_rtx_UNSPEC (HImode, gen_rtvec (1, tmp), UNSPEC_FNSTSW);
if (!scratch) if (!scratch)
scratch = gen_reg_rtx (HImode); scratch = gen_reg_rtx (HImode);
emit_insn (gen_rtx_SET (VOIDmode, scratch, tmp2)); emit_insn (gen_rtx_SET (VOIDmode, scratch, tmp2));
...@@ -7515,7 +7511,7 @@ ix86_expand_fp_compare (code, op0, op1, scratch, second_test, bypass_test) ...@@ -7515,7 +7511,7 @@ ix86_expand_fp_compare (code, op0, op1, scratch, second_test, bypass_test)
{ {
/* Sadness wrt reg-stack pops killing fpsr -- gotta get fnstsw first. */ /* Sadness wrt reg-stack pops killing fpsr -- gotta get fnstsw first. */
tmp = gen_rtx_COMPARE (fpcmp_mode, op0, op1); tmp = gen_rtx_COMPARE (fpcmp_mode, op0, op1);
tmp2 = gen_rtx_UNSPEC (HImode, gen_rtvec (1, tmp), 9); tmp2 = gen_rtx_UNSPEC (HImode, gen_rtvec (1, tmp), UNSPEC_FNSTSW);
if (!scratch) if (!scratch)
scratch = gen_reg_rtx (HImode); scratch = gen_reg_rtx (HImode);
emit_insn (gen_rtx_SET (VOIDmode, scratch, tmp2)); emit_insn (gen_rtx_SET (VOIDmode, scratch, tmp2));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment