From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by sourceware.org (Postfix) with ESMTP id 18C7D38582BB for ; Wed, 13 Jul 2022 07:51:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 18C7D38582BB Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=loongson.cn Received: from [10.20.4.187] (unknown [10.20.4.187]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Dxz9B3ec5iqhAbAA--.18497S3; Wed, 13 Jul 2022 15:51:20 +0800 (CST) Subject: Re: [PATCH v6 11/13] LoongArch: Build Infastructure To: WANG Xuerui , Xi Ruoyao , libc-alpha@sourceware.org Cc: adhemerval.zanella@linaro.or, joseph_myers@mentor.com References: <20220708065255.2316410-1-caiyinyu@loongson.cn> <20220708065255.2316410-12-caiyinyu@loongson.cn> <7eabd567-a222-13ad-349e-ab9ea1b4a29f@xen0n.name> From: caiyinyu Message-ID: Date: Wed, 13 Jul 2022 15:51:19 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <7eabd567-a222-13ad-349e-ab9ea1b4a29f@xen0n.name> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: AQAAf9Dxz9B3ec5iqhAbAA--.18497S3 X-Coremail-Antispam: 1UD129KBjvJXoWxZF47tF4fWFWDKF45Cw13XFb_yoWrJry3pr yIkFn8trW8J3Z2grnxt34YvFyDtFyxWw4UXF1FqFy8CF4UArnYvr18WrnIg3W7Xw4rGr1j qrWxtw4jvFW3AFUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvYb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r1j6r4UM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Ar0_tr1l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Cr0_Gr1UM28EF7xvwVC2z280aVAFwI0_Cr1j6rxdM28EF7xvwV C2z280aVCY1x0267AKxVW0oVCq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC 0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr 1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JMxk0xIA0c2IEe2xFo4CEbIxvr21l c2xSY4AK6svPMxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I 8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWU twCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x 0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq3wCI42IY6I8E87Iv67AK xVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIdaVFxhVjvjDU0xZFpf9x07 bOoGdUUUUU= X-CM-SenderInfo: 5fdl5xhq1xqz5rrqw2lrqou0/ X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, BODY_8BITS, GIT_PATCH_0, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_PASS, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jul 2022 07:51:24 -0000 在 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         ;;      *) <<<<<<