public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: caiyinyu <caiyinyu@loongson.cn>
To: WANG Xuerui <i.swmail@xen0n.name>, Xi Ruoyao <xry111@xry111.site>,
	libc-alpha@sourceware.org
Cc: adhemerval.zanella@linaro.or, joseph_myers@mentor.com
Subject: Re: [PATCH v6 11/13] LoongArch: Build Infastructure
Date: Wed, 13 Jul 2022 15:51:19 +0800	[thread overview]
Message-ID: <aa98b986-9e3b-e6ef-941e-718816f7fa6c@loongson.cn> (raw)
In-Reply-To: <7eabd567-a222-13ad-349e-ab9ea1b4a29f@xen0n.name>


在 2022/7/13 上午11:43, WANG Xuerui 写道:
> On 2022/7/13 11:07, Xi Ruoyao wrote:
>> On Fri, 2022-07-08 at 14:52 +0800, caiyinyu wrote:
>>> grlen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 
>>> 's/^#define __loongarch_grlen \(.*\)/\1/p'`
>> I suggest to use "__loongarch_lp64" for checking ABI grlen. Consider:
>>
>> "gcc -march=la464 -mabi=ilp32d ..."
>>
>> Once ILP32 ABIs are available, will __loongarch_grlen be 64 or 32 in
>> this case, where the hardware has 64-bit registers but the ABI uses them
>> as 32-bit?  Our documentation is not clear about this question and
>> currently we understand __loongarch_grlen as hardware GR length instead
>> of the register length used in ABI [1].
>>
>> [1]:https://github.com/loongson/LoongArch-Documentation/pull/28#discussion_r917364055 
>>
>>
>> OTOH if you think "we should define __loongarch_grlen as the register
>> length for ABI, irrelevant to the hardware", you need to inform your
>> colleagues to clarify it in the doc.
>
> To my intuition it's the hardware GRLEN, but thinking about it harder, 
> there is indeed ambiguity. Some clarification would be useful here.
>
> (BTW, Yinyu, could you keep me CC-ed when sending your next revisions? 
> I'd like to take a quick review to ensure there are as few historical 
> warts as possible when the patchset get updated.)


Fixed, thanks.

 >>>>>>>>>

diff --git a/sysdeps/loongarch/preconfigure b/sysdeps/loongarch/preconfigure
index 489af6f0b7..118963cda6 100644
--- a/sysdeps/loongarch/preconfigure
+++ b/sysdeps/loongarch/preconfigure
@@ -4,7 +4,7 @@
  case "$machine" in
  loongarch*)

-    grlen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 
's/^#define __loongarch_grlen \(.*\)/\1/p'`
+    abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 
's/^#define __loongarch_\(lp64\|ilp32\).*/\1/p'`
      float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 
's/^#define __loongarch_\(soft\|single\|double\)_float.*/\1/p'`

      with_fp_cond="!defined __loongarch_soft_float"
@@ -25,11 +25,12 @@ loongarch*)
         ;;
      esac

-    case "$grlen" in
-    32)
+    case "$abi" in
+    ilp32)
         as_fn_error 1 "loongarch does not yet support ilp32 ABI!!" 
"$LINENO" 5
         ;;
-    64)
+    lp64)
+       grlen=64
         machine=loongarch/lp64
         ;;
      *)
diff --git a/sysdeps/loongarch/preconfigure.ac 
b/sysdeps/loongarch/preconfigure.ac
index 8eb94e9efe..1aba743c15 100644
--- a/sysdeps/loongarch/preconfigure.ac
+++ b/sysdeps/loongarch/preconfigure.ac
@@ -4,7 +4,7 @@ GLIBC_PROVIDES[]dnl See aclocal.m4 in the top level 
source directory.
  case "$machine" in
  loongarch*)

-    grlen=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 
's/^#define __loongarch_grlen \(.*\)/\1/p'`
+    abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 
's/^#define __loongarch_\(lp64\|ilp32\).*/\1/p'`
      float_abi=`$CC $CFLAGS $CPPFLAGS -E -dM -xc /dev/null | sed -n 
's/^#define __loongarch_\(soft\|single\|double\)_float.*/\1/p'`

      with_fp_cond="!defined __loongarch_soft_float"
