From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by sourceware.org (Postfix) with ESMTPS id 608693858036 for ; Wed, 28 Oct 2020 15:42:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 608693858036 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sifive.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kito.cheng@sifive.com Received: by mail-lf1-x142.google.com with SMTP id f9so7238770lfq.2 for ; Wed, 28 Oct 2020 08:42:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=CFxp0EqUO6rOWbjiJAQLj3ihAgcKVQ6tnhuFWTjr8RQ=; b=l29doHvKze6hPXU5bY+umKr7ZS3iZGwYIQso5nU7i+rW5klzXUKFMrj/X/DpB3fbz1 /0sUgSYlxMugHwWtJZrZRdjVenleDTcGRwqM4MR3vXxhwIUlNB+i0Yqclg4tm6nvk+D8 /SxEDlVKFA6pc/yjfvo0l88RBkpiU5LibkX2vgvIajBfZ1Kb3JGITNTxRpKgg1KYt4ib 04RbSsJjBekE7NpeSWM64j+54b+3oBr5seQDJLN46+vLwRouxDKeKntAdmt8qvqGLB5S NW3d4uNvRQ/PUzXeRDwP+nnTAjX14NvY7F0Ua5fSVazLhtwo6mIihKXSCkfBCe5rqKzk 4g1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=CFxp0EqUO6rOWbjiJAQLj3ihAgcKVQ6tnhuFWTjr8RQ=; b=CQfnUtrJp/Y4jesW6WzdY2xvHs2uklQb7oXXbN7Mn8bZegnAmL89NHygzKpZ7qPAu0 O0VoYVReFqTtl/2LXMTaIFtrMNuk9e5VM4t3LnJyRBK4U/SrMU51cGNjjbylZ7+Lf0k1 uocUs1DWh/WKdG/LR6WfWKvo+yZnqUjbzxnNZOSD28s12RuWQNIJGDPS9q7LtJHGAynI 2LeTlIH+b6j2RRMVrhvBxUsdS0iPxRn5y2GeWJY97it/DEVdzJYFHlMpdFt/ENoyaRhR hlVimt/ViRDlvrZEScA7g4GcoGfkp6t146x27YBQq6xx7boc483U0CeUMoluQ3kdvudD 4FkA== X-Gm-Message-State: AOAM5334a6m2kl7s7LKQmlZ+wTN5MToaMUiAbTx8b4ysBH37hjINqUQo q3vrXHmGjUBD6iy1WPwZAeXOSn/vuG+pG6hQ/7BYY1RLkc8= X-Google-Smtp-Source: ABdhPJxo+VW3gyEgykrbq5V7DPjceEXPcgZ30dKe4uHIQtqFrxZ4WktB6e17AYS012LIpKkWpH2xKtywqnJMHVk0uSc= X-Received: by 2002:ac2:5927:: with SMTP id v7mr2758443lfi.7.1603899755192; Wed, 28 Oct 2020 08:42:35 -0700 (PDT) MIME-Version: 1.0 References: <20201027061958.83712-1-kito.cheng@sifive.com> <20201027061958.83712-2-kito.cheng@sifive.com> <87361zfs1e.fsf@keithp.com> In-Reply-To: <87361zfs1e.fsf@keithp.com> From: Kito Cheng Date: Wed, 28 Oct 2020 23:42:24 +0800 Message-ID: Subject: Re: [PATCH 2/2] RISC-V: Implment finite and fpclassify To: Keith Packard Cc: newlib@sourceware.org X-Spam-Status: No, score=-5.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Oct 2020 15:42:37 -0000 Hi Keith: Thanks for your review! I sent patches to fix those two issues :) On Wed, Oct 28, 2020 at 2:22 AM Keith Packard wrote: > Kito Cheng writes: > > > +#if defined(__riscv_flen) && __riscv_flen >= 64 > > +#include "riscv_math.h" > > +int finite(double x) > > +{ > > + long fclass = _fclass_d (x); > > + return (fclass & FCLASS_INF) == 0; > > +} > > This also needs to check for FCLASS_NAN: > > return (class & (FCLASS_INF|FCLASS_NAN)) == 0; > > Same for finitef > > -- > -keith >