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

Re: [PATCH] Add __GCC_HAVE_SYNC_COMPARE_AND_SWAP_*


On 5/18/07, Paolo Carlini <pcarlini@suse.de> wrote:

> +#include "insn-codes.h"
>
> IMO you should #include "insn-flags.h". HAVE_ macros are defined there.

Ok...

Actually, it looks that insn-flags.h have been included elsewhere (since it worked), so no need to include it at all...

> Perhaps adding
>
> #ifdef HAVE_sync_compare_and_swapqi
> +  if (HAVE_sync_compare_and_swapqi)
> +    cpp_define (pfile, "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1");
> #endif
>
> could solve this problem?

Indeed ;)

I think that you need #ifdef wraps everywhere.


BTW:

+/* { dg-do preprocess { target i?86-*-* } } */
+/* { dg-options "-march=i586" } */

We should also preprocess for x86_64 target, so:

/* { dg-do preprocess { target i?86-*-* target x86_64-*-* } } */
/* { dg-options "-march=i586"  { target { { i?86-*-* x86_64-*-* } &&
ilp32 } } } */

and to check SWAP_16:

/* { dg-do preprocess { target { { i?86-*-* x86_64-*-* } && lp64 } */
/* { dg-options "-mcx16" } */

Uros.


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