Ping: [R220456][4.9] Backport the patch which fixes __ARM_FP & __ARM_NEON_FP predefines
Pinging this patch. Thank you, - Mantas On 13/02/15 10:03, Mantas Mikaitis wrote: Hi all, This is a backport for gcc-4_9-branch of the patch " [PATCH][ARM] __ARM_FP & __ARM_NEON_FP defined when -march=armv7-m" posted in: https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00250.html arm-none-linux-gnueabi/hf tested without any new regressions. OK for gcc-4_9-branch? gcc/ChangeLog: 2015-02-13 Mantas Mikaitis * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. *(TARGET_ARM_FP): Added !TARGET_SOFT_FLOAT into the conditional definition gcc/testsuite/ChangeLog: * gcc.target/arm/macro_defs0.c: New test. * gcc.target/arm/macro_defs1.c: New test. * gcc.target/arm/macro_defs2.c: New test.
Ping: [PATCH][ARM][testsuite] Fix FAIL: gcc.target/arm/macro_defs0.c and macro_defs1.c when -marm forced
Pinging this patch. Thank you, - Mantas On 05/03/15 10:14, Mantas Mikaitis wrote: Hello, Tests gcc.target/arm/macro_defs0.c and gcc.target/arm/macro_defs1.c fail in multilib which forces -marm as pointed out in this message: https://gcc.gnu.org/ml/gcc-patches/2015-02/msg00483.html . This patch will cause these tests to be classified as unsupported rather than FAIL. Ok for trunk? Kind regards, Mantas M. 2015-03-05 Mantas Mikaitis * gcc.target/arm/macro_defs0.c: added directive to skip test if -marm is present. * gcc.target/arm/macro_defs1.c: added directive to skip test if -marm is present.
[PATCH][ARM] __ARM_FP & __ARM_NEON_FP defined when -march=armv7-m
Incorrect predefinitions for certain target architectures. E.g. arm7-m does not contain NEON but the defintion __ARM_NEON_FP was switched on. Similarly with armv6 and even armv2. This patch fixes the predefines for each of the different chips containing certain types of the FPU implementations. Tests: Tested on arm-none-linux-gnueabi and arm-none-linux-gnueabihf without any new regression. Manually compiled for various targets and all correct definitions were present. Is this patch ok for trunk? Mantas gcc/Changelog: * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_CPU_CPP_BUILTINS): Added second condition before defining __ARM_FP macro. diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..325fea9 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -118,7 +118,7 @@ extern char arm_arch_name[]; if (TARGET_VFP) \ builtin_define ("__VFP_FP__"); \ \ - if (TARGET_ARM_FP)\ + if (TARGET_ARM_FP && !TARGET_SOFT_FLOAT) \ builtin_define_with_int_value ( \ "__ARM_FP", TARGET_ARM_FP); \ if (arm_fp16_format == ARM_FP16_FORMAT_IEEE) \ @@ -2350,10 +2350,9 @@ extern int making_const_table; /* Set as a bit mask indicating the available widths of floating point types for hardware NEON floating point. This is the same as TARGET_ARM_FP without the 64-bit bit set. */ -#ifdef TARGET_NEON -#define TARGET_NEON_FP \ - (TARGET_ARM_FP & (0xff ^ 0x08)) -#endif +#define TARGET_NEON_FP \ + (TARGET_NEON ? (TARGET_ARM_FP & (0xff ^ 0x08)) \ + : 0) /* The maximum number of parallel loads or stores we support in an ldm/stm instruction. */
[PATCH] check_GNU_style.sh "80 characters exceeded" error fix
check_GNU_style.sh error "Lines should not exceed 80 characters" does not return the file name and line number where error is present, only the line of code. Whereas other kind of errors return full information. This small patch will fix this and make check_GNU_style.sh return full information when patch contains lines longer than 80 errors. Tested on patches containing >80 chars lines and the script produces full information as necessary. Would this be a useful enhancement for trunk? Mantas Mikaitis gcc/ChangeLog: * contrib/check_GNU_style.sh (col): Got rid of cut operation from the pipe chain and instead added cut inside awk command. diff --git a/contrib/check_GNU_style.sh b/contrib/check_GNU_style.sh index ef8fdda..c405eeb 100755 --- a/contrib/check_GNU_style.sh +++ b/contrib/check_GNU_style.sh @@ -86,8 +86,7 @@ col (){ shift 1 grep -nH '^+' $* \ | grep -v ':+++' \ - | cut -f 2 -d '+' \ - | awk '{ if (length ($0) > 80) print $0 }' \ + | awk -F':\\+' '{ if (length($2) > 80) print $0}' \ > $tmp if [ -s $tmp ]; then printf "\n$msg\n"
Re: [PATCH][ARM] __ARM_FP & __ARM_NEON_FP defined when -march=armv7-m
On 18/11/14 11:58, Richard Earnshaw wrote: On 18/11/14 11:30, Mantas Mikaitis wrote: Incorrect predefinitions for certain target architectures. E.g. arm7-m does not contain NEON but the defintion __ARM_NEON_FP was switched on. Similarly with armv6 and even armv2. This patch fixes the predefines for each of the different chips containing certain types of the FPU implementations. Tests: Tested on arm-none-linux-gnueabi and arm-none-linux-gnueabihf without any new regression. Manually compiled for various targets and all correct definitions were present. Is this patch ok for trunk? Mantas gcc/Changelog: * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_CPU_CPP_BUILTINS): Added second condition before defining __ARM_FP macro. ARM_DEFS.patch diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..325fea9 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -118,7 +118,7 @@ extern char arm_arch_name[]; if (TARGET_VFP) \ builtin_define ("__VFP_FP__"); \ \ - if (TARGET_ARM_FP) \ + if (TARGET_ARM_FP && !TARGET_SOFT_FLOAT)\ Wouldn't it be better to factor this into TARGET_ARM_FP? It seems odd that that macro returns a set of values based on something completely unavailable for the current compilation. That would also then mirror the behaviour of TARGET_NEON_FP (see below) and make the internal macros more consistent. R. Thank you. Patch updated. Ok for trunk? Mantas M. gcc/Changelog 2014-12-03 Mantas Mikaits * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_ARM_FP): Added !TARGET_SOFT_FLOAT into the conditional definition. gcc/testsuite/ChangeLog: * gcc.target/arm/macro_defs0.c: New test. * gcc.target/arm/macro_defs1.c: New test. * gcc.target/arm/macro_defs2.c: New test. diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..7d4cc39 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2343,17 +2343,17 @@ extern int making_const_table; point types. Where bit 1 indicates 16-bit support, bit 2 indicates 32-bit support, bit 3 indicates 64-bit support. */ #define TARGET_ARM_FP \ - (TARGET_VFP_SINGLE ? 4 \ - : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) + (!TARGET_SOFT_FLOAT ? (TARGET_VFP_SINGLE ? 4 \ + : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) \ + : 0) /* Set as a bit mask indicating the available widths of floating point types for hardware NEON floating point. This is the same as TARGET_ARM_FP without the 64-bit bit set. */ -#ifdef TARGET_NEON -#define TARGET_NEON_FP \ - (TARGET_ARM_FP & (0xff ^ 0x08)) -#endif +#define TARGET_NEON_FP \ + (TARGET_NEON ? (TARGET_ARM_FP & (0xff ^ 0x08)) \ + : 0) /* The maximum number of parallel loads or stores we support in an ldm/stm instruction. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c new file mode 100644 index 000..198243e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs0.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } {"-march=armv7-m"} } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ +/* { dg-options "-march=armv7-m -mcpu=cortex-m3 -mfloat-abi=soft -mthumb" } */ + +#ifdef __ARM_FP +#error __ARM_FP should not be defined +#endif + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c new file mode 100644 index 000..075b71b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-options "-march=armv6-m -mthumb" } */ + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif + diff --git a/gcc/testsuite/gcc.target/arm/macro_defs2.c b/gcc/testsuite/gcc.target/arm/macro_defs2.c new file mode 100644 index 000..9a96042 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv7ve -mcpu=cortex-a15 -mfpu=neon-vfpv4" } */ +/* { dg-add-options arm_neon } */ +/* { dg-require-effective-target arm_neon_ok } */ + +#ifndef __ARM_NEON_FP +#error __ARM_NEON_FP is not defined but should be +#endif + +#ifndef __ARM_FP +#error __ARM_FP is not defined but should be +#endif + +
[PATCH][ARM][testsuite] Fix FAIL: gcc.target/arm/macro_defs0.c and macro_defs1.c when -marm forced
Hello, Tests gcc.target/arm/macro_defs0.c and gcc.target/arm/macro_defs1.c fail in multilib which forces -marm as pointed out in this message: https://gcc.gnu.org/ml/gcc-patches/2015-02/msg00483.html . This patch will cause these tests to be classified as unsupported rather than FAIL. Ok for trunk? Kind regards, Mantas M. 2015-03-05 Mantas Mikaitis * gcc.target/arm/macro_defs0.c: added directive to skip test if -marm is present. * gcc.target/arm/macro_defs1.c: added directive to skip test if -marm is present.diff --git a/gcc/testsuite/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c index 962ff03..684d49f 100644 --- a/gcc/testsuite/gcc.target/arm/macro_defs0.c +++ b/gcc/testsuite/gcc.target/arm/macro_defs0.c @@ -1,6 +1,7 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv7-m" } } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ +/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ /* { dg-options "-march=armv7-m -mcpu=cortex-m3 -mfloat-abi=soft -mthumb" } */ #ifdef __ARM_FP diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c index d5423c7..4cc9ae6 100644 --- a/gcc/testsuite/gcc.target/arm/macro_defs1.c +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -1,5 +1,6 @@ /* { dg-do compile } */ /* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-skip-if "avoid conflicting multilib options" { *-*-* } { "-marm" } { "" } } */ /* { dg-options "-march=armv6-m -mthumb" } */ #ifdef __ARM_NEON_FP
[R220456][4.8] Backport the patch which fixes __ARM_FP & __ARM_NEON_FP predefines
Hello, This is a backport for gcc-4_8-branch of the patch " [PATCH][ARM] __ARM_FP & __ARM_NEON_FP defined when -march=armv7-m" posted in: https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00250.html arm-none-linux-gnueabi/hf tested without new regressions. OK for gcc-4_8-branch? Kind regards, Mantas M. gcc/ChangeLog: 2015-02-17 Mantas Mikaitis * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. *(TARGET_ARM_FP): Added !TARGET_SOFT_FLOAT into the conditional definition gcc/testsuite/ChangeLog: 2015-02-17 Mantas Mikaitis * gcc.target/arm/macro_defs0.c: New test. * gcc.target/arm/macro_defs1.c: New test. * gcc.target/arm/macro_defs2.c: New test. diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index b4947cd..03a63c1 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2293,17 +2293,17 @@ extern int making_const_table; point types. Where bit 1 indicates 16-bit support, bit 2 indicates 32-bit support, bit 3 indicates 64-bit support. */ #define TARGET_ARM_FP \ - (TARGET_VFP_SINGLE ? 4 \ - : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) + (!TARGET_SOFT_FLOAT ? (TARGET_VFP_SINGLE ? 4 \ + : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) \ + : 0) /* Set as a bit mask indicating the available widths of floating point types for hardware NEON floating point. This is the same as TARGET_ARM_FP without the 64-bit bit set. */ -#ifdef TARGET_NEON -#define TARGET_NEON_FP \ - (TARGET_ARM_FP & (0xff ^ 0x08)) -#endif +#define TARGET_NEON_FP \ + (TARGET_NEON ? (TARGET_ARM_FP & (0xff ^ 0x08)) \ + : 0) /* The maximum number of parallel loads or stores we support in an ldm/stm instruction. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c new file mode 100644 index 000..198243e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs0.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } {"-march=armv7-m"} } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ +/* { dg-options "-march=armv7-m -mcpu=cortex-m3 -mfloat-abi=soft -mthumb" } */ + +#ifdef __ARM_FP +#error __ARM_FP should not be defined +#endif + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c new file mode 100644 index 000..075b71b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-options "-march=armv6-m -mthumb" } */ + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif + diff --git a/gcc/testsuite/gcc.target/arm/macro_defs2.c b/gcc/testsuite/gcc.target/arm/macro_defs2.c new file mode 100644 index 000..8a8851d --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-mcpu=cortex-a15 -mfpu=neon-vfpv4" } */ +/* { dg-add-options arm_neon } */ +/* { dg-require-effective-target arm_neon_ok } */ + +#ifndef __ARM_NEON_FP +#error __ARM_NEON_FP is not defined but should be +#endif + +#ifndef __ARM_FP +#error __ARM_FP is not defined but should be +#endif + +
Re: [PATCH][ARM][PING] __ARM_FP & __ARM_NEON_FP defined when -march=armv7-m
On 08/02/15 15:20, Christophe Lyon wrote: On 3 February 2015 at 17:29, Richard Earnshaw wrote: On 06/01/15 09:40, Mantas Mikaitis wrote: Ping and changelog spaces removed. Thank you, Mantas M. On 18/11/14 11:58, Richard Earnshaw wrote: On 18/11/14 11:30, Mantas Mikaitis wrote: Incorrect predefinitions for certain target architectures. E.g. arm7-m does not contain NEON but the defintion __ARM_NEON_FP was switched on. Similarly with armv6 and even armv2. This patch fixes the predefines for each of the different chips containing certain types of the FPU implementations. Tests: Tested on arm-none-linux-gnueabi and arm-none-linux-gnueabihf without any new regression. Manually compiled for various targets and all correct definitions were present. Is this patch ok for trunk? Mantas gcc/Changelog: * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_CPU_CPP_BUILTINS): Added second condition before defining __ARM_FP macro. ARM_DEFS.patch diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..325fea9 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -118,7 +118,7 @@ extern char arm_arch_name[]; if (TARGET_VFP) \ builtin_define ("__VFP_FP__");\ \ - if (TARGET_ARM_FP) \ + if (TARGET_ARM_FP && !TARGET_SOFT_FLOAT)\ Wouldn't it be better to factor this into TARGET_ARM_FP? It seems odd that that macro returns a set of values based on something completely unavailable for the current compilation. That would also then mirror the behaviour of TARGET_NEON_FP (see below) and make the internal macros more consistent. R. Thank you. Patch updated. Ok for trunk? Mantas M. gcc/Changelog 2014-12-03 Mantas Mikaits * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_ARM_FP): Added !TARGET_SOFT_FLOAT into the conditional definition. gcc/testsuite/ChangeLog: * gcc.target/arm/macro_defs0.c: New test. * gcc.target/arm/macro_defs1.c: New test. * gcc.target/arm/macro_defs2.c: New test. OK. However, watch your ChangeLog line length (80 char limit). Also, entries (even continuation lines) should be indented with exactly one (hard) tab. R. mypatch.patch diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..7d4cc39 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2343,17 +2343,17 @@ extern int making_const_table; point types. Where bit 1 indicates 16-bit support, bit 2 indicates 32-bit support, bit 3 indicates 64-bit support. */ #define TARGET_ARM_FP\ - (TARGET_VFP_SINGLE ? 4 \ - : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) + (!TARGET_SOFT_FLOAT ? (TARGET_VFP_SINGLE ? 4 \ + : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) \ + : 0) /* Set as a bit mask indicating the available widths of floating point types for hardware NEON floating point. This is the same as TARGET_ARM_FP without the 64-bit bit set. */ -#ifdef TARGET_NEON -#define TARGET_NEON_FP \ - (TARGET_ARM_FP & (0xff ^ 0x08)) -#endif +#define TARGET_NEON_FP\ + (TARGET_NEON ? (TARGET_ARM_FP & (0xff ^ 0x08)) \ +: 0) /* The maximum number of parallel loads or stores we support in an ldm/stm instruction. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c new file mode 100644 index 000..198243e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs0.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } {"-march=armv7-m"} } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ +/* { dg-options "-march=armv7-m -mcpu=cortex-m3 -mfloat-abi=soft -mthumb" } */ + +#ifdef __ARM_FP +#error __ARM_FP should not be defined +#endif + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c new file mode 100644 index 000..075b71b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-options "-march=armv6-m -mthumb" } */ Minor comment: You are probably aware of that, but in a multilib which forces '-m
[R220456][4.9] Backport the patch which fixes __ARM_FP & __ARM_NEON_FP predefines
Hi all, This is a backport for gcc-4_9-branch of the patch " [PATCH][ARM] __ARM_FP & __ARM_NEON_FP defined when -march=armv7-m" posted in: https://gcc.gnu.org/ml/gcc-patches/2014-12/msg00250.html arm-none-linux-gnueabi/hf tested without any new regressions. OK for gcc-4_9-branch? gcc/ChangeLog: 2015-02-13 Mantas Mikaitis * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. *(TARGET_ARM_FP): Added !TARGET_SOFT_FLOAT into the conditional definition gcc/testsuite/ChangeLog: * gcc.target/arm/macro_defs0.c: New test. * gcc.target/arm/macro_defs1.c: New test. * gcc.target/arm/macro_defs2.c: New test.diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..7d4cc39 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2343,17 +2343,17 @@ extern int making_const_table; point types. Where bit 1 indicates 16-bit support, bit 2 indicates 32-bit support, bit 3 indicates 64-bit support. */ #define TARGET_ARM_FP \ - (TARGET_VFP_SINGLE ? 4 \ - : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) + (!TARGET_SOFT_FLOAT ? (TARGET_VFP_SINGLE ? 4 \ + : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) \ + : 0) /* Set as a bit mask indicating the available widths of floating point types for hardware NEON floating point. This is the same as TARGET_ARM_FP without the 64-bit bit set. */ -#ifdef TARGET_NEON -#define TARGET_NEON_FP \ - (TARGET_ARM_FP & (0xff ^ 0x08)) -#endif +#define TARGET_NEON_FP \ + (TARGET_NEON ? (TARGET_ARM_FP & (0xff ^ 0x08)) \ + : 0) /* The maximum number of parallel loads or stores we support in an ldm/stm instruction. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c new file mode 100644 index 000..198243e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs0.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } {"-march=armv7-m"} } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ +/* { dg-options "-march=armv7-m -mcpu=cortex-m3 -mfloat-abi=soft -mthumb" } */ + +#ifdef __ARM_FP +#error __ARM_FP should not be defined +#endif + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c new file mode 100644 index 000..075b71b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-options "-march=armv6-m -mthumb" } */ + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif + diff --git a/gcc/testsuite/gcc.target/arm/macro_defs2.c b/gcc/testsuite/gcc.target/arm/macro_defs2.c new file mode 100644 index 000..9a96042 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv7ve -mcpu=cortex-a15 -mfpu=neon-vfpv4" } */ +/* { dg-add-options arm_neon } */ +/* { dg-require-effective-target arm_neon_ok } */ + +#ifndef __ARM_NEON_FP +#error __ARM_NEON_FP is not defined but should be +#endif + +#ifndef __ARM_FP +#error __ARM_FP is not defined but should be +#endif + +
[PATCH][ARM][PING] __ARM_FP & __ARM_NEON_FP defined when -march=armv7-m
Ping. Thank you, Mantas M. On 18/11/14 11:58, Richard Earnshaw wrote: On 18/11/14 11:30, Mantas Mikaitis wrote: Incorrect predefinitions for certain target architectures. E.g. arm7-m does not contain NEON but the defintion __ARM_NEON_FP was switched on. Similarly with armv6 and even armv2. This patch fixes the predefines for each of the different chips containing certain types of the FPU implementations. Tests: Tested on arm-none-linux-gnueabi and arm-none-linux-gnueabihf without any new regression. Manually compiled for various targets and all correct definitions were present. Is this patch ok for trunk? Mantas gcc/Changelog: * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_CPU_CPP_BUILTINS): Added second condition before defining __ARM_FP macro. ARM_DEFS.patch diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..325fea9 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -118,7 +118,7 @@ extern char arm_arch_name[]; if (TARGET_VFP) \ builtin_define ("__VFP_FP__"); \ \ - if (TARGET_ARM_FP) \ + if (TARGET_ARM_FP && !TARGET_SOFT_FLOAT)\ Wouldn't it be better to factor this into TARGET_ARM_FP? It seems odd that that macro returns a set of values based on something completely unavailable for the current compilation. That would also then mirror the behaviour of TARGET_NEON_FP (see below) and make the internal macros more consistent. R. Thank you. Patch updated. Ok for trunk? Mantas M. gcc/Changelog 2014-12-03 Mantas Mikaits * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_ARM_FP): Added !TARGET_SOFT_FLOAT into the conditional definition. gcc/testsuite/ChangeLog: * gcc.target/arm/macro_defs0.c: New test. * gcc.target/arm/macro_defs1.c: New test. * gcc.target/arm/macro_defs2.c: New test. diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..7d4cc39 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2343,17 +2343,17 @@ extern int making_const_table; point types. Where bit 1 indicates 16-bit support, bit 2 indicates 32-bit support, bit 3 indicates 64-bit support. */ #define TARGET_ARM_FP \ - (TARGET_VFP_SINGLE ? 4 \ - : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) + (!TARGET_SOFT_FLOAT ? (TARGET_VFP_SINGLE ? 4 \ + : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) \ + : 0) /* Set as a bit mask indicating the available widths of floating point types for hardware NEON floating point. This is the same as TARGET_ARM_FP without the 64-bit bit set. */ -#ifdef TARGET_NEON -#define TARGET_NEON_FP \ - (TARGET_ARM_FP & (0xff ^ 0x08)) -#endif +#define TARGET_NEON_FP \ + (TARGET_NEON ? (TARGET_ARM_FP & (0xff ^ 0x08)) \ + : 0) /* The maximum number of parallel loads or stores we support in an ldm/stm instruction. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c new file mode 100644 index 000..198243e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs0.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } {"-march=armv7-m"} } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ +/* { dg-options "-march=armv7-m -mcpu=cortex-m3 -mfloat-abi=soft -mthumb" } */ + +#ifdef __ARM_FP +#error __ARM_FP should not be defined +#endif + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c new file mode 100644 index 000..075b71b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-options "-march=armv6-m -mthumb" } */ + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif + diff --git a/gcc/testsuite/gcc.target/arm/macro_defs2.c b/gcc/testsuite/gcc.target/arm/macro_defs2.c new file mode 100644 index 000..9a96042 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv7ve -mcpu=cortex-a15 -mfpu=neon-vfpv4" } */ +/* { dg-add-options arm_neon } */ +/* { dg-require-effective-target arm_neon_ok } */ + +#ifndef __ARM_NEON_FP +#error __ARM_NEON_FP is not defined but should be +#endif + +#ifndef __ARM_FP +#error __ARM_FP is not defined but should be +#endif + +
[PATCH][ARM][PING] __ARM_FP & __ARM_NEON_FP defined when -march=armv7-m
Ping and changelog spaces removed. Thank you, Mantas M. On 18/11/14 11:58, Richard Earnshaw wrote: On 18/11/14 11:30, Mantas Mikaitis wrote: Incorrect predefinitions for certain target architectures. E.g. arm7-m does not contain NEON but the defintion __ARM_NEON_FP was switched on. Similarly with armv6 and even armv2. This patch fixes the predefines for each of the different chips containing certain types of the FPU implementations. Tests: Tested on arm-none-linux-gnueabi and arm-none-linux-gnueabihf without any new regression. Manually compiled for various targets and all correct definitions were present. Is this patch ok for trunk? Mantas gcc/Changelog: * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_CPU_CPP_BUILTINS): Added second condition before defining __ARM_FP macro. ARM_DEFS.patch diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..325fea9 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -118,7 +118,7 @@ extern char arm_arch_name[]; if (TARGET_VFP) \ builtin_define ("__VFP_FP__"); \ \ - if (TARGET_ARM_FP) \ + if (TARGET_ARM_FP && !TARGET_SOFT_FLOAT)\ Wouldn't it be better to factor this into TARGET_ARM_FP? It seems odd that that macro returns a set of values based on something completely unavailable for the current compilation. That would also then mirror the behaviour of TARGET_NEON_FP (see below) and make the internal macros more consistent. R. Thank you. Patch updated. Ok for trunk? Mantas M. gcc/Changelog 2014-12-03 Mantas Mikaits * config/arm/arm.h (TARGET_NEON_FP): Removed conditional definition, define to zero if !TARGET_NEON. (TARGET_ARM_FP): Added !TARGET_SOFT_FLOAT into the conditional definition. gcc/testsuite/ChangeLog: * gcc.target/arm/macro_defs0.c: New test. * gcc.target/arm/macro_defs1.c: New test. * gcc.target/arm/macro_defs2.c: New test. diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h index ff4ddac..7d4cc39 100644 --- a/gcc/config/arm/arm.h +++ b/gcc/config/arm/arm.h @@ -2343,17 +2343,17 @@ extern int making_const_table; point types. Where bit 1 indicates 16-bit support, bit 2 indicates 32-bit support, bit 3 indicates 64-bit support. */ #define TARGET_ARM_FP \ - (TARGET_VFP_SINGLE ? 4 \ - : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) + (!TARGET_SOFT_FLOAT ? (TARGET_VFP_SINGLE ? 4 \ + : (TARGET_VFP_DOUBLE ? (TARGET_FP16 ? 14 : 12) : 0)) \ + : 0) /* Set as a bit mask indicating the available widths of floating point types for hardware NEON floating point. This is the same as TARGET_ARM_FP without the 64-bit bit set. */ -#ifdef TARGET_NEON -#define TARGET_NEON_FP \ - (TARGET_ARM_FP & (0xff ^ 0x08)) -#endif +#define TARGET_NEON_FP \ + (TARGET_NEON ? (TARGET_ARM_FP & (0xff ^ 0x08)) \ + : 0) /* The maximum number of parallel loads or stores we support in an ldm/stm instruction. */ diff --git a/gcc/testsuite/gcc.target/arm/macro_defs0.c b/gcc/testsuite/gcc.target/arm/macro_defs0.c new file mode 100644 index 000..198243e --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs0.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } {"-march=armv7-m"} } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-mfloat-abi=*" } { "-mfloat-abi=soft" } } */ +/* { dg-options "-march=armv7-m -mcpu=cortex-m3 -mfloat-abi=soft -mthumb" } */ + +#ifdef __ARM_FP +#error __ARM_FP should not be defined +#endif + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif diff --git a/gcc/testsuite/gcc.target/arm/macro_defs1.c b/gcc/testsuite/gcc.target/arm/macro_defs1.c new file mode 100644 index 000..075b71b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs1.c @@ -0,0 +1,9 @@ +/* { dg-do compile } */ +/* { dg-skip-if "avoid conflicting multilib options" + { *-*-* } { "-march=*" } { "-march=armv6-m" } } */ +/* { dg-options "-march=armv6-m -mthumb" } */ + +#ifdef __ARM_NEON_FP +#error __ARM_NEON_FP should not be defined +#endif + diff --git a/gcc/testsuite/gcc.target/arm/macro_defs2.c b/gcc/testsuite/gcc.target/arm/macro_defs2.c new file mode 100644 index 000..9a96042 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/macro_defs2.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-options "-march=armv7ve -mcpu=cortex-a15 -mfpu=neon-vfpv4" } */ +/* { dg-add-options arm_neon } */ +/* { dg-require-effective-target arm_neon_ok } */ + +#ifndef __ARM_NEON_FP +#error __ARM_NEON_FP is not defined but should be +#endif + +#ifndef __ARM_FP +#error __ARM_FP is not defined but should be +#endif + +
Re: [PATCHv3][PING] New check and updates in check_GNU_style script
On 26/12/14 06:46, Yury Gribov wrote: On 12/19/2014 11:14 AM, Yury Gribov wrote: Hi all, Attached patch adds new check (all blocks of 8 spaces are replaced with tabs) to contrib/check_GNU_style.sh. It also changes the script to allow reading patches from stdin and strengthens the "Dot, space, space, new sentence." check. Is this ok to commit? Ping. Hi, I for one find this patch very useful in the automated code review application I have made. Seeing that this was pinged 2 times and that I see this patch as adding useful functionality I would like to promote reviewing this. Thank you, Mantas M.