OSDN Git Service

* i386.c (function_arg): Return constm1_rtx for last argument.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Apr 2001 16:28:44 +0000 (16:28 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 5 Apr 2001 16:28:44 +0000 (16:28 +0000)
(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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@41120 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/config/i386/i386.h
gcc/config/i386/i386.md

index dba10a8..359435c 100644 (file)
@@ -1,3 +1,21 @@
+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>
 
        * i386.md: Don't allow "builtin_setjmp_receiver" for TARGET_64BIT.
index c50761c..7d08309 100644 (file)
@@ -1105,6 +1105,9 @@ function_arg (cum, mode, type, named)
     (mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode);
   int words = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
 
+  if (mode == VOIDmode)
+    return constm1_rtx;
+
   switch (mode)
     {
       /* For now, pass fp/complex values on the stack.  */
@@ -2510,7 +2513,7 @@ ix86_expand_prologue ()
 
       sym = gen_rtx_MEM (FUNCTION_MODE,
                         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)
        = gen_rtx_EXPR_LIST (VOIDmode, gen_rtx_USE (VOIDmode, arg0),
@@ -6842,7 +6845,7 @@ ix86_split_to_parts (operand, parts, mode)
              operand = change_address (operand, DImode, XEXP (operand, 0));
              parts[0] = operand;
              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)
            {
index cd9e54a..8ccf891 100644 (file)
@@ -1632,7 +1632,7 @@ typedef struct ix86_args {
 #define FUNCTION_BLOCK_PROFILER_EXIT                   \
 emit_call_insn (gen_call (gen_rtx_MEM (QImode,         \
   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
    and is not allowed to change the machine state. Saving (restoring)
index 88de477..51e0c96 100644 (file)
            (const_int 32))))
    (clobber (match_scratch:SI 3 "=a"))
    (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"
   [(set_attr "type" "imul")
    (set_attr "ppro_uops" "few")
 {
   if (operands[3] == const0_rtx)
     {
-      emit_insn (gen_call (operands[0], operands[1]));
+      emit_insn (gen_call (operands[0], operands[1], constm1_rtx));
       DONE;
     }
   /* Static functions and indirect calls don't need
 
 (define_expand "call"
   [(call (match_operand:QI 0 "" "")
-        (match_operand:SI 1 "" ""))]
+        (match_operand 2 "" ""))]
   ;; Operand 1 not used on the i386.
   ""
   "
       && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF
       && ! SYMBOL_REF_FLAG (XEXP (operands[0], 0)))
     current_function_uses_pic_offset_table = 1;
+
   if (! call_insn_operand (XEXP (operands[0], 0), Pmode))
     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"
-  [(call (mem:QI (match_operand:SI 0 "constant_call_address_operand" ""))
-        (match_operand:SI 1 "" ""))]
+  [(call (mem:QI (match_operand 0 "constant_call_address_operand" ""))
+        (match_operand 1 "" ""))]
   ""
   "*
 {
 
 (define_insn "*call_1"
   [(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 (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;
     }
   /* Static functions and indirect calls don't need
 (define_expand "call_value"
   [(set (match_operand 0 "" "")
        (call (match_operand:QI 1 "" "")
-             (match_operand:SI 2 "" "")))]
+             (match_operand:SI 3 "" "")))]
   ;; Operand 2 not used on the i386.
   ""
   "
     current_function_uses_pic_offset_table = 1;
   if (! call_insn_operand (XEXP (operands[1], 0), Pmode))
     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.
 
 (define_expand "untyped_call"
 
   emit_call_insn (TARGET_80387
                   ? gen_call_value (gen_rtx_REG (XCmode, FIRST_FLOAT_REG),
-                                   operands[0], const0_rtx)
-                  : gen_call (operands[0], const0_rtx));
+                                   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++)
     {
                   (plus:SI (match_operand:SI 1 "symbolic_operand" "")
                            (minus:SI (pc) (match_operand 2 "" ""))))] 1))
    (clobber (reg:CC 17))]
-  ""
+  "!TARGET_64BIT"
   "*
 {
   if (GET_CODE (operands[2]) == LABEL_REF)
   [(set (match_operand 0 "" "")
        (call (mem:QI (match_operand:SI 1 "constant_call_address_operand" ""))
              (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))
   [(set (match_operand 0 "" "")
        (call (mem:QI (match_operand:SI 1 "call_insn_operand" "rsm"))
              (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))