From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by sourceware.org (Postfix) with ESMTPS id DF5AC3858D3C for ; Wed, 22 Feb 2023 01:59:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DF5AC3858D3C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-pj1-x102a.google.com with SMTP id nt5-20020a17090b248500b00237161e33f4so4831923pjb.4 for ; Tue, 21 Feb 2023 17:59:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=6Ikhw7LA3c7wlIlNtPDhkWBAxXahvm2v/yKCzIY2gfw=; b=FThDGxyodFd5NIL4D4D6RTrp8HSTi8LPPTW7twZxYZVSVj+LCqr3cmD7xO9/+iILhN 96DIccHPYhgI9sMgVBjqj5+pkZB879HWK3V4pCOW+C213IzpHnWERkCNAMcFmg38wK/D tOtyWWjezlDEQv3DYpK0vYxD5MicpobsqnEIoUlP2831V/o3s1Os9wVrmOapzj9QwZu5 BK2lo4AcBv3l0DgfHSyN9u+HEdi+XQDyL1eRboKmoSFcoHm0HI5P8xU1xaRJ79jHYiB3 hjWXNMdCDh+Wq9SCJ2Eduh4bEz9e9e0LHkX9VROzDfpGEbgcEc93d2HOKSjadxkMGI6f Cssw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6Ikhw7LA3c7wlIlNtPDhkWBAxXahvm2v/yKCzIY2gfw=; b=S8hParwMrB/caelZKCE9/si17LDzlgwQmjTeacnYzh7pGqQ2SXHmh2FV/7Xpr1FL3R nAe3695mAufRmeKxQO8Ii0oAtTF5L8HZMaWcN+VPSw7cRZ42oSPmwTs30zqPgF7+D/P0 +/9cW/gUxFqm0INDJx3DxtTQdOD75cSkbqAyetVbbF/NvoU6kHTmF0FhDLpU5UmDsiqd L6p5Bj3l4Tj/0MMFWODO9JGmsfqyJTjIJSIJW5FBa+1b2Y1grone+ZKh10Ys3JG1dbDr JjSiSwPb1bHO/zD0ycX9FeaOcCPJHmJLUnewyqO9ISfB9P0ENuX6y9De57T1pM8Q275o KsKg== X-Gm-Message-State: AO0yUKX52bdLChHpyH/Qjclr/tCoLLzPDm121EkrkKWW559dSRb0qxr3 6D1WL+3ANEGIhWWaKxRi5cUgnQ== X-Google-Smtp-Source: AK7set9h5n04bWxQwnOk2YonjKwYcHlE46Uo0JURWqGXU+GHNlkx5MpGJUUXwDdHjjxCnfyDKh0LaQ== X-Received: by 2002:a05:6a20:7d86:b0:c6:6557:4edc with SMTP id v6-20020a056a207d8600b000c665574edcmr9103822pzj.61.1677031152748; Tue, 21 Feb 2023 17:59:12 -0800 (PST) Received: from localhost.localdomain (36-238-13-116.dynamic-ip.hinet.net. [36.238.13.116]) by smtp.gmail.com with ESMTPSA id q25-20020a656859000000b004d4547cc0f7sm3440670pgt.18.2023.02.21.17.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Feb 2023 17:59:12 -0800 (PST) From: Hau Hsu To: hau.hsu@sifive.com, kito.cheng@sifive.com, newlib@sourceware.org Subject: [PATCH 1/1] RISC-V: Use the new libm code if possible Date: Wed, 22 Feb 2023 09:59:07 +0800 Message-Id: <20230222015907.43288-1-hau.hsu@sifive.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-13.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,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: Set __OBSOLETE_MATH_DEFAULT to 0 if 'd' extension is supported (i.e. __riscv_flen == 64). Base on the comment for __OBSOLETE_MATH_DEFAULT: > ... it assumes that the toolchain has ISO C99 support (hexfloat > literals, standard fenv semantics), the target has IEEE-754 conforming > binary32 float and binary64 double (not mixed endian) representation, > standard SNaN representation, double and single precision arithmetics > has similar latency and it has no legacy SVID matherr support, only > POSIX errno and fenv exception based error handling. Signed-off-by: Hau Hsu --- newlib/libc/include/machine/ieeefp.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/newlib/libc/include/machine/ieeefp.h b/newlib/libc/include/machine/ieeefp.h index 9bb8af02f..a29557a6d 100644 --- a/newlib/libc/include/machine/ieeefp.h +++ b/newlib/libc/include/machine/ieeefp.h @@ -221,6 +221,11 @@ #ifdef __riscv_flen # define _SUPPORTS_ERREXCEPT #endif +#if __riscv_flen == 64 +# define __OBSOLETE_MATH_DEFAULT 0 +#else +# define __OBSOLETE_MATH_DEFAULT 1 +#endif #endif #ifdef __i960__ -- 2.39.0