public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [ARM] How to query gas for target properties?
@ 2010-10-18  7:37 Christophe Lyon
  2010-10-27 13:45 ` Nick Clifton
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Lyon @ 2010-10-18  7:37 UTC (permalink / raw)
  To: Binutils

Hi,

I'd like to write an assembly code fragment with some parts conditional
to some target properties.
For instance, on ARM, I'd like to know if the target has the Neon
extension, ie gas if gas was invoked with -mfpu=neon.

I have been able to perform some other conditions (eg architecture
variant) through cpp, but I have found nothing enabling to know that
-mfpu=neon was used.

Any trick?

Thanks

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ARM] How to query gas for target properties?
  2010-10-18  7:37 [ARM] How to query gas for target properties? Christophe Lyon
@ 2010-10-27 13:45 ` Nick Clifton
  2010-11-04 15:44   ` Christophe Lyon
  0 siblings, 1 reply; 4+ messages in thread
From: Nick Clifton @ 2010-10-27 13:45 UTC (permalink / raw)
  To: Christophe Lyon; +Cc: Binutils

Hi Christophe,

> I'd like to write an assembly code fragment with some parts conditional
> to some target properties.
> For instance, on ARM, I'd like to know if the target has the Neon
> extension, ie gas if gas was invoked with -mfpu=neon.
>
> I have been able to perform some other conditions (eg architecture
> variant) through cpp, but I have found nothing enabling to know that
> -mfpu=neon was used.

Probably the easiest method would be to write the code in C as extended 
assembler statements and check for the presence of the __ARM_NEON__ 
preprocessor variable.

Cheers
   Nick


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ARM] How to query gas for target properties?
  2010-10-27 13:45 ` Nick Clifton
@ 2010-11-04 15:44   ` Christophe Lyon
  2010-11-05  3:23     ` Ramana Radhakrishnan
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Lyon @ 2010-11-04 15:44 UTC (permalink / raw)
  To: Nick Clifton; +Cc: Binutils

On 27.10.2010 15:45, Nick Clifton wrote:
> Hi Christophe,
> 
>> I'd like to write an assembly code fragment with some parts conditional
>> to some target properties.
>> For instance, on ARM, I'd like to know if the target has the Neon
>> extension, ie gas if gas was invoked with -mfpu=neon.
>>
>> I have been able to perform some other conditions (eg architecture
>> variant) through cpp, but I have found nothing enabling to know that
>> -mfpu=neon was used.
> 
> Probably the easiest method would be to write the code in C as extended 
> assembler statements and check for the presence of the __ARM_NEON__ 
> preprocessor variable.
> 


Thanks for you answer, that's what I had ended up doing.

My 1st attempts at using this macro failed because I didn't use
-mhardfp; I don't know why -mfpu=neon isn't sufficient to get
__ARM_NEON__ defined by GCC.

Thanks
Christophe.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ARM] How to query gas for target properties?
  2010-11-04 15:44   ` Christophe Lyon
@ 2010-11-05  3:23     ` Ramana Radhakrishnan
  0 siblings, 0 replies; 4+ messages in thread
From: Ramana Radhakrishnan @ 2010-11-05  3:23 UTC (permalink / raw)
  To: Christophe Lyon; +Cc: Nick Clifton, Binutils

>
> Thanks for you answer, that's what I had ended up doing.
>
> My 1st attempts at using this macro failed because I didn't use
> -mhardfp; I don't know why -mfpu=neon isn't sufficient to get
> __ARM_NEON__ defined by GCC.

You need to use -mfloat-abi=softfp or -mfloat-abi=hard ? If
-mfloat-abi isn't softfp or hard GCC won't generate any Neon code
despite there being a -mfpu=neon and hence the macro need not be
defined.


cheers
Ramana


>
> Thanks
> Christophe.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-05  3:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-18  7:37 [ARM] How to query gas for target properties? Christophe Lyon
2010-10-27 13:45 ` Nick Clifton
2010-11-04 15:44   ` Christophe Lyon
2010-11-05  3:23     ` Ramana Radhakrishnan

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).