public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/49600] New: Bad int->float split in i386.md
@ 2011-06-30 22:42 hjl.tools at gmail dot com
  2011-06-30 22:52 ` [Bug target/49600] Bad SSE2 " hjl.tools at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-30 22:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49600

           Summary: Bad int->float split in i386.md
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: hjl.tools@gmail.com
                CC: ubizjak@gmail.com


There is

(define_split
  [(set (match_operand:MODEF 0 "register_operand" "")
        (float:MODEF (match_operand:SI 1 "register_operand" "")))]
  "TARGET_SSE2 && TARGET_SSE_MATH
   && TARGET_USE_VECTOR_CONVERTS && optimize_function_for_speed_p (cfun)
   && reload_completed
   && (SSE_REG_P (operands[0])
       || (GET_CODE (operands[0]) == SUBREG
           && SSE_REG_P (operands[0])))"
  [(const_int 0)]
{
  rtx op1 = operands[1];

  operands[3] = simplify_gen_subreg (<ssevecmode>mode, operands[0],
                                     <MODE>mode, 0);
  if (GET_CODE (op1) == SUBREG)
    op1 = SUBREG_REG (op1);

  if (GENERAL_REG_P (op1) && TARGET_INTER_UNIT_MOVES)
    {
      operands[4] = simplify_gen_subreg (V4SImode, operands[0], <MODE>mode, 0);
      emit_insn (gen_sse2_loadld (operands[4],
                                  CONST0_RTX (V4SImode), operands[1]));
    }
  /* We can ignore possible trapping value in the
     high part of SSE register for non-trapping math. */
  else if (SSE_REG_P (op1) && !flag_trapping_math)
    operands[4] = simplify_gen_subreg (V4SImode, operands[1], SImode, 0);
  else    
    gcc_unreachable ();
  emit_insn
    (gen_sse2_cvtdq2p<ssemodefsuffix> (operands[3], operands[4]));
  DONE;   
})

When TARGET_USE_VECTOR_CONVERTS is true, TARGET_INTER_UNIT_MOVES
is false and GENERAL_REG_P (op1) is true. we will get gcc_unreachable.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/49600] Bad SSE2 int->float split in i386.md
  2011-06-30 22:42 [Bug target/49600] New: Bad int->float split in i386.md hjl.tools at gmail dot com
@ 2011-06-30 22:52 ` hjl.tools at gmail dot com
  2011-07-04 13:42 ` hjl.tools at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2011-06-30 22:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49600

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-p
                   |                            |atches/2011-06/msg02409.htm
                   |                            |l

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2011-06-30 22:50:54 UTC ---
A patch is posted at

http://gcc.gnu.org/ml/gcc-patches/2011-06/msg02409.html


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/49600] Bad SSE2 int->float split in i386.md
  2011-06-30 22:42 [Bug target/49600] New: Bad int->float split in i386.md hjl.tools at gmail dot com
  2011-06-30 22:52 ` [Bug target/49600] Bad SSE2 " hjl.tools at gmail dot com
@ 2011-07-04 13:42 ` hjl.tools at gmail dot com
  2011-07-04 16:27 ` uros at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: hjl.tools at gmail dot com @ 2011-07-04 13:42 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49600

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> 2011-07-04 13:42:00 UTC ---
Here is the testcase:

---
 long int seedi;
  long lo;
 double ran() {
  long hi;
  long test;
  hi = seedi / 127773L;
  test = 16807L * lo - 2836L * hi;
  if (test > 0) {
   seedi = test;
  }
  return ( (float) seedi / 2147483647L);
 }
---

It failed at -O3 -funroll-loops -msse2 -mfpmath=sse -ffast-math -mtune=XXX,
where XXX is a new x86 optimization we are working on.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/49600] Bad SSE2 int->float split in i386.md
  2011-06-30 22:42 [Bug target/49600] New: Bad int->float split in i386.md hjl.tools at gmail dot com
  2011-06-30 22:52 ` [Bug target/49600] Bad SSE2 " hjl.tools at gmail dot com
  2011-07-04 13:42 ` hjl.tools at gmail dot com
@ 2011-07-04 16:27 ` uros at gcc dot gnu.org
  2011-07-04 16:28 ` ubizjak at gmail dot com
  2011-07-21 21:21 ` uros at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: uros at gcc dot gnu.org @ 2011-07-04 16:27 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49600

--- Comment #3 from uros at gcc dot gnu.org 2011-07-04 16:26:13 UTC ---
Author: uros
Date: Mon Jul  4 16:26:08 2011
New Revision: 175817

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=175817
Log:
    PR target/49600
    * config/i386/i386.md (SSE2 int->float split): Push operand 1 in
    general register to memory for !TARGET_INTER_UNIT_MOVES.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/i386.md


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/49600] Bad SSE2 int->float split in i386.md
  2011-06-30 22:42 [Bug target/49600] New: Bad int->float split in i386.md hjl.tools at gmail dot com
                   ` (2 preceding siblings ...)
  2011-07-04 16:27 ` uros at gcc dot gnu.org
@ 2011-07-04 16:28 ` ubizjak at gmail dot com
  2011-07-21 21:21 ` uros at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ubizjak at gmail dot com @ 2011-07-04 16:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49600

Uros Bizjak <ubizjak at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Target|                            |x86
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.7.0

--- Comment #4 from Uros Bizjak <ubizjak at gmail dot com> 2011-07-04 16:28:05 UTC ---
Fixed.


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug target/49600] Bad SSE2 int->float split in i386.md
  2011-06-30 22:42 [Bug target/49600] New: Bad int->float split in i386.md hjl.tools at gmail dot com
                   ` (3 preceding siblings ...)
  2011-07-04 16:28 ` ubizjak at gmail dot com
@ 2011-07-21 21:21 ` uros at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: uros at gcc dot gnu.org @ 2011-07-21 21:21 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49600

--- Comment #5 from uros at gcc dot gnu.org 2011-07-21 21:21:01 UTC ---
Author: uros
Date: Thu Jul 21 21:20:59 2011
New Revision: 176589

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=176589
Log:
    Backport from mainline
    2011-07-04  Uros Bizjak  <ubizjak@gmail.com>

    PR target/49600
    * config/i386/i386.md (SSE2 int->float split): Push operand 1 in
    general register to memory for !TARGET_INTER_UNIT_MOVES.


Modified:
    branches/gcc-4_6-branch/gcc/ChangeLog
    branches/gcc-4_6-branch/gcc/config/i386/i386.md


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-07-21 21:21 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-30 22:42 [Bug target/49600] New: Bad int->float split in i386.md hjl.tools at gmail dot com
2011-06-30 22:52 ` [Bug target/49600] Bad SSE2 " hjl.tools at gmail dot com
2011-07-04 13:42 ` hjl.tools at gmail dot com
2011-07-04 16:27 ` uros at gcc dot gnu.org
2011-07-04 16:28 ` ubizjak at gmail dot com
2011-07-21 21:21 ` uros at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).