diff options
author | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-21 13:28:26 +0000 |
---|---|---|
committer | hubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-12-21 13:28:26 +0000 |
commit | 199169a26374c040030691e4d08721a5b1cbd31e (patch) | |
tree | d5bde29db18ca4850d6b93694db130e4e61f45fc /gcc/config/i386/i386.md | |
parent | a27deefcd39cbd5a967fb75ae06e6120236af3d6 (diff) | |
download | gcc-199169a26374c040030691e4d08721a5b1cbd31e.tar.gz |
* i376.md (UNSPEC_MS_TO_SYSV_CALL): New constant.
(call_1_rex64_ms_sysv, call_value_0_rex64_ms_sysv,
call_value_1_rex64_ms_sysv): New patterns.
* i386.c (function_arg_ms_64): Pass magical value of -2 as callarg.
(ix86_expand_call): Emit extra clobbers for ms->sysv ABI calls.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@142859 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/i386/i386.md')
-rw-r--r-- | gcc/config/i386/i386.md | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md index 068738d2296..c7223899b4b 100644 --- a/gcc/config/i386/i386.md +++ b/gcc/config/i386/i386.md @@ -105,6 +105,7 @@ (UNSPEC_LFENCE 45) (UNSPEC_PSADBW 46) (UNSPEC_LDDQU 47) + (UNSPEC_MS_TO_SYSV_CALL 48) ; Generic math support (UNSPEC_COPYSIGN 50) @@ -15039,6 +15040,20 @@ } [(set_attr "type" "call")]) +(define_insn "*call_1_rex64_ms_sysv" + [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rsm")) + (match_operand 1 "" "")) + (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL) + (clobber (reg:DI SI_REG)) + (clobber (reg:DI DI_REG))] + "!SIBLING_CALL_P (insn) && TARGET_64BIT" +{ + if (constant_call_address_operand (operands[0], Pmode)) + return "call\t%P0"; + return "call\t%A0"; +} + [(set_attr "type" "call")]) + (define_insn "*call_1_rex64_large" [(call (mem:QI (match_operand:DI 0 "call_insn_operand" "rm")) (match_operand 1 "" ""))] @@ -21361,6 +21376,22 @@ } [(set_attr "type" "callv")]) +(define_insn "*call_value_0_rex64_ms_sysv" + [(set (match_operand 0 "" "") + (call (mem:QI (match_operand:DI 1 "constant_call_address_operand" "")) + (match_operand:DI 2 "const_int_operand" ""))) + (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL) + (clobber (reg:DI SI_REG)) + (clobber (reg:DI DI_REG))] + "!SIBLING_CALL_P (insn) && TARGET_64BIT" +{ + if (SIBLING_CALL_P (insn)) + return "jmp\t%P1"; + else + return "call\t%P1"; +} + [(set_attr "type" "callv")]) + (define_insn "*call_value_1" [(set (match_operand 0 "" "") (call (mem:QI (match_operand:SI 1 "call_insn_operand" "rsm")) @@ -21398,6 +21429,21 @@ } [(set_attr "type" "callv")]) +(define_insn "*call_value_1_rex64_ms_sysv" + [(set (match_operand 0 "" "") + (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rsm")) + (match_operand:DI 2 "" ""))) + (unspec [(const_int 0)] UNSPEC_MS_TO_SYSV_CALL) + (clobber (reg:DI SI_REG)) + (clobber (reg:DI DI_REG))] + "!SIBLING_CALL_P (insn) && TARGET_64BIT" +{ + if (constant_call_address_operand (operands[1], Pmode)) + return "call\t%P1"; + return "call\t%A1"; +} + [(set_attr "type" "callv")]) + (define_insn "*call_value_1_rex64_large" [(set (match_operand 0 "" "") (call (mem:QI (match_operand:DI 1 "call_insn_operand" "rm")) |