This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/28170] [4.1/4.2 Regression] Wrong result after swap byte in one word when compiled in 64-bit mode
- From: "amodra at bigpond dot net dot au" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 27 Jun 2006 01:41:56 -0000
- Subject: [Bug target/28170] [4.1/4.2 Regression] Wrong result after swap byte in one word when compiled in 64-bit mode
- References: <bug-28170-5233@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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