[PATCH] gcc: rename floatformat_ia64_quad_{big, little} to floatformat_ieee_quad_{big, little}

2022-03-13 Thread Tiezhu Yang
I submitted a GDB patch [1] to rename floatformats_ia64_quad to
floatformats_ieee_quad to reflect the reality, and then we can
clean up the related code.

As GDB Global Maintainer Tom Tromey said [2]:

  These files are maintained in gcc and then imported into the
  binutils-gdb repository, so any changes to them will have to
  be proposed there first.

this GCC patch is preparation for the GDB patch, no functionality
change.

[1] https://sourceware.org/pipermail/gdb-patches/2022-March/186452.html
[2] https://sourceware.org/pipermail/gdb-patches/2022-March/186569.html

Signed-off-by: Tiezhu Yang 
---

Hi GCC Maintainers,

I have no write access of gcc.git, if you are OK with this change,
could you please help me to merge this patch to the gcc master?
Thank you.

 include/floatformat.h   |  6 +++---
 libiberty/floatformat.c | 34 +-
 2 files changed, 20 insertions(+), 20 deletions(-)

diff --git a/include/floatformat.h b/include/floatformat.h
index 5c18ebf..291acd4 100644
--- a/include/floatformat.h
+++ b/include/floatformat.h
@@ -97,7 +97,7 @@ struct floatformat
   const struct floatformat *split_half;
 };
 
-/* floatformats for IEEE single and double, big and little endian.  */
+/* floatformats for IEEE half, single, double and quad, big and little endian. 
 */
 
 extern const struct floatformat floatformat_ieee_half_big;
 extern const struct floatformat floatformat_ieee_half_little;
@@ -105,6 +105,8 @@ extern const struct floatformat floatformat_ieee_single_big;
 extern const struct floatformat floatformat_ieee_single_little;
 extern const struct floatformat floatformat_ieee_double_big;
 extern const struct floatformat floatformat_ieee_double_little;
+extern const struct floatformat floatformat_ieee_quad_big;
+extern const struct floatformat floatformat_ieee_quad_little;
 
 /* floatformat for ARM IEEE double, little endian bytes and big endian words */
 
@@ -128,8 +130,6 @@ extern const struct floatformat 
floatformat_arm_ext_littlebyte_bigword;
 /* IA-64 Floating Point register spilt into memory.  */
 extern const struct floatformat floatformat_ia64_spill_big;
 extern const struct floatformat floatformat_ia64_spill_little;
-extern const struct floatformat floatformat_ia64_quad_big;
-extern const struct floatformat floatformat_ia64_quad_little;
 /* IBM long double (double+double).  */
 extern const struct floatformat floatformat_ibm_long_double_big;
 extern const struct floatformat floatformat_ibm_long_double_little;
diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index ce36bae..f93568b 100644
--- a/libiberty/floatformat.c
+++ b/libiberty/floatformat.c
@@ -78,7 +78,7 @@ floatformat_always_valid (const struct floatformat *fmt 
ATTRIBUTE_UNUSED,
a system header, what we do if not, etc.  */
 #define FLOATFORMAT_CHAR_BIT 8
 
-/* floatformats for IEEE half, single and double, big and little endian.  */
+/* floatformats for IEEE half, single, double and quad, big and little endian. 
 */
 const struct floatformat floatformat_ieee_half_big =
 {
   floatformat_big, 16, 0, 1, 5, 15, 31, 6, 10,
@@ -127,6 +127,22 @@ const struct floatformat floatformat_ieee_double_little =
   floatformat_always_valid,
   NULL
 };
+const struct floatformat floatformat_ieee_quad_big =
+{
+  floatformat_big, 128, 0, 1, 15, 16383, 0x7fff, 16, 112,
+  floatformat_intbit_no,
+  "floatformat_ieee_quad_big",
+  floatformat_always_valid,
+  NULL
+};
+const struct floatformat floatformat_ieee_quad_little =
+{
+  floatformat_little, 128, 0, 1, 15, 16383, 0x7fff, 16, 112,
+  floatformat_intbit_no,
+  "floatformat_ieee_quad_little",
+  floatformat_always_valid,
+  NULL
+};
 
 /* floatformat for IEEE double, little endian byte order, with big endian word
ordering, as on the ARM.  */
@@ -269,22 +285,6 @@ const struct floatformat floatformat_ia64_spill_little =
   floatformat_always_valid,
   NULL
 };
