This is the mail archive of the gcc-bugs@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]

[Bug target/28170] [4.1/4.2 Regression] Wrong result after swap byte in one word when compiled in 64-bit mode



------- Comment #8 from amodra at bigpond dot net dot au  2006-06-27 01:41 -------
I think insvdi_rshift_rlwimi_p is totally broken.  It should look something
like the following to match the capabilities of rlwimi according to my reading
of the powerpc architecture specification.

/* Return 1 if operands will generate valid arguments to the rlwimi
   instruction for insert with right shift in 64-bit mode.  */

int
insvdi_rshift_rlwimi_p (rtx sizeop, rtx startop, rtx shiftop)
{
  /* The field that we insert into must start in the low word.  */
  if (INTVAL (startop) < 32 || INTVAL (startop) >= 64)
    return 0;

  /* And it must end there too.  */
  if (INTVAL (sizeop) < 0 || INTVAL (sizeop) + INTVAL (startop) >= 64)
    return 0;

  /* The value we are inserting must also come from the low word.
     Since the sign bit isn't in the low word, we don't need to worry
     about ashiftrt vs. lshiftrt.  */
  if (INTVAL (shiftop) + INTVAL (sizeop) >= 32)
    return 0;

  return 1;
}


-- 


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


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