mips-dspr2.md (mips_prepend): Mask operand 3 rather than operand 2.

gcc/
2012-02-02  Jia Liu  <proljc@gmail.com>

	* config/mips/mips-dspr2.md (mips_prepend): Mask operand 3 rather
	than operand 2.

gcc/testsuite/
	* gcc.target/mips/mips-prepend-1.c: New test.

From-SVN: r183841
This commit is contained in:
Richard Sandiford 2012-02-02 18:54:38 +00:00
parent f22f4fc153
commit 14bc59cb4f
4 changed files with 18 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2012-02-02 Jia Liu <proljc@gmail.com>
* config/mips/mips-dspr2.md (mips_prepend): Mask operand 3 rather
than operand 2.
2012-02-02 Jan Hubicka <jh@suse.cz>
Tom de Vries <tom@codesourcery.com>

View file

@ -353,7 +353,7 @@
"ISA_HAS_DSPR2"
{
if (INTVAL (operands[3]) & ~(unsigned HOST_WIDE_INT) 31)
operands[2] = GEN_INT (INTVAL (operands[2]) & 31);
operands[3] = GEN_INT (INTVAL (operands[3]) & 31);
return "prepend\t%0,%z2,%3";
}
[(set_attr "type" "arith")

View file

@ -1,3 +1,7 @@
2012-02-02 Richard Sandiford <rdsandiford@googlemail.com>
* gcc.target/mips/mips-prepend-1.c: New test.
2012-02-02 Jan Hubicka <jh@suse.cz>
Tom de Vries <tom@codesourcery.com>

View file

@ -0,0 +1,8 @@
/* { dg-options "-mdspr2" } */
/* { dg-final { scan-assembler "prepend\[^\n\]*,10" } } */
NOMIPS16 int
foo (int x, int y)
{
return __builtin_mips_prepend (x, y, 42);
}