This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Add LWP support for upcoming AMD Orochi processor.
On Mon, Dec 14, 2009 at 11:12:01AM -0800, Richard Henderson wrote:
> On 12/14/2009 11:08 AM, Jakub Jelinek wrote:
> >+ /* These 2 codes can't use case labels, as
> >+ in 32-bit only target builds they are both
> >+ CODE_FOR_nothing. */
> >+ if (TARGET_64BIT
> >+ && (icode == CODE_FOR_lwp_lwpvaldi3
> >+ || icode == CODE_FOR_lwp_lwpinsdi3))
>
> I wonder if it just wouldn't be easier to use an IF here.
> You don't need the TARGET_64BIT since we know icode != CODE_FOR_nothing.
This works of course too. I used the switch just because there was one
already (with just default: label and no other cases).
Whatever you prefer...
2009-12-14 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/42369
* config/i386/i386.c (ix86_expand_special_args_builtin): Avoid
using switch with CODE_FOR_lwp_lwp* cases.
--- gcc/config/i386/i386.c.jj 2009-12-14 17:50:14.000000000 +0100
+++ gcc/config/i386/i386.c 2009-12-14 20:34:03.000000000 +0100
@@ -23836,19 +23836,16 @@ ix86_expand_special_args_builtin (const
if (last_arg_constant && (i + 1) == nargs)
{
if (!match)
- switch (icode)
- {
- case CODE_FOR_lwp_lwpvalsi3:
- case CODE_FOR_lwp_lwpvaldi3:
- case CODE_FOR_lwp_lwpinssi3:
- case CODE_FOR_lwp_lwpinsdi3:
+ {
+ if (icode == CODE_FOR_lwp_lwpvalsi3
+ || icode == CODE_FOR_lwp_lwpinssi3
+ || icode == CODE_FOR_lwp_lwpvaldi3
+ || icode == CODE_FOR_lwp_lwpinsdi3)
error ("the last argument must be a 32-bit immediate");
- return const0_rtx;
-
- default:
+ else
error ("the last argument must be an 8-bit immediate");
- return const0_rtx;
- }
+ return const0_rtx;
+ }
}
else
{
Jakub