-const struct floatformat floatformat_ia64_quad_big =
-{
-  floatformat_big, 128, 0, 1, 15, 16383, 0x7fff, 16, 112,
-  floatformat_intbit_no,
-  "floatformat_ia64_quad_big",
-  floatformat_always_valid,
-  NULL
-};
-const struct floatformat floatformat_ia64_quad_little =
-{
-  floatformat_little, 128, 0, 1, 15, 16383, 0x7fff, 16, 112,
-  floatformat_intbit_no,
-  "floatformat_ia64_quad_little",
-  floatformat_always_valid,
-  NULL
-};
 
 static int
 floatformat_ibm_long_double_is_valid (const struct floatformat *fmt,
-- 
2.1.0



[PATCH] gcc: download_prerequisites: add --verbose and --no-verbose

2024-12-03 Thread Tiezhu Yang
When executing the script download_prerequisites, the download speed may
be extremely slow and there is no any output, the users do not know what
happened.

Given the command wget and curl have options --verbose and --no-verbose,
add them for download_prerequisites to give a chance to see the details.

contrib/ChangeLog:

* download_prerequisites
(helptext): Document --verbose and --no-verbose.
: Parse --verbose and --no-verbose.
: Set option for wget and curl.

Signed-off-by: Tiezhu Yang 
---
 contrib/download_prerequisites | 28 ++--
 1 file changed, 22 insertions(+), 6 deletions(-)

diff --git a/contrib/download_prerequisites b/contrib/download_prerequisites
index 6adc97ef896..7a42bf141b0 100755
--- a/contrib/download_prerequisites
+++ b/contrib/download_prerequisites
@@ -48,13 +48,9 @@ graphite=1
 verify=1
 force=0
 only_gettext=false
+verbose=0
 OS=$(uname)
 
-if type wget > /dev/null ; then
-  fetch='wget'
-else
-  fetch='curl -LO'
-fi
 chksum_extension='sha512'
 directory='.'
 
@@ -77,6 +73,8 @@ The following options are available:
  --sha512 use SHA512 checksum to verify package integrity (default)
  --md5use MD5 checksum to verify package integrity
  --only-gettext   inhibit downloading any package but gettext
+ --verbosemake the operation more talkative
+ --no-verbose turn off verboseness, without being quiet (default)
  --help   show this text and exit
  --versionshow version information and exit
 "
@@ -165,6 +163,12 @@ do
 --only-gettext)
 only_gettext=true
 ;;
+--verbose)
+verbose=1
+;;
+--no-verbose)
+verbose=0
+;;
 -*)
 die "unknown option: ${arg}"
 ;;
@@ -227,11 +231,23 @@ esac
 [ -d "${directory}" ] \
 || die "No such directory: ${directory}"
 
+if [ ${verbose} -gt 0 ]; then
+  option="--verbose"
+else
+  option="--no-verbose"
+fi
+
+if type wget > /dev/null ; then
+  fetch="wget ${option}"
+else
+  fetch="curl -LO ${option}"
+fi
+
 for ar in $(echo_archives)
 do
 if [ ${force} -gt 0 ]; then rm -f "${directory}/${ar}"; fi
 [ -e "${directory}/${ar}" ]   \
-|| ( cd "${directory}" && ${fetch} --no-verbose "${base_url}${ar}" )  \
+|| ( cd "${directory}" && ${fetch} "${base_url}${ar}" )   \
 || die "Cannot download ${ar} from ${base_url}"
 done
 unset ar
-- 
2.42.0



Re: [PATCH] gcc: download_prerequisites: add --verbose and --no-verbose

2024-12-03 Thread Tiezhu Yang

On 12/03/2024 09:12 PM, Eric Gallager wrote:

On Tue, Dec 3, 2024 at 7:09 AM Tiezhu Yang  wrote:


When executing the script download_prerequisites, the download speed may
be extremely slow and there is no any output, the users do not know what
happened.

Given the command wget and curl have options --verbose and --no-verbose,
add them for download_prerequisites to give a chance to see the details.



For how long have they had these options? My curl (8.10.1) doesn't
seem to be listing `--no-verbose` among its `--help all` list of
options...


In the curl man page [1] or "curl --manual | grep no-verbose",
there is "--no-verbose", but there is no this option in the
output of "curl --help". I do not know the internal history.

When executing the curl command, "--no-verbose" is a valid
option but seems no effect like the option "--silent".

In the current code, "curl -LO --no-verbose" looks like
somehow unreasonable, the output is not expected. Since
wget is a frequently-used command, is it possible to
remove the curl command in download_prerequisites?

I will send v2 to do this for your review.

[1] https://curl.se/docs/manpage.html#-v

Thanks,
Tiezhu



Re: [PATCH] gcc: download_prerequisites: add --verbose and --no-verbose

2024-12-03 Thread Tiezhu Yang

On 12/04/2024 10:33 AM, Xi Ruoyao wrote:

On Wed, 2024-12-04 at 10:28 +0800, Tiezhu Yang wrote:

On 12/03/2024 09:12 PM, Eric Gallager wrote:

On Tue, Dec 3, 2024 at 7:09 AM Tiezhu Yang  wrote:


When executing the script download_prerequisites, the download speed may
be extremely slow and there is no any output, the users do not know what
happened.

Given the command wget and curl have options --verbose and --no-verbose,
add them for download_prerequisites to give a chance to see the details.



For how long have they had these options? My curl (8.10.1) doesn't
seem to be listing `--no-verbose` among its `--help all` list of
options...


In the curl man page [1] or "curl --manual | grep no-verbose",
there is "--no-verbose", but there is no this option in the
output of "curl --help". I do not know the internal history.

When executing the curl command, "--no-verbose" is a valid
option but seems no effect like the option "--silent".

In the current code, "curl -LO --no-verbose" looks like
somehow unreasonable, the output is not expected. Since
wget is a frequently-used command, is it possible to
remove the curl command in download_prerequisites?


Doing so may force many running CI systems to update their container
image.  Don't do that.

AFAIK --no-verbose just cancels out a prior --verbose and it's not same
as --quiet.  I.e. there are 3 different console output levels, --quiet,
--no-verbose (the default), and --verbose.

Try "curl --verbose example.org -Lo /dev/null", "curl example.org -Lo
/dev/null", and "curl --silent example.org -Lo /dev/null" yourself.


Thanks for your explanation. I tried to run the above three commands,
the output is different.

So if I understand correctly, "--no-verbose" is a valid option for curl
and wget, there is no need to change this patch.

Cc more Global Reviewers who can approve these changes.

https://inbox.sourceware.org/gcc-patches/20241203120801.15317-1-yangtie...@loongson.cn/

Thanks,
Tiezhu