@@ -25,11 +25,12 @@ loongarch*)
         ;;
      esac

-    case "$grlen" in
-    32)
+    case "$abi" in
+    ilp32)
         AC_MSG_ERROR([loongarch does not yet support ilp32 ABI!!], 1)
         ;;
-    64)
+    lp64)
+       grlen=64
         machine=loongarch/lp64
         ;;
      *)

<<<<<<


  reply	other threads:[~2022-07-13  7:51 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-08  6:52 [PATCH v6 00/13] GLIBC LoongArch PATCHES caiyinyu
2022-07-08  6:52 ` [PATCH v6 01/13] LoongArch: Update NEWS and README for the LoongArch port caiyinyu
2022-07-12 11:06   ` Adhemerval Zanella Netto
2022-07-08  6:52 ` [PATCH v6 02/13] LoongArch: Add LoongArch entries to config.h.in caiyinyu
2022-07-12 18:51   ` Adhemerval Zanella Netto
2022-07-08  6:52 ` [PATCH v6 03/13] LoongArch: Add relocations and ELF flags to elf.h and scripts/glibcelf.py caiyinyu
2022-07-12 19:27   ` Adhemerval Zanella Netto
2022-07-08  6:52 ` [PATCH v6 04/13] LoongArch: ABI Implementation caiyinyu
2022-07-12 20:39   ` Adhemerval Zanella Netto
2022-07-15  1:46     ` caiyinyu
2022-07-08  6:52 ` [PATCH v6 05/13] LoongArch: Thread-Local Storage Support caiyinyu
2022-07-13 13:10   ` Adhemerval Zanella Netto
2022-07-08  6:52 ` [PATCH v6 06/13] LoongArch: Generic <math.h> and soft-fp Routines caiyinyu
2022-07-13 13:25   ` Adhemerval Zanella Netto
2022-07-08  6:52 ` [PATCH v6 07/13] LoongArch: Atomic and Locking Routines caiyinyu
2022-07-13 13:53   ` Adhemerval Zanella Netto
2022-07-15  1:46     ` caiyinyu
2022-07-08  6:52 ` [PATCH v6 08/13] LoongArch: Linux Syscall Interface caiyinyu
2022-07-13 16:19   ` Adhemerval Zanella Netto
2023-09-13 11:05     ` caiyinyu
2022-07-08  6:52 ` [PATCH v6 09/13] LoongArch: Linux ABI caiyinyu
2022-07-13 16:35   ` Adhemerval Zanella Netto
2022-07-15  1:48     ` caiyinyu
2022-07-08  6:52 ` [PATCH v6 10/13] LoongArch: Add ABI Lists caiyinyu
2022-07-13 17:12   ` Adhemerval Zanella Netto
2022-07-08  6:52 ` [PATCH v6 11/13] LoongArch: Build Infastructure caiyinyu
2022-07-13  3:07   ` Xi Ruoyao
2022-07-13  3:43     ` WANG Xuerui
2022-07-13  7:51       ` caiyinyu [this message]
2022-07-13 17:48   ` Adhemerval Zanella Netto
2022-07-15  1:49     ` caiyinyu
2022-07-08  6:52 ` [PATCH v6 12/13] LoongArch: Hard Float Support caiyinyu
2022-07-13 19:22   ` Adhemerval Zanella Netto
2022-07-14 13:00     ` caiyinyu
2022-07-08  7:13 ` [PATCH v6 00/13] GLIBC LoongArch PATCHES Xi Ruoyao
2022-07-08  7:15   ` Xi Ruoyao
2022-07-13 19:55   ` Adhemerval Zanella Netto
2022-07-14 11:33     ` Xi Ruoyao
2022-07-14 12:11       ` Adhemerval Zanella Netto
2022-07-18 13:54 ` Carlos O'Donell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aa98b986-9e3b-e6ef-941e-718816f7fa6c@loongson.cn \
    --to=caiyinyu@loongson.cn \
    --cc=adhemerval.zanella@linaro.or \
    --cc=i.swmail@xen0n.name \
    --cc=joseph_myers@mentor.com \
    --cc=libc-alpha@sourceware.org \
    --cc=xry111@xry111.site \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).