* avx register variables
@ 2012-06-02 18:43 Gábor Buella
2012-06-02 18:49 ` Marc Glisse
0 siblings, 1 reply; 4+ messages in thread
From: Gábor Buella @ 2012-06-02 18:43 UTC (permalink / raw)
To: gcc-help
Hello,
With gcc 4.7, on Intel 64 I have trouble using avx register global variables:
register unsigned int something __asm__("xmm2") __attribute__
((__vector_size__ (16)));
works fine, but
register unsigned int something __asm__("ymm2") __attribute__
((__vector_size__ (32)));
results in "error: invalid register name for something"
Is it at all possible to use the YMM registers as variables? If yes, how?
ps the ralated builtin functions are recognized, -mavx argument used.
- Gabor
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: avx register variables
2012-06-02 18:43 avx register variables Gábor Buella
@ 2012-06-02 18:49 ` Marc Glisse
2012-06-02 19:33 ` Gábor Buella
0 siblings, 1 reply; 4+ messages in thread
From: Marc Glisse @ 2012-06-02 18:49 UTC (permalink / raw)
To: Gábor Buella; +Cc: gcc-help
On Sat, 2 Jun 2012, Gábor Buella wrote:
> Hello,
>
> With gcc 4.7, on Intel 64 I have trouble using avx register global variables:
>
> register unsigned int something __asm__("xmm2") __attribute__
> ((__vector_size__ (16)));
>
> works fine, but
>
> register unsigned int something __asm__("ymm2") __attribute__
> ((__vector_size__ (32)));
>
> results in "error: invalid register name for something"
>
> Is it at all possible to use the YMM registers as variables? If yes, how?
Did you try calling it "xmm2"?
--
Marc Glisse
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: avx register variables
2012-06-02 18:49 ` Marc Glisse
@ 2012-06-02 19:33 ` Gábor Buella
2012-06-04 5:45 ` Ian Lance Taylor
0 siblings, 1 reply; 4+ messages in thread
From: Gábor Buella @ 2012-06-02 19:33 UTC (permalink / raw)
To: gcc-help
Thank you,
Now I tried
register unsigned int something __asm__("xmm2") __attribute__
((__vector_size__ (32)));
It seems to work, and also found out, that if I use -mno-vzeroupper ,
I wont always lose the upper bits.
BTW, I'm no expert in assembly at all, I can't figure out why is it
XMM , why not YMM ?
Gabor
On Sat, Jun 2, 2012 at 8:49 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Sat, 2 Jun 2012, Gábor Buella wrote:
>
>> Hello,
>>
>> With gcc 4.7, on Intel 64 I have trouble using avx register global
>> variables:
>>
>> register unsigned int something __asm__("xmm2") __attribute__
>> ((__vector_size__ (16)));
>>
>> works fine, but
>>
>> register unsigned int something __asm__("ymm2") __attribute__
>> ((__vector_size__ (32)));
>>
>> results in "error: invalid register name for something"
>>
>> Is it at all possible to use the YMM registers as variables? If yes, how?
>
>
> Did you try calling it "xmm2"?
>
> --
> Marc Glisse
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: avx register variables
2012-06-02 19:33 ` Gábor Buella
@ 2012-06-04 5:45 ` Ian Lance Taylor
0 siblings, 0 replies; 4+ messages in thread
From: Ian Lance Taylor @ 2012-06-04 5:45 UTC (permalink / raw)
To: Gábor Buella; +Cc: gcc-help
Gábor Buella <gbuella@gmail.com> writes:
> register unsigned int something __asm__("xmm2") __attribute__
> ((__vector_size__ (32)));
>
> It seems to work, and also found out, that if I use -mno-vzeroupper ,
> I wont always lose the upper bits.
>
> BTW, I'm no expert in assembly at all, I can't figure out why is it
> XMM , why not YMM ?
Well, they are the same registers, after all.
Still, GCC ought to accept the YMM names. Please file a bug report at
http://gcc.gnu.org/bugzilla/ for this. Thanks.
Ian
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-06-04 5:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-02 18:43 avx register variables Gábor Buella
2012-06-02 18:49 ` Marc Glisse
2012-06-02 19:33 ` Gábor Buella
2012-06-04 5:45 ` Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).