Message ID | 20170621114836.22705-1-petri.savolainen@linaro.org |
---|---|
State | Superseded |
Headers | show |
Reviewed-by: Brian Brooks <brian.brooks@arm.com> ACLE [1] was added to GCC 4.9. GCC 4.8 does define __aarch64__ so this change should be safe. [1] http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053c/IHI0053C_acle_2_0.pdf On 06/21 14:48:36, Petri Savolainen wrote: > Use __aarch64__ instead of __ARM_ARCH, since it's backwards > compatible between GCC versions. > > Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 > > Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> > --- > platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c > index 91d439d9..fd1b3ed6 100644 > --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c > +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c > @@ -68,7 +68,7 @@ int cpu_has_global_time(void) > > uint64_t cpu_global_time(void) > { > -#if __ARM_ARCH == 8 > +#if __aarch64__ > uint64_t cntvct; > > /* > @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) > > uint64_t cpu_global_time_freq(void) > { > -#if __ARM_ARCH == 8 > +#if __aarch64__ > uint64_t cntfrq; > > __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); > -- > 2.13.0 >
I've confirmed this is benign on x86. Brian: Please review for ARM. On Wed, Jun 21, 2017 at 6:48 AM, Petri Savolainen <petri.savolainen@linaro.org> wrote: > Use __aarch64__ instead of __ARM_ARCH, since it's backwards > compatible between GCC versions. > > Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 > > Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> > --- > platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c > index 91d439d9..fd1b3ed6 100644 > --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c > +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c > @@ -68,7 +68,7 @@ int cpu_has_global_time(void) > > uint64_t cpu_global_time(void) > { > -#if __ARM_ARCH == 8 > +#if __aarch64__ > uint64_t cntvct; > > /* > @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) > > uint64_t cpu_global_time_freq(void) > { > -#if __ARM_ARCH == 8 > +#if __aarch64__ > uint64_t cntfrq; > > __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); > -- > 2.13.0 >
Thanks Brian. Is this also in clang for ARM? On Wed, Jun 14, 2017 at 4:16 PM, Brian Brooks <brian.brooks@arm.com> wrote: > Reviewed-by: Brian Brooks <brian.brooks@arm.com> > > ACLE [1] was added to GCC 4.9. GCC 4.8 does define __aarch64__ > so this change should be safe. > > [1] http://infocenter.arm.com/help/topic/com.arm.doc.ihi0053c/IHI0053C_acle_2_0.pdf > > On 06/21 14:48:36, Petri Savolainen wrote: >> Use __aarch64__ instead of __ARM_ARCH, since it's backwards >> compatible between GCC versions. >> >> Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 >> >> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> >> --- >> platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c >> index 91d439d9..fd1b3ed6 100644 >> --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c >> +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c >> @@ -68,7 +68,7 @@ int cpu_has_global_time(void) >> >> uint64_t cpu_global_time(void) >> { >> -#if __ARM_ARCH == 8 >> +#if __aarch64__ >> uint64_t cntvct; >> >> /* >> @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) >> >> uint64_t cpu_global_time_freq(void) >> { >> -#if __ARM_ARCH == 8 >> +#if __aarch64__ >> uint64_t cntfrq; >> >> __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); >> -- >> 2.13.0 >>
odp check with ARCH=arm fails after this patch: CC arch/arm/odp_cpu_arch.lo arch/arm/odp_cpu_arch.c: In function 'cpu_global_time': arch/arm/odp_cpu_arch.c:71:5: error: "__aarch64__" is not defined [-Werror=undef] #if __aarch64__ ^ arch/arm/odp_cpu_arch.c: In function 'cpu_global_time_freq': arch/arm/odp_cpu_arch.c:91:5: error: "__aarch64__" is not defined [-Werror=undef] #if __aarch64__ ^ cc1: all warnings being treated as errors implementation_name: odp-linux host: arm-unknown-linux-gnueabihf ARCH_DIR arm ARCH_ABI arm32-linux with_platform: linux-generic helper_linux: no prefix: /opt/Linaro/check-odp-v3.git/new-build sysconfdir: ${prefix}/etc libdir: ${exec_prefix}/lib includedir: ${prefix}/include testdir: ${exec_prefix}/lib/odp/tests WITH_ARCH: arm cc: arm-linux-gnueabihf-gcc cc version: 5.3.1 On 06/21/17 15:42, Bill Fischofer wrote: > I've confirmed this is benign on x86. Brian: Please review for ARM. > > On Wed, Jun 21, 2017 at 6:48 AM, Petri Savolainen > <petri.savolainen@linaro.org> wrote: >> Use __aarch64__ instead of __ARM_ARCH, since it's backwards >> compatible between GCC versions. >> >> Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 >> >> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> >> --- >> platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c >> index 91d439d9..fd1b3ed6 100644 >> --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c >> +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c >> @@ -68,7 +68,7 @@ int cpu_has_global_time(void) >> >> uint64_t cpu_global_time(void) >> { >> -#if __ARM_ARCH == 8 >> +#if __aarch64__ >> uint64_t cntvct; >> >> /* >> @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) >> >> uint64_t cpu_global_time_freq(void) >> { >> -#if __ARM_ARCH == 8 >> +#if __aarch64__ >> uint64_t cntfrq; >> >> __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); >> -- >> 2.13.0 >>
#if -> #ifdef On Wed, Jun 21, 2017 at 3:27 PM, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: > odp check with ARCH=arm fails after this patch: > > CC arch/arm/odp_cpu_arch.lo > arch/arm/odp_cpu_arch.c: In function 'cpu_global_time': > arch/arm/odp_cpu_arch.c:71:5: error: "__aarch64__" is not defined > [-Werror=undef] > #if __aarch64__ > ^ > arch/arm/odp_cpu_arch.c: In function 'cpu_global_time_freq': > arch/arm/odp_cpu_arch.c:91:5: error: "__aarch64__" is not defined > [-Werror=undef] > #if __aarch64__ > ^ > cc1: all warnings being treated as errors > > implementation_name: odp-linux > host: arm-unknown-linux-gnueabihf > ARCH_DIR arm > ARCH_ABI arm32-linux > with_platform: linux-generic > helper_linux: no > prefix: /opt/Linaro/check-odp-v3.git/new-build > sysconfdir: ${prefix}/etc > libdir: ${exec_prefix}/lib > includedir: ${prefix}/include > testdir: ${exec_prefix}/lib/odp/tests > WITH_ARCH: arm > > cc: arm-linux-gnueabihf-gcc > cc version: 5.3.1 > > > > > On 06/21/17 15:42, Bill Fischofer wrote: >> I've confirmed this is benign on x86. Brian: Please review for ARM. >> >> On Wed, Jun 21, 2017 at 6:48 AM, Petri Savolainen >> <petri.savolainen@linaro.org> wrote: >>> Use __aarch64__ instead of __ARM_ARCH, since it's backwards >>> compatible between GCC versions. >>> >>> Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 >>> >>> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> >>> --- >>> platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c >>> index 91d439d9..fd1b3ed6 100644 >>> --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c >>> +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c >>> @@ -68,7 +68,7 @@ int cpu_has_global_time(void) >>> >>> uint64_t cpu_global_time(void) >>> { >>> -#if __ARM_ARCH == 8 >>> +#if __aarch64__ >>> uint64_t cntvct; >>> >>> /* >>> @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) >>> >>> uint64_t cpu_global_time_freq(void) >>> { >>> -#if __ARM_ARCH == 8 >>> +#if __aarch64__ >>> uint64_t cntfrq; >>> >>> __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); >>> -- >>> 2.13.0 >>> >
On 06/21/17 23:30, Brian Brooks wrote: > #if -> #ifdef > ifdef works. > On Wed, Jun 21, 2017 at 3:27 PM, Maxim Uvarov <maxim.uvarov@linaro.org> wrote: >> odp check with ARCH=arm fails after this patch: >> >> CC arch/arm/odp_cpu_arch.lo >> arch/arm/odp_cpu_arch.c: In function 'cpu_global_time': >> arch/arm/odp_cpu_arch.c:71:5: error: "__aarch64__" is not defined >> [-Werror=undef] >> #if __aarch64__ >> ^ >> arch/arm/odp_cpu_arch.c: In function 'cpu_global_time_freq': >> arch/arm/odp_cpu_arch.c:91:5: error: "__aarch64__" is not defined >> [-Werror=undef] >> #if __aarch64__ >> ^ >> cc1: all warnings being treated as errors >> >> implementation_name: odp-linux >> host: arm-unknown-linux-gnueabihf >> ARCH_DIR arm >> ARCH_ABI arm32-linux >> with_platform: linux-generic >> helper_linux: no >> prefix: /opt/Linaro/check-odp-v3.git/new-build >> sysconfdir: ${prefix}/etc >> libdir: ${exec_prefix}/lib >> includedir: ${prefix}/include >> testdir: ${exec_prefix}/lib/odp/tests >> WITH_ARCH: arm >> >> cc: arm-linux-gnueabihf-gcc >> cc version: 5.3.1 >> >> >> >> >> On 06/21/17 15:42, Bill Fischofer wrote: >>> I've confirmed this is benign on x86. Brian: Please review for ARM. >>> >>> On Wed, Jun 21, 2017 at 6:48 AM, Petri Savolainen >>> <petri.savolainen@linaro.org> wrote: >>>> Use __aarch64__ instead of __ARM_ARCH, since it's backwards >>>> compatible between GCC versions. >>>> >>>> Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 >>>> >>>> Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> >>>> --- >>>> platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- >>>> 1 file changed, 2 insertions(+), 2 deletions(-) >>>> >>>> diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c >>>> index 91d439d9..fd1b3ed6 100644 >>>> --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c >>>> +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c >>>> @@ -68,7 +68,7 @@ int cpu_has_global_time(void) >>>> >>>> uint64_t cpu_global_time(void) >>>> { >>>> -#if __ARM_ARCH == 8 >>>> +#if __aarch64__ >>>> uint64_t cntvct; >>>> >>>> /* >>>> @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) >>>> >>>> uint64_t cpu_global_time_freq(void) >>>> { >>>> -#if __ARM_ARCH == 8 >>>> +#if __aarch64__ >>>> uint64_t cntfrq; >>>> >>>> __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : ); >>>> -- >>>> 2.13.0 >>>> >>
diff --git a/platform/linux-generic/arch/arm/odp_cpu_arch.c b/platform/linux-generic/arch/arm/odp_cpu_arch.c index 91d439d9..fd1b3ed6 100644 --- a/platform/linux-generic/arch/arm/odp_cpu_arch.c +++ b/platform/linux-generic/arch/arm/odp_cpu_arch.c @@ -68,7 +68,7 @@ int cpu_has_global_time(void) uint64_t cpu_global_time(void) { -#if __ARM_ARCH == 8 +#if __aarch64__ uint64_t cntvct; /* @@ -88,7 +88,7 @@ uint64_t cpu_global_time(void) uint64_t cpu_global_time_freq(void) { -#if __ARM_ARCH == 8 +#if __aarch64__ uint64_t cntfrq; __asm__ volatile("mrs %0, cntfrq_el0" : "=r"(cntfrq) : : );
Use __aarch64__ instead of __ARM_ARCH, since it's backwards compatible between GCC versions. Fixes bug https://bugs.linaro.org/show_bug.cgi?id=3066 Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org> --- platform/linux-generic/arch/arm/odp_cpu_arch.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.13.0