[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: feature request: detect CPU instruction set
From: |
Bruno Haible |
Subject: |
Re: feature request: detect CPU instruction set |
Date: |
Fri, 3 Sep 2010 21:24:06 +0200 |
User-agent: |
KMail/1.9.9 |
Sam,
> > AH_TOP([/* CPU and C ABI indicator */
> > #ifndef __i386__
> > #undef __i386__
> > #endif
> > ...
> > #ifndef __sparc64__
> > #undef __sparc64__
> > #endif
> > ])
>
> what is this?
It's a set of preprocessor commands that get copied into config.h.in.
So that config.h will define the appropriate symbol (say, on 64-bit
SPARC systems, the __sparc64__ symbol), if the compiler does not already
define it.
> how is it supposed to be used?
#include <config.h>
#ifdef __sparc64__
asm ("mulu64 ...");
#elif __sparc__
asm ("mulu ...");
> does it somehow replace
> =================================================
> /* CPU */
> #ifndef __i386__
> #undef __i386__
> #endif
> ...
> #ifndef __x86_64__
> #undef __x86_64__
> #endif
> =================================================
> in, e.g., vacall.h.in?
If vacall.h.in includes config.h, then yes, you can remove that piece from
vacall.h.in.
Bruno