diff mbox

Change __ARM_NEON__ to __ARM_NEON in libcpp/lex.c

Message ID 54CB7E9B.5030107@arm.com
State New
Headers show

Commit Message

Szabolcs Nagy Jan. 30, 2015, 12:52 p.m. UTC
Hello,

When running natively on AArch64 the preprocessor did not use the
AdvSIMD optimized search_line_fast function, because it was ifdefed
around by __ARM_NEON__ instead of __ARM_NEON.

(The ARM C Language Extensions specifies the __ARM_NEON macro, but not
__ARM_NEON__ which is legacy and thus not defined on AArch64)

Tested on aarch64-unknown-linux-gnu, is this ok?


2015-01-30  Szabolcs Nagy  <szabolcs.nagy@arm.com>

libcpp/Changelog

   * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.

Comments

Richard Earnshaw Jan. 30, 2015, 1:28 p.m. UTC | #1
On 30/01/15 12:52, Szabolcs Nagy wrote:
> Hello,
> 
> When running natively on AArch64 the preprocessor did not use the
> AdvSIMD optimized search_line_fast function, because it was ifdefed
> around by __ARM_NEON__ instead of __ARM_NEON.
> 
> (The ARM C Language Extensions specifies the __ARM_NEON macro, but not
> __ARM_NEON__ which is legacy and thus not defined on AArch64)
> 
> Tested on aarch64-unknown-linux-gnu, is this ok?
> 
> 
> 2015-01-30  Szabolcs Nagy  <szabolcs.nagy@arm.com>
> 
> libcpp/Changelog
> 
>    * lex.c (search_line_fast): Change __ARM_NEON__ to __ARM_NEON.
> 
> 

I think this is trivial enough to go in now.

OK.

R.

> libcpp-neon.diff
> 
> 
> diff --git a/libcpp/lex.c b/libcpp/lex.c
> index bc1947d..4638510 100644
> --- a/libcpp/lex.c
> +++ b/libcpp/lex.c
> @@ -731,7 +731,7 @@ search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
>    }
>  }
>  
> -#elif defined (__ARM_NEON__)
> +#elif defined (__ARM_NEON)
>  #include "arm_neon.h"
>  
>  static const uchar *
>
Richard Henderson Jan. 30, 2015, 7:14 p.m. UTC | #2
On 01/30/2015 04:52 AM, Szabolcs Nagy wrote:
> When running natively on AArch64 the preprocessor did not use the
> AdvSIMD optimized search_line_fast function, because it was ifdefed
> around by __ARM_NEON__ instead of __ARM_NEON.

Yes, sorry I didn't follow up on that from September:

  https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00149.html

You also want to change to use vaddvq_u16 instead of
the current vpadd and vget_lane reduction.

I was going to wait until stage1 to resubmit this.


r~
Szabolcs Nagy Feb. 2, 2015, 3:34 p.m. UTC | #3
On 30/01/15 19:14, Richard Henderson wrote:
> On 01/30/2015 04:52 AM, Szabolcs Nagy wrote:
>> When running natively on AArch64 the preprocessor did not use the
>> AdvSIMD optimized search_line_fast function, because it was ifdefed
>> around by __ARM_NEON__ instead of __ARM_NEON.
>
> Yes, sorry I didn't follow up on that from September:
>
>    https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00149.html
>
> You also want to change to use vaddvq_u16 instead of
> the current vpadd and vget_lane reduction.
>
> I was going to wait until stage1 to resubmit this.
>


that's a bigger change, can it be a separate patch
or do you plan to do it together with the ifdef fix?
Richard Earnshaw Feb. 2, 2015, 3:43 p.m. UTC | #4
On 02/02/15 15:34, Szabolcs Nagy wrote:
> 
> 
> On 30/01/15 19:14, Richard Henderson wrote:
>> On 01/30/2015 04:52 AM, Szabolcs Nagy wrote:
>>> When running natively on AArch64 the preprocessor did not use the
>>> AdvSIMD optimized search_line_fast function, because it was ifdefed
>>> around by __ARM_NEON__ instead of __ARM_NEON.
>>
>> Yes, sorry I didn't follow up on that from September:
>>
>>    https://gcc.gnu.org/ml/gcc-patches/2014-09/msg00149.html
>>
>> You also want to change to use vaddvq_u16 instead of
>> the current vpadd and vget_lane reduction.
>>
>> I was going to wait until stage1 to resubmit this.
>>
> 
> 
> that's a bigger change, can it be a separate patch
> or do you plan to do it together with the ifdef fix?
> 
> 
> 

I think the two should be separated.  The existing code will work on
AArch64, even though it could be improved upon.

R.
diff mbox

Patch

diff --git a/libcpp/lex.c b/libcpp/lex.c
index bc1947d..4638510 100644
--- a/libcpp/lex.c
+++ b/libcpp/lex.c
@@ -731,7 +731,7 @@  search_line_fast (const uchar *s, const uchar *end ATTRIBUTE_UNUSED)
   }
 }
 
-#elif defined (__ARM_NEON__)
+#elif defined (__ARM_NEON)
 #include "arm_neon.h"
 
 static const uchar *