On Tue, Sep 13, 2016 at 01:15:39PM +0100, Tamar Christina wrote:
> 
> 
> On 05/09/16 22:37, Andrew Pinski wrote:
> >On Mon, Sep 5, 2016 at 4:53 AM, Tamar Christina <tamar.christ...@arm.com> 
> >wrote:
> >>Hi all,
> >>
> >>This patch adds __artificial__ attribute to the intrinsics
> >>in arm_neon.h so that costs are associated to the user
> >>function during profiling and during the intrinsics are
> >>are hidden in trace.
> >>
> >>The attribute does not affect code generation.
> >>
> >>No new tests for this since it would require a gdb test
> >>but regression tests on aarch64-none-elf was performed.
> >I think this is obvious.  Note I would change it one more step to be:
> >__extension__ extern__inline TYPE
> >__attribute__  ((__always_inline__, __gnu_inline__, __artificial__))
> >
> >The main reason is because in C++98 (and I can't remember if C++11),
> >template are not supposed to consider a static function being a
> >candidate (though GCC does not get it right is no reason why not to
> >change it).
> 
> Hi Andrew,
> 
> I've updated the script and patch. New script is:
> 
> #!/bin/bash
> 
> # first apply to the ones in #define blocks and add extra \ at the end
> sed -i -r
> 's/(__inline.+)(__attribute__\s*)\(\((.+)\)\)\s*\\/\1\\\n\2 \(\(\3,
> __gnu_inline__,__artificial__\)\) \\/m' \
>  gcc/config/aarch64/arm_neon.h
> 
> # Then write all normal functions
> sed -i -r 's/(__inline.+)(__attribute__\s*)\(\((.+)\)\)/\1\n\2
> \(\(\3, __gnu_inline__, __artificial__\)\)/m' \
>  gcc/config/aarch64/arm_neon.h
> 
> # Then correct any trailing whitespaces we might have introduced
> sed -i 's/[ \t]*$//' \
>  gcc/config/aarch64/arm_neon.h
> 
> # And then finish up by correcting some attribute values which don't
> fit the patterns above.
> sed -i -r
> 's/(__attribute__\s+)\(\((__always_inline__)\)\)\s+\\/\1\(\(\2,
> __gnu_inline__, __artificial__\)\) \\/m' \
>  gcc/config/aarch64/arm_neon.h
> 
> # Replace static definitions with extern
> sed -i -r 's/(__extension__\s+)static(.+)/\1extern\2/m' \
>  gcc/config/aarch64/arm_neon.h
> 
> I've also update the patch.

Thanks, I applied this following your script above, and committed it as
revision 240256, after tweaking one part of the script to replace a double
space after __attribute__ introduced by the second sed command.

Thanks,
James

Reply via email to