User account creation filtered due to spam.

Bug 37550 - Please document predefined sub-architecture support macros
Summary: Please document predefined sub-architecture support macros
Status: UNCONFIRMED
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.2.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: documentation
Depends on:
Blocks:
 
Reported: 2008-09-17 02:35 UTC by Martin Buchholz
Modified: 2008-09-20 03:14 UTC (History)
1 user (show)

See Also:
Host: x86_64-linux-gnu
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Buchholz 2008-09-17 02:35:04 UTC
The preprocessor symbol __MMX__ indicates whether this gcc 
includes mmx support.  This is extremely useful, but undocumented.
I only found out by finding the symbol in other peoples' code.

The particular symbol __MMX__ should be documented in 
the obvious place, namely where the -mmmx flag is documented
in the x86-specific page.

And of course, similarly for other such predefined flags.
I assume there's one for sse, but I haven't actually tried to find out.

Here's a shell transcript, again compiling my favorite
source file, /dev/null:

(martinrb@spraggett) ~ $ gcc -mmmx -E -dD -x c /dev/null | sort > /tmp/t1
(martinrb@spraggett) ~ $ gcc -mno-mmx -E -dD -x c /dev/null | sort > /tmp/t2
(martinrb@spraggett) ~ $ diff /tmp/t[12]
92d91
< #define __MMX__ 1
Comment 1 pinskia@gmail.com 2008-09-17 03:12:28 UTC
Subject: Re:   New: Please document predefined sub-architecture support macros



Sent from my iPhone

On Sep 16, 2008, at 7:35 PM, "martinrb at google dot com" <gcc-bugzilla@gcc.gnu.org 
 > wrote:

> The preprocessor symbol __MMX__ indicates whether this gcc
> includes mmx support.  This is extremely useful, but undocumented.
> I only found out by finding the symbol in other peoples' code.

Some targets actually define this based some specifications of the  
target. Spu and -mcpu=cell on powerpc define __SPU__/__PPU__ as  
specified by the C/C++ language extension for the cbea document. I bet  
x86 has this specified in their documentation rather than in GCC's  
documentation.

>
>
> The particular symbol __MMX__ should be documented in
> the obvious place, namely where the -mmmx flag is documented
> in the x86-specific page.
>
> And of course, similarly for other such predefined flags.
> I assume there's one for sse, but I haven't actually tried to find  
> out.
>
> Here's a shell transcript, again compiling my favorite
> source file, /dev/null:
>
> (martinrb@spraggett) ~ $ gcc -mmmx -E -dD -x c /dev/null | sort > / 
> tmp/t1
> (martinrb@spraggett) ~ $ gcc -mno-mmx -E -dD -x c /dev/null | sort  
> > /tmp/t2
> (martinrb@spraggett) ~ $ diff /tmp/t[12]
> 92d91
> < #define __MMX__ 1
>
>
> -- 
>           Summary: Please document predefined sub-architecture support
>                    macros
>           Product: gcc
>           Version: 4.2.3
>            Status: UNCONFIRMED
>          Severity: normal
>          Priority: P3
>         Component: preprocessor
>        AssignedTo: unassigned at gcc dot gnu dot org
>        ReportedBy: martinrb at google dot com
>  GCC host triplet: x86_64-linux-gnu
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37550
>