Committed, MMIX: truncdfsf2 operator goof. i386, ia64 goof on fix_truncdfdi2, fixuns_truncdfdi2?

Hans-Peter Nilsson hp@bitrange.com
Sun Mar 17 05:09:00 GMT 2002


This operator bug was responsible for gcc.c-torture/execute/gofast.c
and gcc.c-torture/execute/ieee/20010114-2.c execution failures
at -O3.  Will commit to 3.1-branch too.

While checking on the floating point operations and comparing
with the manual and other targets, it seems several targets
(including but not limited to i386 and ia64) have fix_truncMN2
patterns that are incorrectly expressed.  For example for M=df
N=di, the input operand should be (fix:DI (fix:DF (DF-operand))
not just (fix:DI (DF-operand)), since the latter expression
requires/promises that the operand is already truncated to an
integer in a float-mode, which is the input operand for the
fixdfdi2 pattern.  Similarly for fixuns_truncMN2.  I'll open a
PR about this to try and keep it from being forgotten.

	* config/mmix/mmix.md ("truncdfsf2"): Correct operator is
	float_truncate, not fix.
	("*truncdfsf2_real"): Ditto.
	("*nonlocal_goto_receiver_expanded"): Fix output template formatting.

Index: mmix.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/mmix/mmix.md,v
retrieving revision 1.8
diff -p -c -r1.8 mmix.md
*** mmix.md	2002/02/06 05:13:12	1.8
--- mmix.md	2002/03/17 02:13:22
*************** DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\
*** 582,588 ****
  ;; FIXME: Perhaps with SECONDARY_MEMORY_NEEDED?
  (define_expand "truncdfsf2"
    [(set (match_operand:SF 0 "memory_operand" "")
! 	(fix:SF (match_operand:DF 1 "register_operand" "")))]
    ""
    "
  {
--- 582,588 ----
  ;; FIXME: Perhaps with SECONDARY_MEMORY_NEEDED?
  (define_expand "truncdfsf2"
    [(set (match_operand:SF 0 "memory_operand" "")
! 	(float_truncate:SF (match_operand:DF 1 "register_operand" "")))]
    ""
    "
  {
*************** DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\
*** 610,616 ****

  (define_insn "*truncdfsf2_real"
    [(set (match_operand:SF 0 "memory_operand" "=m")
! 	(fix:SF (match_operand:DF 1 "register_operand" "r")))]
    ""
    "STSF %1,%0")

--- 610,616 ----

  (define_insn "*truncdfsf2_real"
    [(set (match_operand:SF 0 "memory_operand" "=m")
! 	(float_truncate:SF (match_operand:DF 1 "register_operand" "r")))]
    ""
    "STSF %1,%0")

*************** DIVU %1,%1,%2\;GET %0,:rR\;NEGU %2,0,%0\
*** 1129,1135 ****
     (clobber (reg:DI MMIX_rJ_REGNUM))]
    ""
    "GETA $255,0f\;PUT rJ,$255\;LDOU $255,%a0\n\
! 0: GET %1,rO\;CMPU %1,%1,$255\;BNP %1,1f\;POP 0,0\n1:")

  (define_insn "*Naddu"
    [(set (match_operand:DI 0 "register_operand" "=r")
--- 1129,1135 ----
     (clobber (reg:DI MMIX_rJ_REGNUM))]
    ""
    "GETA $255,0f\;PUT rJ,$255\;LDOU $255,%a0\n\
! 0:\;GET %1,rO\;CMPU %1,%1,$255\;BNP %1,1f\;POP 0,0\n1:")

  (define_insn "*Naddu"
    [(set (match_operand:DI 0 "register_operand" "=r")

brgds, H-P



More information about the Gcc-patches mailing list