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 i386]:Ensure intrinsic functions are declared "C"


"H.J. Lu" <hjl.tools@gmail.com> wrote on 12.05.2010 15:31:07:

> On Wed, May 12, 2010 at 3:23 AM, Kai Tietz <Kai.Tietz@onevision.com> 
wrote:
> > Hello,
> >
> > At the moment intrinsic functions for headers don't have a explicit
> > language binding. As types, structures, and functions are quite 
different
> > handled in c++ and c, this cause at least for x86/x64 windows to 
issues,
> > as for this platforms the intrinsic functions have "C" language scope 
by
> > definition.
> > I tested for x86_64-pc-linux-gnu, i686-pc-mingw32, x86_64-w64-mingw32, 
and
> > i686-pc-cygwin. And I didn't found any regressions.
> >
> > 2010-05-12  Kai Tietz
> >
> >        * config/i386/abmintrin.h: Add extern "C" guard for c++.
> >        * config/i386/ammintrin.h: Likewise.
> >        * config/i386/avxintrin.h: Likewise.
> >        * config/i386/cpuid.h: Likewise.
> >        * config/i386/emmintrin.h: Likewise.
> >        * config/i386/fma4intrin.h: Likewise.
> >        * config/i386/gmm_malloc.h: Likewise.
> >        * config/i386/ia32intrin.h: Likewise.
> >        * config/i386/lwpintrin.h: Likewise.
> >        * config/i386/mm3dnow.h: Likewise.
> >        * config/i386/mmintrin.h: Likewise.
> >        * config/i386/pmm_malloc.h: Likewise.
> >        * config/i386/pmmintrin.h: Likewise.
> >        * config/i386/popcntintrin.h: Likewise.
> >        * config/i386/smmintrin.h: Likewise.
> >        * config/i386/tmmintrin.h: Likewise.
> >        * config/i386/wmmintrin.h: Likewise.
> >        * config/i386/xmmintrin.h: Likewise.
> >        * config/i386/xopintrin.h: Likewise.
> >
> > Ok for apply to trunk?
> >
> 
> Those function are always inlined. What do we need extern "C"?
> 
> 
> 
> -- 
> H.J.
> 

As I described above. C++ and C have different name mangling and for win32 
intrinsic have C scope. And as far as I can see it doesn't hurt, so the 
question is here more why we should stick here not unifying the language 
scope?

Regards,
Kai

|  (\_/)  This is Bunny. Copy and paste Bunny
| (='.'=) into your signature to help him gain
| (")_(") world domination.


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