48 lines
1.3 KiB
Diff
48 lines
1.3 KiB
Diff
|
|
From 3b95d64e62dc1884da153f37a14753c3a74751e8 Mon Sep 17 00:00:00 2001
|
||
|
|
From: Yang Yujie <yangyujie@loongson.cn>
|
||
|
|
Date: Tue, 23 Jul 2024 10:04:26 +0800
|
||
|
|
Subject: [PATCH 14/20] LoongArch: Remove gawk extension from a generator
|
||
|
|
script.
|
||
|
|
|
||
|
|
gcc/ChangeLog:
|
||
|
|
|
||
|
|
* config/loongarch/genopts/gen-evolution.awk: Do not use
|
||
|
|
"length()" to compute the size of an array.
|
||
|
|
---
|
||
|
|
gcc/config/loongarch/genopts/gen-evolution.awk | 7 ++++---
|
||
|
|
1 file changed, 4 insertions(+), 3 deletions(-)
|
||
|
|
|
||
|
|
diff --git a/gcc/config/loongarch/genopts/gen-evolution.awk b/gcc/config/loongarch/genopts/gen-evolution.awk
|
||
|
|
index 4d105afa9..1c8004e41 100644
|
||
|
|
--- a/gcc/config/loongarch/genopts/gen-evolution.awk
|
||
|
|
+++ b/gcc/config/loongarch/genopts/gen-evolution.awk
|
||
|
|
@@ -1,4 +1,4 @@
|
||
|
|
-#!/usr/bin/gawk
|
||
|
|
+#!/usr/bin/awk -f
|
||
|
|
#
|
||
|
|
# A simple script that generates loongarch-evolution.h
|
||
|
|
# from genopts/isa-evolution.in
|
||
|
|
@@ -94,8 +94,9 @@ function gen_cpucfg_useful_idx()
|
||
|
|
idx_bucket[cpucfg_word[i]] = 1
|
||
|
|
|
||
|
|
delete idx_list
|
||
|
|
+ j = 1
|
||
|
|
for (i in idx_bucket)
|
||
|
|
- idx_list[length(idx_list)-1] = i+0
|
||
|
|
+ idx_list[j++] = i+0
|
||
|
|
delete idx_bucket
|
||
|
|
|
||
|
|
asort (idx_list)
|
||
|
|
@@ -108,7 +109,7 @@ function gen_cpucfg_useful_idx()
|
||
|
|
print ""
|
||
|
|
|
||
|
|
printf ("static constexpr int N_CPUCFG_WORDS = %d;\n",
|
||
|
|
- idx_list[length(idx_list)] + 1)
|
||
|
|
+ idx_list[j - 1] + 1)
|
||
|
|
|
||
|
|
delete idx_list
|
||
|
|
}
|
||
|
|
--
|
||
|
|
2.43.0
|
||
|
|
|