[PATCH 0/5] ARM Intrinsics Support

Stephen Thomas stephen.thomas@arm.com
Wed Jul 15 14:39:00 GMT 2009


> -----Original Message-----
> From: gcc-patches-owner@gcc.gnu.org 
> [mailto:gcc-patches-owner@gcc.gnu.org] On Behalf Of Paul Brook
> Sent: 13 July 2009 11:43
> To: Stephen Thomas
> Cc: gcc-patches@gcc.gnu.org; Richard Earnshaw
> Subject: Re: [PATCH 0/5] ARM Intrinsics Support
> 
> On Monday 13 July 2009, Stephen Thomas wrote:
> > Something I didn't make properly clear was that these 
> intrinsics are 
> > intended purely to provide compatability with another ARM compiler. 
> > It's not necessary to include a header in order to use the 
> intrinsics 
> > on that compiler, so requiring someone using these intrinsics to do 
> > that on GCC breaks the intent of this patch.
> 
> That's easily fixed with the -include command-line option.

Which is fine if inline assembly is right approach. The problem
with inline assembly is that it something of a blunt instrument
in that the opportunities to tell the compiler much about the
semantics of what the code is doing are quite limited. I
acknowledge that many of these intrinsics can probably be
expressed as inline assembly with little loss of expressiveness,
but not all.

Consider, for example, the interrupt enabling/disabling
intrinsics. They change the state of the processor, returning
the previous state. Changing the state and recording the current
state are two separate operations in the RTL and if the intrinsic
is called in a void context or the compiler can prove that the
old state value isn't required, the operation will be omitted.
With inline assembly I do not see how obtaining the current
value can be prevented if it is not needed, whereas this "just
happens" if the operation is expressed as RTL.

So, while some operations could be expressed as inline assembly
not all of them can be so to my satisfaction, and I would consider
it an inferior, over-complex implementation if this single body
of functionality was expression partially as a header file
which had to be included and partially as actual intrinsic
operations. If nothing else, it would be more of a maintenance
headache.

Stephen




More information about the Gcc-patches mailing list