(*trunc*): Use scratch memory for output_fix_trunc.

From-SVN: r14569
This commit is contained in:
Stan Cox 1997-07-31 20:37:46 +00:00
parent c27d9c3bce
commit f25aca7a57

View File

@ -1,4 +1,4 @@
;; GCC machine description for Intel X86.
; GCC machine description for Intel X86.
;; Copyright (C) 1988, 1994, 1995, 1996, 1997 Free Software Foundation, Inc.
;; Mostly by William Schelter.
@ -1316,7 +1316,7 @@
if (STACK_TOP_P (operands[1]) && NON_STACK_REG_P (operands[0]))
{
output_to_reg (operands[0], stack_top_dies);
output_to_reg (operands[0], stack_top_dies, 0);
RET;
}
@ -1502,7 +1502,7 @@
if (STACK_TOP_P (operands[1]) && NON_STACK_REG_P (operands[0]))
{
output_to_reg (operands[0], stack_top_dies);
output_to_reg (operands[0], stack_top_dies, 0);
RET;
}
@ -1686,7 +1686,7 @@
if (STACK_TOP_P (operands[1]) && NON_STACK_REG_P (operands[0]))
{
output_to_reg (operands[0], stack_top_dies);
output_to_reg (operands[0], stack_top_dies, 0);
RET;
}
@ -2186,7 +2186,7 @@
if (NON_STACK_REG_P (operands[0]))
{
output_to_reg (operands[0], stack_top_dies);
output_to_reg (operands[0], stack_top_dies, 0);
RET;
}
@ -2221,7 +2221,7 @@
if (NON_STACK_REG_P (operands[0]))
{
output_to_reg (operands[0], stack_top_dies);
output_to_reg (operands[0], stack_top_dies, 0);
RET;
}
@ -2256,7 +2256,7 @@
if (NON_STACK_REG_P (operands[0]))
{
output_to_reg (operands[0], stack_top_dies);
output_to_reg (operands[0], stack_top_dies, 0);
RET;
}
@ -2332,7 +2332,7 @@
output_asm_insn (AS1 (fld,%y1), operands);
stack_top_dies = 1;
}
output_to_reg (operands[0], stack_top_dies);
output_to_reg (operands[0], stack_top_dies, 0);
RET;
}
else if (GET_CODE (operands[0]) == MEM)
@ -2365,7 +2365,7 @@
output_asm_insn (AS1 (fld,%y1), operands);
stack_top_dies = 1;
}
output_to_reg (operands[0], stack_top_dies);
output_to_reg (operands[0], stack_top_dies, 0);
RET;
}
else if (GET_CODE (operands[0]) == MEM)
@ -2407,7 +2407,7 @@
operands[3] = gen_lowpart (SImode, operands[2]);
operands[4] = gen_reg_rtx (XFmode);
operands[5] = (rtx) assign_386_stack_local (SImode, 0);
operands[6] = (rtx) assign_386_stack_local (SImode, 1);
operands[6] = (rtx) assign_386_stack_local (DImode, 1);
}")
(define_expand "fixuns_truncdfsi2"
@ -2428,7 +2428,7 @@
operands[3] = gen_lowpart (SImode, operands[2]);
operands[4] = gen_reg_rtx (DFmode);
operands[5] = (rtx) assign_386_stack_local (SImode, 0);
operands[6] = (rtx) assign_386_stack_local (SImode, 1);
operands[6] = (rtx) assign_386_stack_local (DImode, 1);
}")
(define_expand "fixuns_truncsfsi2"
@ -2449,7 +2449,7 @@
operands[3] = gen_lowpart (SImode, operands[2]);
operands[4] = gen_reg_rtx (SFmode);
operands[5] = (rtx) assign_386_stack_local (SImode, 0);
operands[6] = (rtx) assign_386_stack_local (SImode, 1);
operands[6] = (rtx) assign_386_stack_local (DImode, 1);
}")
;; Signed conversion to DImode.
@ -2469,7 +2469,7 @@
operands[1] = copy_to_mode_reg (XFmode, operands[1]);
operands[2] = gen_reg_rtx (XFmode);
operands[3] = (rtx) assign_386_stack_local (SImode, 0);
operands[4] = (rtx) assign_386_stack_local (SImode, 1);
operands[4] = (rtx) assign_386_stack_local (DImode, 1);
}")
(define_expand "fix_truncdfdi2"
@ -2487,7 +2487,7 @@
operands[1] = copy_to_mode_reg (DFmode, operands[1]);
operands[2] = gen_reg_rtx (DFmode);
operands[3] = (rtx) assign_386_stack_local (SImode, 0);
operands[4] = (rtx) assign_386_stack_local (SImode, 1);
operands[4] = (rtx) assign_386_stack_local (DImode, 1);
}")
(define_expand "fix_truncsfdi2"
@ -2505,7 +2505,7 @@
operands[1] = copy_to_mode_reg (SFmode, operands[1]);
operands[2] = gen_reg_rtx (SFmode);
operands[3] = (rtx) assign_386_stack_local (SImode, 0);
operands[4] = (rtx) assign_386_stack_local (SImode, 1);
operands[4] = (rtx) assign_386_stack_local (DImode, 1);
}")
;; These match a signed conversion of either DFmode or SFmode to DImode.
@ -2515,7 +2515,7 @@
(fix:DI (fix:XF (match_operand:XF 1 "register_operand" "f"))))
(clobber (match_dup 1))
(clobber (match_operand:SI 2 "memory_operand" "m"))
(clobber (match_operand:SI 3 "memory_operand" "m"))
(clobber (match_operand:DI 3 "memory_operand" "m"))
(clobber (match_scratch:SI 4 "=&q"))]
"TARGET_80387"
"* return output_fix_trunc (insn, operands);")
@ -2525,7 +2525,7 @@
(fix:DI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
(clobber (match_dup 1))
(clobber (match_operand:SI 2 "memory_operand" "m"))
(clobber (match_operand:SI 3 "memory_operand" "m"))
(clobber (match_operand:DI 3 "memory_operand" "m"))
(clobber (match_scratch:SI 4 "=&q"))]
"TARGET_80387"
"* return output_fix_trunc (insn, operands);")
@ -2535,7 +2535,7 @@
(fix:DI (fix:SF (match_operand:SF 1 "register_operand" "f"))))
(clobber (match_dup 1))
(clobber (match_operand:SI 2 "memory_operand" "m"))
(clobber (match_operand:SI 3 "memory_operand" "m"))
(clobber (match_operand:DI 3 "memory_operand" "m"))
(clobber (match_scratch:SI 4 "=&q"))]
"TARGET_80387"
"* return output_fix_trunc (insn, operands);")
@ -2553,7 +2553,7 @@
"
{
operands[2] = (rtx) assign_386_stack_local (SImode, 0);
operands[3] = (rtx) assign_386_stack_local (SImode, 1);
operands[3] = (rtx) assign_386_stack_local (DImode, 1);
}")
(define_expand "fix_truncdfsi2"
@ -2567,7 +2567,7 @@
"
{
operands[2] = (rtx) assign_386_stack_local (SImode, 0);
operands[3] = (rtx) assign_386_stack_local (SImode, 1);
operands[3] = (rtx) assign_386_stack_local (DImode, 1);
}")
(define_expand "fix_truncsfsi2"
@ -2581,14 +2581,14 @@
"
{
operands[2] = (rtx) assign_386_stack_local (SImode, 0);
operands[3] = (rtx) assign_386_stack_local (SImode, 1);
operands[3] = (rtx) assign_386_stack_local (DImode, 1);
}")
(define_insn ""
[(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(fix:SI (fix:XF (match_operand:XF 1 "register_operand" "f"))))
(clobber (match_operand:SI 2 "memory_operand" "m"))
(clobber (match_operand:SI 3 "memory_operand" "m"))
(clobber (match_operand:DI 3 "memory_operand" "m"))
(clobber (match_scratch:SI 4 "=&q"))]
"TARGET_80387"
"* return output_fix_trunc (insn, operands);")
@ -2597,7 +2597,7 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(fix:SI (fix:DF (match_operand:DF 1 "register_operand" "f"))))
(clobber (match_operand:SI 2 "memory_operand" "m"))
(clobber (match_operand:SI 3 "memory_operand" "m"))
(clobber (match_operand:DI 3 "memory_operand" "m"))
(clobber (match_scratch:SI 4 "=&q"))]
"TARGET_80387"
"* return output_fix_trunc (insn, operands);")
@ -2606,7 +2606,7 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=rm")
(fix:SI (fix:SF (match_operand:SF 1 "register_operand" "f"))))
(clobber (match_operand:SI 2 "memory_operand" "m"))
(clobber (match_operand:SI 3 "memory_operand" "m"))
(clobber (match_operand:DI 3 "memory_operand" "m"))
(clobber (match_scratch:SI 4 "=&q"))]
"TARGET_80387"
"* return output_fix_trunc (insn, operands);")
@ -7270,7 +7270,13 @@ byte_xor_operation:
else if (which_alternative == 3)
{
/* r <- cond ? arg1 : arg2 */
operands[5] = gen_label_rtx ();
rtx xops[3];
xops[0] = gen_label_rtx ();
xops[1] = gen_label_rtx ();
xops[2] = operands[1];
output_asm_insn (\"j%c2 %l0\", xops);
if (! rtx_equal_p (operands[0], operands[2]))
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[2]) == MEM)
{
@ -7279,9 +7285,10 @@ byte_xor_operation:
}
else
output_asm_insn (AS2 (mov%z0,%2,%0), operands);
output_asm_insn (\"jmp %l1\", xops);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
if (! rtx_equal_p (operands[0], operands[3]))
{
output_asm_insn (\"j%C1 %l5\", operands);
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[3]) == MEM)
{
output_asm_insn (AS2 (mov%z2,%3,%4), operands);
@ -7289,8 +7296,8 @@ byte_xor_operation:
}
else
output_asm_insn (AS2 (mov%z0,%3,%0), operands);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[5]));
}
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
}
RET;
}")
@ -7324,7 +7331,13 @@ byte_xor_operation:
else if (which_alternative == 3)
{
/* r <- cond ? arg1 : arg2 */
operands[5] = gen_label_rtx ();
rtx xops[3];
xops[0] = gen_label_rtx ();
xops[1] = gen_label_rtx ();
xops[2] = operands[1];
output_asm_insn (\"j%c2 %l0\", xops);
if (! rtx_equal_p (operands[0], operands[2]))
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[2]) == MEM)
{
@ -7333,9 +7346,10 @@ byte_xor_operation:
}
else
output_asm_insn (AS2 (mov%z0,%2,%0), operands);
output_asm_insn (\"jmp %l1\", xops);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
if (! rtx_equal_p (operands[0], operands[3]))
{
output_asm_insn (\"j%C1 %l5\", operands);
if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[3]) == MEM)
{
output_asm_insn (AS2 (mov%z2,%3,%4), operands);
@ -7343,8 +7357,8 @@ byte_xor_operation:
}
else
output_asm_insn (AS2 (mov%z0,%3,%0), operands);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[5]));
}
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
}
RET;
}")
@ -7358,6 +7372,16 @@ byte_xor_operation:
"TARGET_CMOVE"
"
{
int i;
for (i = 2; i <= 3; i++)
{
if ((reload_in_progress | reload_completed) == 0
&& CONSTANT_P (operands[i]))
{
operands[i] = force_const_mem (SFmode, operands[i]);
}
}
operands[4] = i386_compare_gen (i386_compare_op0, i386_compare_op1);
}")
@ -7370,6 +7394,16 @@ byte_xor_operation:
"TARGET_CMOVE"
"
{
int i;
for (i = 2; i <= 3; i++)
{
if ((reload_in_progress | reload_completed) == 0
&& CONSTANT_P (operands[i]))
{
operands[i] = force_const_mem (DFmode, operands[i]);
}
}
operands[4] = i386_compare_gen (i386_compare_op0, i386_compare_op1);
}")
@ -7382,11 +7416,21 @@ byte_xor_operation:
"TARGET_CMOVE"
"
{
int i;
for (i = 2; i <= 3; i++)
{
if ((reload_in_progress | reload_completed) == 0
&& CONSTANT_P (operands[i]))
{
operands[i] = force_const_mem (XFmode, operands[i]);
}
}
operands[4] = i386_compare_gen (i386_compare_op0, i386_compare_op1);
}")
(define_insn "movsfcc_1"
[(set (match_operand:SF 0 "general_operand" "=t,=t,f,fFm")
[(set (match_operand:SF 0 "general_operand" "=f,=f,=f,=f")
(if_then_else:SF (match_operator 1 "comparison_operator"
[(cc0) (const_int 0)])
(match_operand:SF 2 "general_operand" "0,f,f,fFm")
@ -7412,35 +7456,37 @@ byte_xor_operation:
}
else if (which_alternative == 3)
{
rtx xops[2];
/* r <- cond ? arg1 : arg2 */
operands[4] = gen_label_rtx ();
rtx xops[3];
xops[0] = gen_label_rtx ();
xops[1] = gen_label_rtx ();
xops[2] = operands[1];
output_asm_insn (\"j%f2 %l0\", xops);
if (STACK_REG_P (operands[2]) || GET_CODE (operands[2]) == MEM)
output_asm_insn (AS1 (fld%z2,%y2), operands);
else
{
xops[0] = operands[0];
xops[1] = operands[2];
output_asm_insn (singlemove_string (xops), xops);
operands[2] = XEXP (operands[2], 0);
output_asm_insn (AS1 (fld%z2,%y2), operands);
}
output_asm_insn (\"j%C1 %l4\", operands);
output_asm_insn (\"jmp %l1\", xops);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
if (STACK_REG_P (operands[3]) || GET_CODE (operands[0]) == MEM)
output_asm_insn (AS1 (fld%z3,%y3), operands);
else
{
xops[0] = operands[0];
xops[1] = operands[3];
output_asm_insn (singlemove_string (xops), xops);
operands[3] = XEXP (operands[3], 0);
output_asm_insn (AS1 (fld%z3,%y3), operands);
}
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[4]));
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
}
RET;
}")
(define_insn "movdfcc_1"
[(set (match_operand:DF 0 "general_operand" "=t,=t,f,fFm")
[(set (match_operand:DF 0 "general_operand" "=f,=f,=f,=f")
(if_then_else:DF (match_operator 1 "comparison_operator"
[(cc0) (const_int 0)])
(match_operand:DF 2 "general_operand" "0,f,f,fFm")
@ -7466,35 +7512,37 @@ byte_xor_operation:
}
else if (which_alternative == 3)
{
rtx xops[2];
/* r <- cond ? arg1 : arg2 */
operands[4] = gen_label_rtx ();
rtx xops[3];
xops[0] = gen_label_rtx ();
xops[1] = gen_label_rtx ();
xops[2] = operands[1];
output_asm_insn (\"j%f2 %l0\", xops);
if (STACK_REG_P (operands[2]) || GET_CODE (operands[2]) == MEM)
output_asm_insn (AS1 (fld%z2,%y2), operands);
else
{
xops[0] = operands[0];
xops[1] = operands[2];
output_asm_insn (singlemove_string (xops), xops);
operands[2] = XEXP (operands[2], 0);
output_asm_insn (AS1 (fld%z2,%y2), operands);
}
output_asm_insn (\"j%C1 %l4\", operands);
output_asm_insn (\"jmp %l1\", xops);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
if (STACK_REG_P (operands[3]) || GET_CODE (operands[0]) == MEM)
output_asm_insn (AS1 (fld%z3,%y3), operands);
else
{
xops[0] = operands[0];
xops[1] = operands[3];
output_asm_insn (singlemove_string (xops), xops);
operands[3] = XEXP (operands[3], 0);
output_asm_insn (AS1 (fld%z3,%y3), operands);
}
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[4]));
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
}
RET;
}")
(define_insn "movxfcc_1"
[(set (match_operand:XF 0 "register_operand" "=t,=t,f,fFm")
[(set (match_operand:XF 0 "register_operand" "=f,=f,=f,=f")
(if_then_else:XF (match_operator 1 "comparison_operator"
[(cc0) (const_int 0)])
(match_operand:XF 2 "register_operand" "0,f,f,fFm")
@ -7520,29 +7568,31 @@ byte_xor_operation:
}
else if (which_alternative == 3)
{
rtx xops[2];
/* r <- cond ? arg1 : arg2 */
operands[4] = gen_label_rtx ();
rtx xops[3];
xops[0] = gen_label_rtx ();
xops[1] = gen_label_rtx ();
xops[2] = operands[1];
output_asm_insn (\"j%f2 %l0\", xops);
if (STACK_REG_P (operands[2]) || GET_CODE (operands[2]) == MEM)
output_asm_insn (AS1 (fld%z2,%y2), operands);
else
{
xops[0] = operands[0];
xops[1] = operands[2];
output_asm_insn (singlemove_string (xops), xops);
operands[2] = XEXP (operands[2], 0);
output_asm_insn (AS1 (fld%z2,%y2), operands);
}
output_asm_insn (\"j%C1 %l4\", operands);
output_asm_insn (\"jmp %l1\", xops);
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[0]));
if (STACK_REG_P (operands[3]) || GET_CODE (operands[0]) == MEM)
output_asm_insn (AS1 (fld%z3,%y3), operands);
else
{
xops[0] = operands[0];
xops[1] = operands[3];
output_asm_insn (singlemove_string (xops), xops);
operands[3] = XEXP (operands[3], 0);
output_asm_insn (AS1 (fld%z3,%y3), operands);
}
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (operands[4]));
ASM_OUTPUT_INTERNAL_LABEL (asm_out_file, \"L\", CODE_LABEL_NUMBER (xops[1]));
}
RET;
}")