summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-17 08:27:35 +0000
committernsz <nsz@138bc75d-0d04-0410-961f-82ee72b054a4>2016-06-17 08:27:35 +0000
commit6bbe07c4b32990e87d08fa66c25487de3d9c3388 (patch)
tree3300901c8f9635bb50a019e3b2ddfedd5d5aef57
parentaaa3e29d80003b200f0dfea5dcf88d173daa2769 (diff)
downloadgcc-6bbe07c4b32990e87d08fa66c25487de3d9c3388.tar.gz
[AArch64] Handle iterator definitions with conditionals in geniterator.sh
gcc/ 2016-06-17 Szabolcs Nagy <szabolcs.nagy@arm.com> * config/aarch64/geniterators.sh: Handle parenthesised conditions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237548 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog4
-rw-r--r--gcc/config/aarch64/geniterators.sh21
2 files changed, 19 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f22ac889bff..f6ca6f6163c 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,7 @@
+2016-06-17 Szabolcs Nagy <szabolcs.nagy@arm.com>
+
+ * config/aarch64/geniterators.sh: Handle parenthesised conditions.
+
2016-06-16 John David Anglin <danglin@gcc.gnu.org>
* config/pa/pa.c (pa_output_pic_pcrel_sequence): New.
diff --git a/gcc/config/aarch64/geniterators.sh b/gcc/config/aarch64/geniterators.sh
index ec1b1ea539a..8baa244009c 100644
--- a/gcc/config/aarch64/geniterators.sh
+++ b/gcc/config/aarch64/geniterators.sh
@@ -23,10 +23,7 @@
# BUILTIN_<ITERATOR> macros, which expand to VAR<N> Macros covering the
# same set of modes as the iterator in iterators.md
#
-# Find the <ITERATOR> definitions (may span several lines), skip the ones
-# which does not have a simple format because it contains characters we
-# don't want to or can't handle (e.g P, PTR iterators change depending on
-# Pmode and ptr_mode).
+# Find the <ITERATOR> definitions (may span several lines).
LC_ALL=C awk '
BEGIN {
print "/* -*- buffer-read-only: t -*- */"
@@ -49,12 +46,24 @@ iterdef {
sub(/.*\(define_mode_iterator/, "", s)
}
-iterdef && s ~ /\)/ {
+iterdef {
+ # Count the parentheses, the iterator definition ends
+ # if there are more closing ones than opening ones.
+ nopen = gsub(/\(/, "(", s)
+ nclose = gsub(/\)/, ")", s)
+ if (nopen >= nclose)
+ next
+
iterdef = 0
gsub(/[ \t]+/, " ", s)
- sub(/ *\).*/, "", s)
+ sub(/ *\)[^)]*$/, "", s)
sub(/^ /, "", s)
+
+ # Drop the conditions.
+ gsub(/ *"[^"]*" *\)/, "", s)
+ gsub(/\( */, "", s)
+
if (s !~ /^[A-Za-z0-9_]+ \[[A-Z0-9 ]*\]$/)
next
sub(/\[ */, "", s)