Commit 32ee7d1d by Jan Hubicka Committed by Jan Hubicka

i386.c (function_arg): Return constm1_rtx for last argument.


	* i386.c (function_arg): Return constm1_rtx for last argument.
	(ix86_expand_prologue): Update gen_call calls.
	* i386.h (FUNCTION_BLOCK_PROFILER_EXIT): Likewise.
	* i386.md (call_pop): Likewise.
	(call): Second operand is VOIDmode.
	(call_0): Likewise; Support 64bits.
	(call_exp): New expander.
	(call_1): Get to the sync.
	(call_1_exp): New pattern.
	(call_value): Support 64bit.
	(call_value_exp): New pattern.
	(untyped_call): Update gen_call call.
	(call_value_pop): Disable for 64bit.
	(call_value_0_rex64): New pattern.
	(call_value_1_rex64): Likewise.

From-SVN: r41120
parent 60e589ef
Thu Apr 5 18:25:56 CEST 2001 Jan Hubicka <jh@suse.cz>
* i386.c (function_arg): Return constm1_rtx for last argument.
(ix86_expand_prologue): Update gen_call calls.
* i386.h (FUNCTION_BLOCK_PROFILER_EXIT): Likewise.
* i386.md (call_pop): Likewise.
(call): Second operand is VOIDmode.
(call_0): Likewise; Support 64bits.
(call_exp): New expander.
(call_1): Get to the sync.
(call_1_exp): New pattern.
(call_value): Support 64bit.
(call_value_exp): New pattern.
(untyped_call): Update gen_call call.
(call_value_pop): Disable for 64bit.
(call_value_0_rex64): New pattern.
(call_value_1_rex64): Likewise.
2001-04-05 Bo Thorsen <bo@suse.de> 2001-04-05 Bo Thorsen <bo@suse.de>
* i386.md: Don't allow "builtin_setjmp_receiver" for TARGET_64BIT. * i386.md: Don't allow "builtin_setjmp_receiver" for TARGET_64BIT.
......
...@@ -1105,6 +1105,9 @@ function_arg (cum, mode, type, named) ...@@ -1105,6 +1105,9 @@ function_arg (cum, mode, type, named)
(mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode); (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode);
int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD; int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
if (mode == VOIDmode)
return constm1_rtx;
switch (mode) switch (mode)
{ {
/* For now, pass fp/complex values on the stack. */ /* For now, pass fp/complex values on the stack. */
...@@ -2510,7 +2513,7 @@ ix86_expand_prologue () ...@@ -2510,7 +2513,7 @@ ix86_expand_prologue ()
sym = gen_rtx_MEM (FUNCTION_MODE, sym = gen_rtx_MEM (FUNCTION_MODE,
gen_rtx_SYMBOL_REF (Pmode, "_alloca")); gen_rtx_SYMBOL_REF (Pmode, "_alloca"));
insn = emit_call_insn (gen_call (sym, const0_rtx)); insn = emit_call_insn (gen_call (sym, const0_rtx, constm1_rtx));
CALL_INSN_FUNCTION_USAGE (insn) CALL_INSN_FUNCTION_USAGE (insn)
= gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, arg0), = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, arg0),
...@@ -6842,7 +6845,7 @@ ix86_split_to_parts (operand, parts, mode) ...@@ -6842,7 +6845,7 @@ ix86_split_to_parts (operand, parts, mode)
operand = change_address (operand, DImode, XEXP (operand, 0)); operand = change_address (operand, DImode, XEXP (operand, 0));
parts[0] = operand; parts[0] = operand;
parts[1] = adj_offsettable_operand (operand, 8); parts[1] = adj_offsettable_operand (operand, 8);
parts[1] = change_address (parts[1], SImode, XEXP (operand, 0)); parts[1] = change_address (parts[1], SImode, XEXP (parts[1], 0));
} }
else if (GET_CODE (operand) == CONST_DOUBLE) else if (GET_CODE (operand) == CONST_DOUBLE)
{ {
......
...@@ -1632,7 +1632,7 @@ typedef struct ix86_args { ...@@ -1632,7 +1632,7 @@ typedef struct ix86_args {
#define FUNCTION_BLOCK_PROFILER_EXIT \ #define FUNCTION_BLOCK_PROFILER_EXIT \
emit_call_insn (gen_call (gen_rtx_MEM (QImode, \ emit_call_insn (gen_call (gen_rtx_MEM (QImode, \
gen_rtx_SYMBOL_REF (VOIDmode, "__bb_trace_ret")), \ gen_rtx_SYMBOL_REF (VOIDmode, "__bb_trace_ret")), \
const0_rtx)) const0_rtx, constm1_rtx))
/* The function `__bb_trace_func' is called in every basic block /* The function `__bb_trace_func' is called in every basic block
and is not allowed to change the machine state. Saving (restoring) and is not allowed to change the machine state. Saving (restoring)
......
...@@ -7232,7 +7232,25 @@ ...@@ -7232,7 +7232,25 @@
(const_int 32)))) (const_int 32))))
(clobber (match_scratch:SI 3 "=a")) (clobber (match_scratch:SI 3 "=a"))
(clobber (reg:CC 17))] (clobber (reg:CC 17))]
"!TARGET_64BIT" ""
"mul{l}\\t%2"
[(set_attr "type" "imul")
(set_attr "ppro_uops" "few")
(set_attr "length_immediate" "0")
(set_attr "mode" "SI")])
(define_insn "*umulsi3_highpart_zext"
[(set (match_operand:DI 0 "register_operand" "=d")
(zero_extend:DI (truncate:SI
(lshiftrt:DI
(mult:DI (zero_extend:DI
(match_operand:SI 1 "register_operand" "%a"))
(zero_extend:DI
(match_operand:SI 2 "nonimmediate_operand" "rm")))
(const_int 32)))))
(clobber (match_scratch:SI 3 "=a"))
(clobber (reg:CC 17))]
"TARGET_64BIT"
"mul{l}\\t%2" "mul{l}\\t%2"
[(set_attr "type" "imul") [(set_attr "type" "imul")
(set_attr "ppro_uops" "few") (set_attr "ppro_uops" "few")
...@@ -12716,7 +12734,7 @@ ...@@ -12716,7 +12734,7 @@
{ {
if (operands[3] == const0_rtx) if (operands[3] == const0_rtx)
{ {
emit_insn (gen_call (operands[0], operands[1])); emit_insn (gen_call (operands[0], operands[1], constm1_rtx));
DONE; DONE;
} }
/* Static functions and indirect calls don't need /* Static functions and indirect calls don't need
...@@ -12770,7 +12788,7 @@ ...@@ -12770,7 +12788,7 @@
(define_expand "call" (define_expand "call"
[(call (match_operand:QI 0 "" "") [(call (match_operand:QI 0 "" "")
(match_operand:SI 1 "" ""))] (match_operand 2 "" ""))]
;; Operand 1 not used on the i386. ;; Operand 1 not used on the i386.
"" ""
" "
...@@ -12781,13 +12799,29 @@ ...@@ -12781,13 +12799,29 @@
&& GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF
&& ! SYMBOL_REF_FLAG (XEXP (operands[0], 0))) && ! SYMBOL_REF_FLAG (XEXP (operands[0], 0)))
current_function_uses_pic_offset_table = 1; current_function_uses_pic_offset_table = 1;
if (! call_insn_operand (XEXP (operands[0], 0), Pmode)) if (! call_insn_operand (XEXP (operands[0], 0), Pmode))
XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, XEXP (operands[0], 0)); XEXP (operands[0], 0) = copy_to_mode_reg (Pmode, XEXP (operands[0], 0));
if (TARGET_64BIT && INTVAL (operands[2]) >= 0)
{
rtx insn;
rtx reg = gen_rtx_REG (QImode, 0);
emit_move_insn (reg, operands[2]);
insn = emit_call_insn (gen_call_exp (operands[0], operands[2]));
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), reg);
DONE;
}
}") }")
(define_expand "call_exp"
[(call (match_operand:QI 0 "" "")
(match_operand 1 "" ""))]
""
"")
(define_insn "*call_0" (define_insn "*call_0"
[(call (mem:QI (match_operand:SI 0 "constant_call_address_operand" "")) [(call (mem:QI (match_operand 0 "constant_call_address_operand" ""))
(match_operand:SI 1 "" ""))] (match_operand 1 "" ""))]
"" ""
"* "*
{ {
...@@ -12800,8 +12834,28 @@ ...@@ -12800,8 +12834,28 @@
(define_insn "*call_1" (define_insn "*call_1"
[(call (mem:QI (match_operand:SI 0 "call_insn_operand" "rsm")) [(call (mem:QI (match_operand:SI 0 "call_insn_operand" "rsm"))
(match_operand:SI 1 "" ""))] (match_operand 1 "" ""))]
"" "TARGET_64BIT"
"*
{
if (constant_call_address_operand (operands[0], QImode))
{
if (SIBLING_CALL_P (insn))
return \"jmp\\t%P0\";
else
return \"call\\t%P0\";
}
if (SIBLING_CALL_P (insn))
return \"jmp\\t%A0\";
else
return \"call\\t%A0\";
}"
[(set_attr "type" "call")])
(define_insn "*call_1_rex64"
[(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rsm"))
(match_operand 1 "" ""))]
"!TARGET_64BIT"
"* "*
{ {
if (constant_call_address_operand (operands[0], QImode)) if (constant_call_address_operand (operands[0], QImode))
...@@ -12833,7 +12887,8 @@ ...@@ -12833,7 +12887,8 @@
{ {
if (operands[4] == const0_rtx) if (operands[4] == const0_rtx)
{ {
emit_insn (gen_call_value (operands[0], operands[1], operands[2])); emit_insn (gen_call_value (operands[0], operands[1], operands[2],
constm1_rtx));
DONE; DONE;
} }
/* Static functions and indirect calls don't need /* Static functions and indirect calls don't need
...@@ -12849,7 +12904,7 @@ ...@@ -12849,7 +12904,7 @@
(define_expand "call_value" (define_expand "call_value"
[(set (match_operand 0 "" "") [(set (match_operand 0 "" "")
(call (match_operand:QI 1 "" "") (call (match_operand:QI 1 "" "")
(match_operand:SI 2 "" "")))] (match_operand:SI 3 "" "")))]
;; Operand 2 not used on the i386. ;; Operand 2 not used on the i386.
"" ""
" "
...@@ -12862,8 +12917,25 @@ ...@@ -12862,8 +12917,25 @@
current_function_uses_pic_offset_table = 1; current_function_uses_pic_offset_table = 1;
if (! call_insn_operand (XEXP (operands[1], 0), Pmode)) if (! call_insn_operand (XEXP (operands[1], 0), Pmode))
XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, XEXP (operands[1], 0)); XEXP (operands[1], 0) = copy_to_mode_reg (Pmode, XEXP (operands[1], 0));
if (TARGET_64BIT && INTVAL (operands[3]) >= 0)
{
rtx insn;
rtx reg = gen_rtx_REG (QImode, 0);
emit_move_insn (reg, operands[3]);
insn = emit_call_insn (gen_call_value_exp (operands[0], operands[1],
operands[3]));
use_reg (&CALL_INSN_FUNCTION_USAGE (insn), reg);
DONE;
}
}") }")
(define_expand "call_value_exp"
[(set (match_operand 0 "" "")
(call (match_operand:QI 1 "" "")
(match_operand:SI 2 "" "")))]
""
"")
;; Call subroutine returning any type. ;; Call subroutine returning any type.
(define_expand "untyped_call" (define_expand "untyped_call"
...@@ -12883,8 +12955,10 @@ ...@@ -12883,8 +12955,10 @@
emit_call_insn (TARGET_80387 emit_call_insn (TARGET_80387
? gen_call_value (gen_rtx_REG (XCmode, FIRST_FLOAT_REG), ? gen_call_value (gen_rtx_REG (XCmode, FIRST_FLOAT_REG),
operands[0], const0_rtx) operands[0], const0_rtx,
: gen_call (operands[0], const0_rtx)); GEN_INT (SSE_REGPARM_MAX - 1))
: gen_call (operands[0], const0_rtx,
GEN_INT (SSE_REGPARM_MAX - 1)));
for (i = 0; i < XVECLEN (operands[2], 0); i++) for (i = 0; i < XVECLEN (operands[2], 0); i++)
{ {
...@@ -12975,7 +13049,7 @@ ...@@ -12975,7 +13049,7 @@
(plus:SI (match_operand:SI 1 "symbolic_operand" "") (plus:SI (match_operand:SI 1 "symbolic_operand" "")
(minus:SI (pc) (match_operand 2 "" ""))))] 1)) (minus:SI (pc) (match_operand 2 "" ""))))] 1))
(clobber (reg:CC 17))] (clobber (reg:CC 17))]
"" "!TARGET_64BIT"
"* "*
{ {
if (GET_CODE (operands[2]) == LABEL_REF) if (GET_CODE (operands[2]) == LABEL_REF)
...@@ -16751,7 +16825,21 @@ ...@@ -16751,7 +16825,21 @@
[(set (match_operand 0 "" "") [(set (match_operand 0 "" "")
(call (mem:QI (match_operand:SI 1 "constant_call_address_operand" "")) (call (mem:QI (match_operand:SI 1 "constant_call_address_operand" ""))
(match_operand:SI 2 "" "")))] (match_operand:SI 2 "" "")))]
"" "!TARGET_64BIT"
"*
{
if (SIBLING_CALL_P (insn))
return \"jmp\\t%P1\";
else
return \"call\\t%P1\";
}"
[(set_attr "type" "callv")])
(define_insn "*call_value_0_rex64"
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:DI 1 "constant_call_address_operand" ""))
(match_operand:DI 2 "const_int_operand" "")))]
"TARGET_64BIT"
"* "*
{ {
if (SIBLING_CALL_P (insn)) if (SIBLING_CALL_P (insn))
...@@ -16765,7 +16853,28 @@ ...@@ -16765,7 +16853,28 @@
[(set (match_operand 0 "" "") [(set (match_operand 0 "" "")
(call (mem:QI (match_operand:SI 1 "call_insn_operand" "rsm")) (call (mem:QI (match_operand:SI 1 "call_insn_operand" "rsm"))
(match_operand:SI 2 "" "")))] (match_operand:SI 2 "" "")))]
"" "!TARGET_64BIT"
"*
{
if (constant_call_address_operand (operands[1], QImode))
{
if (SIBLING_CALL_P (insn))
return \"jmp\\t%P1\";
else
return \"call\\t%P1\";
}
if (SIBLING_CALL_P (insn))
return \"jmp\\t%*%1\";
else
return \"call\\t%*%1\";
}"
[(set_attr "type" "callv")])
(define_insn "*call_value_1_rex64"
[(set (match_operand 0 "" "")
(call (mem:QI (match_operand:DI 1 "call_insn_operand" "rsm"))
(match_operand:DI 2 "" "")))]
"TARGET_64BIT"
"* "*
{ {
if (constant_call_address_operand (operands[1], QImode)) if (constant_call_address_operand (operands[1], QImode))
......
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