This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[new-regalloc] fix_truncdi_nomemory, fix_truncdi_memory.


Hello Michael, Jan.

I have successfully bootstrapped C,C++,f77,java with the following
patch.
(I have bootstrapped new regalloc with enabled pre-reload on
i586-pc-linux-gnu.)

Few months ago I have already asked about constraints from
fix_truncdi_nomemory and fix_truncdi_memory.
Problem:
(define_insn "fix_truncdi_memory"
  [(set (match_operand:DI 0 "memory_operand" "=m")
	(fix:DI (match_operand 1 "register_operand" "f")))
-----------------------------^^ No mode definition here (I know why)
   (use (match_operand:HI 2 "memory_operand" "m"))
   (use (match_operand:HI 3 "memory_operand" "m"))
   (clobber (match_scratch:DF 4 "=&1f"))]
---------------------------^^ ----^^^ '=&1' refers to operands[1]
  "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1]))
   && (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)"
  "* operands[5] = operands[4]; return output_fix_trunc (insn, operands);"
  [(set_attr "type" "fistp")])

operands[4] have a mode definition (DFmode), but operands[4] can be
equal to operands[1] which can have different mode - IMHO it's wrong.
Also I can't understand differences between '=&1f' and just '=f'
What is '=&1f':
1. =&1;
   it's operand which will be same as operands[1] and "the
   previous value is discarded and replaced" like gcc info say.
2. =&f;
   it's any register exclude register from operands[1].

So, =&1f is any discarded and replaced register exclude operands[1]
or operands[1] which will be discarded and replaced.
IMHO: =&1f equal to =f.

Am I wrong ?

Denis.


*** ./config/i386/i386.md	Thu Jun 20 10:59:16 2002
--- /hdd2/devel/gcc-new-alloc/gcc/config/i386/i386.md	Mon Aug 12 14:58:07 2002
***************
*** 4116,4122 ****
     (use (match_operand:HI 2 "memory_operand" "m,m"))
     (use (match_operand:HI 3 "memory_operand" "m,m"))
     (clobber (match_operand:DI 4 "memory_operand" "=m,m"))
!    (clobber (match_scratch:DF 5 "=&1f,&1f"))]
    "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1]))
     && (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)"
    "#"
--- 4116,4122 ----
     (use (match_operand:HI 2 "memory_operand" "m,m"))
     (use (match_operand:HI 3 "memory_operand" "m,m"))
     (clobber (match_operand:DI 4 "memory_operand" "=m,m"))
!    (clobber (match_scratch:DF 5 "=f,f"))]
    "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1]))
     && (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)"
    "#"
***************
*** 4127,4133 ****
  	(fix:DI (match_operand 1 "register_operand" "f")))
     (use (match_operand:HI 2 "memory_operand" "m"))
     (use (match_operand:HI 3 "memory_operand" "m"))
!    (clobber (match_scratch:DF 4 "=&1f"))]
    "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1]))
     && (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)"
    "* operands[5] = operands[4]; return output_fix_trunc (insn, operands);"
--- 4127,4133 ----
  	(fix:DI (match_operand 1 "register_operand" "f")))
     (use (match_operand:HI 2 "memory_operand" "m"))
     (use (match_operand:HI 3 "memory_operand" "m"))
!    (clobber (match_scratch:DF 4 "=f"))]
    "TARGET_80387 && FLOAT_MODE_P (GET_MODE (operands[1]))
     && (!SSE_FLOAT_MODE_P (GET_MODE (operands[1])) || !TARGET_64BIT)"
    "* operands[5] = operands[4]; return output_fix_trunc (insn, operands);"


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]