From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oi1-x22e.google.com (mail-oi1-x22e.google.com [IPv6:2607:f8b0:4864:20::22e]) by sourceware.org (Postfix) with ESMTPS id A5E0F3858C66 for ; Wed, 15 Feb 2023 13:47:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A5E0F3858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-oi1-x22e.google.com with SMTP id cz14so15798337oib.12 for ; Wed, 15 Feb 2023 05:47:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=j6jfAZf8TIfGQUZWnU9NQ7SzpL/Lm6OpJkzzZ7bgERM=; b=sVUkSXUSqJ8Gvk2j/5/fOXvDup0L1aGtE4lR3sK5AdnXcdNbOpVFWKwKV3x4g94iwK 6W2K0RiSgBNRjoWMuvOZni1oqXrm8q6ZBOaPciuDQIqmJkHcJ7INmUiSL2jRjL9Ep0la p49/2gfVFA7e497wQ2TYo+3+oGROm8Wdq4M+zszcuEhyWWpxujPX/uew7N0Nq8573ekl 3ojmX4Jlw8BbwW8y7B4nvICf8TdMYOcVqy39t7yXPawF4PUZL87wb0qtCw4xQKDAW9Em 9l/m/Rc16wnEH7mPMXt+I7MCjkKP4Y70vHXkPQNYDDupK+K1IZf+abJ1BG1bFBJNCxUT mFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=j6jfAZf8TIfGQUZWnU9NQ7SzpL/Lm6OpJkzzZ7bgERM=; b=tLYhfEqK31qN4Sj0jkilGBWxpCkFu2fDZotH78QMpv4002wXD3t7A4jr7CYVy3yMMM a4rhM0TMVVxtI+tqMYGnckrgcrijySYxOXW7GcbTMb5b5caC3tmMOq3jHiLiw0+f6Y6Z ee3lfaZ5oc9PyQQePVebPiZEm22BogdYFMcHlkmvbQnIuZtctj0vvGmxO9Kmd9bMYqyd W+EbgZM1kTnrmi5QEb3U1P9AVFYUPkWQwjaQCtW01XeF1RYC0abs604MUhLyVb8I/rez hdrZsMw5FOH6dkAfaVwLS6jXDGsnuvLe2shz7E9UUBctElPmYS+Rp3kT4mfabxktJKMx osPg== X-Gm-Message-State: AO0yUKXCsHgkzn5uICc01ceHqy0GwKjPhrLxwgGeQ/wwJ0oP9hy+1VYd 7zsllyvaQ4NIP9YQOXjzlj8ABXp6xXI64xk4DeE= X-Google-Smtp-Source: AK7set+M2ydnanDclQ3IZpzhA/Zg1vBdRsVMeoNzdTJTnNkvi5We1uiUEaesCIyBASz7iG/af7Q1ag== X-Received: by 2002:aca:121a:0:b0:368:69d3:ac82 with SMTP id 26-20020aca121a000000b0036869d3ac82mr662266ois.17.1676468863639; Wed, 15 Feb 2023 05:47:43 -0800 (PST) Received: from ?IPV6:2804:1b3:a7c3:3a5:44ad:5aad:f16a:f333? ([2804:1b3:a7c3:3a5:44ad:5aad:f16a:f333]) by smtp.gmail.com with ESMTPSA id g1-20020a0568080dc100b0037d8bffbe76sm3903629oic.57.2023.02.15.05.47.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 15 Feb 2023 05:47:42 -0800 (PST) Message-ID: <617e860d-9bf3-ddc0-8791-655e611ad7ac@linaro.org> Date: Wed, 15 Feb 2023 10:47:40 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.7.2 Subject: Re: [PATCH] LoongArch: Add math-barriers.h Content-Language: en-US To: Xi Ruoyao , libc-alpha@sourceware.org Cc: caiyinyu , Wang Xuerui References: <20230214085713.44338-1-xry111@xry111.site> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: <20230214085713.44338-1-xry111@xry111.site> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_SHORT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 14/02/23 05:57, Xi Ruoyao via Libc-alpha wrote: > This patch implements the LoongArch specific math barriers in order to omit > the store and load from stack if possible. LGTM, I have not see any regression with qemu. As a side note, math/test-fenv shows a failure so you might take a look, you might need to update ULPs as well. Reviewed-by: Adhemerval Zanella > > Signed-off-by: Xi Ruoyao We do not use signed-off-by, so no need to add it. > --- > sysdeps/loongarch/fpu/math-barriers.h | 28 +++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > create mode 100644 sysdeps/loongarch/fpu/math-barriers.h > > diff --git a/sysdeps/loongarch/fpu/math-barriers.h b/sysdeps/loongarch/fpu/math-barriers.h > new file mode 100644 > index 0000000000..3e977e43a6 > --- /dev/null > +++ b/sysdeps/loongarch/fpu/math-barriers.h > @@ -0,0 +1,28 @@ > +/* Control when floating-point expressions are evaluated. LoongArch version. > + Copyright (C) 2023 Free Software Foundation, Inc. > + This file is part of the GNU C Library. > + > + The GNU C Library is free software; you can redistribute it and/or > + modify it under the terms of the GNU Lesser General Public > + License as published by the Free Software Foundation; either > + version 2.1 of the License, or (at your option) any later version. > + > + The GNU C Library is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU > + Lesser General Public License for more details. > + > + You should have received a copy of the GNU Lesser General Public > + License along with the GNU C Library; if not, see > + . */ > + > +#ifndef _LOONGARCH_MATH_BARRIERS_H > +#define _LOONGARCH_MATH_BARRIERS_H 1 > + > +/* Generic code forces values to memory; we don't need to do that. */ > +#define math_opt_barrier(x) \ > + ({ __typeof (x) __x = (x); __asm ("" : "+frm" (__x)); __x; }) > +#define math_force_eval(x) \ > + ({ __typeof (x) __x = (x); __asm __volatile__ ("" : : "frm" (__x)); }) > + > +#endif /* math-barriers.h */