From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.2 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B42FDC433DB for ; Fri, 12 Feb 2021 19:37:03 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 52DA464DE2 for ; Fri, 12 Feb 2021 19:37:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52DA464DE2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:58176 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lAeFS-00011S-ET for qemu-devel@archiver.kernel.org; Fri, 12 Feb 2021 14:37:02 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:40292) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lAdYI-0004LF-Ko for qemu-devel@nongnu.org; Fri, 12 Feb 2021 13:52:26 -0500 Received: from mail-pl1-x631.google.com ([2607:f8b0:4864:20::631]:39658) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lAdYH-0000YS-46 for qemu-devel@nongnu.org; Fri, 12 Feb 2021 13:52:26 -0500 Received: by mail-pl1-x631.google.com with SMTP id k22so324238pll.6 for ; Fri, 12 Feb 2021 10:52:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RZzuJu1U9J6mjLUYoNi2FyaSbdyzsWsgUTsQma2lLDQ=; b=Xx4OsZeommcMwI4huQ86Y8Ag0KBxtpOwQsUzbiSNfy8mciphhzAbACrG2WCWAaPUo7 ZpHTw1f8U9Lwaj5R9AMsFHL2VA72q0Pzo6rm4EQZkJKI4kZhf3lMLT3VMmWwfBGETnUJ 3NCqZGAPwtqlXg0lgtvASZvpVg5jCkmxQUVZ3hJD62pGKQWriQ9H1UsbfHP5oQAJaI+s DMJm8MXAJEcOSmzSmGsuH4BoLF1XN4eYlN6kQKS7QszF+42xInjarNO58fvv278yI/hc sxDNZyBM3xA/M4RqJVMvGyxU80VDcAmBq0bEwcCoYhg6Y/hB6t37DjLfF+UrV1JZOeRL YlaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RZzuJu1U9J6mjLUYoNi2FyaSbdyzsWsgUTsQma2lLDQ=; b=Ae3Gic48CbOdQDVUlsxfZEu/EeBfUfnbOyfHD+smiPFSYCvqYNt7q42o2NvSQ7qvw9 kr6HCTKt7oSjKp3VHIFdNbxc5kaAyIn0qzcvwFRo3YSU0lDl4afK3ZmJF7VYRDP3hSgl J4RHkyyhnlKNOE5nZBEwVhQTlNllUOeQb6+4/DM6ZRoadOe23C7YS4I2axUImDLvJhX1 HeWFU3KZa3kBi1tMJ9VsjfWDcmSUhsaHCtYdp3tstE/w0rzK9VSofk1NDF66Z2k3jCTi 7wt/B+YDJ1wBKYN+OnOvAO3Nr0p7NKRlyDl+4YFiJhj1ZN5zZSVUU6AKkjb2TujnpBQ3 hIpA== X-Gm-Message-State: AOAM530Ie1bhE8+Gv1z3YcCu5Eo9FukhYOwP3waNEwXJXb4o6aC4QUPY TTlaEpRDtmr6UkqW3Ed+mSP7vg== X-Google-Smtp-Source: ABdhPJzUB3/gdL8ycCzdZYMIJRhvI3WfppFaEAFBKm5JywWkAOIZFQYImggvr8QmMMcHewM6fkuOCA== X-Received: by 2002:a17:90a:b883:: with SMTP id o3mr2993303pjr.95.1613155941772; Fri, 12 Feb 2021 10:52:21 -0800 (PST) Received: from [192.168.1.11] (174-21-150-71.tukw.qwest.net. [174.21.150.71]) by smtp.gmail.com with ESMTPSA id k5sm9431958pfi.31.2021.02.12.10.52.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 12 Feb 2021 10:52:21 -0800 (PST) Subject: Re: [PATCH 03/38] target/riscv: Fixup saturate subtract function To: LIU Zhiwei , qemu-devel@nongnu.org References: <20210212150256.885-1-zhiwei_liu@c-sky.com> <20210212150256.885-4-zhiwei_liu@c-sky.com> From: Richard Henderson Message-ID: Date: Fri, 12 Feb 2021 10:52:19 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210212150256.885-4-zhiwei_liu@c-sky.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2607:f8b0:4864:20::631; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x631.google.com X-Spam_score_int: -21 X-Spam_score: -2.2 X-Spam_bar: -- X-Spam_report: (-2.2 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.119, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alistair23@gmail.com, qemu-riscv@nongnu.org, palmer@dabbelt.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 2/12/21 7:02 AM, LIU Zhiwei wrote: > The overflow predication ((a - b) ^ a) & (a ^ b) & INT64_MIN is right. > However, when the predication is ture and a is 0, it should return maximum. > > Signed-off-by: LIU Zhiwei > --- > target/riscv/vector_helper.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) Reviewed-by: Richard Henderson r~