From patchwork Sun Dec 8 22:48:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848293 Delivered-To: patch@linaro.org Received: by 2002:a5d:50c2:0:b0:385:e875:8a9e with SMTP id f2csp1840317wrt; Sun, 8 Dec 2024 14:51:26 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVFk1A4Z7EX43jz4sQQb/I+Ra99Hd4lmNCXyYYguehU6NF0EXpZw+84IrxmIYSwxV1FhHXNtQ==@linaro.org X-Google-Smtp-Source: AGHT+IHWlw4jt6neZFKnvLCEZj8XDsr7tAw8EIrDH7l94zvNto2ddSeOCsFjoEnfd+LTmE1cSyhd X-Received: by 2002:a05:620a:4515:b0:7b6:6634:5a42 with SMTP id af79cd13be357-7b6bcad5083mr1505042785a.23.1733698286364; Sun, 08 Dec 2024 14:51:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733698286; cv=none; d=google.com; s=arc-20240605; b=GJmYwedV7y97nRMeIRhGpoTukLFIlNl3a7onBknpbbpsxKSK+G8nBmGIzhbYpaC0eZ yrFM5dvHXuiA9eYgeVlSCk/D/UcMJ1K6jG9kFpjHle+nMR/GFZ7XxtG3UT42h9+TMT41 caSvc15Gzbhn20AssjA/eiDJ5YFc1wDfKvc6svrXnpJiFJGVpq1+Uh6ix51DLTKSoWXf jL4tTtr6SgblZcIyKMZf0KqQuAhPhs+7VZcbXB4xUImBAiwWchkBFqs8Kurh5dENu2qv De9o+QxhWnrq7ANmJNen1+yYBHpx9A6wPbt+CUG4BcmZjb5HK2B/cUF/10Gtb6Cxiuj5 tfdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=5xxQ+Dq7R8GnM1J7sgIMgZ9zk0m58GoMVFOUgAxTchA=; fh=ZTutxOFfSTK00/NSefao3I8YzT34sqQTgDXNvfsMID8=; b=Skx01nisVba8p/tqjBFkV9He5weGJbjLExLT6eA1WG6/aRLp4W+ZrluA3APiRqXjKI TTyXEj46+GJ9paBh54ZI3CkND5kxfA/RJxpR1YgGHZ5fsz0J/cedoevQjxgVHQ9f82KX 0vx1WNl724sd/YZm1cwDb9oIk8J3gnxm3eRHuzRtNTRbdpx6DgTD11TrnMgQt14KsOQ2 7dMksiiNemv0NLO3wBguroCVGJcdmVJ10Nbz4aQ8EX321FhrlUmPQOdH8JT4dV61MjC9 YSer8zQQbwZXKeaGvyXHvevPjjORH/uEhZcilVwhl/SAHqR3AaOFkw651PooB4Tarlzf Nn0w==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r28TckVR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7b6d18517dfsi259205585a.633.2024.12.08.14.51.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Dec 2024 14:51:26 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=r28TckVR; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tKQ5H-0007BM-Fp; Sun, 08 Dec 2024 17:49:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tKQ5F-0007AR-Fx for qemu-devel@nongnu.org; Sun, 08 Dec 2024 17:49:01 -0500 Received: from mail-ot1-x333.google.com ([2607:f8b0:4864:20::333]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tKQ5E-0006Eq-24 for qemu-devel@nongnu.org; Sun, 08 Dec 2024 17:49:01 -0500 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-71deed20e69so251201a34.2 for ; Sun, 08 Dec 2024 14:48:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733698139; x=1734302939; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5xxQ+Dq7R8GnM1J7sgIMgZ9zk0m58GoMVFOUgAxTchA=; b=r28TckVR3dovnSqAfSZVj4OhWo5my+T/O3dIn38DjlSHMmPEvFnrMEfqoJ5iQguNwH X1Bt4ARqJPP5MQN91j2FcjC+iXUGtFrlaq0jfaWBkHX2u3E9lzh8SsQsITv4tPlKKLqJ 7z7mdu2TX7QoFVa5gVjqige6k3Cr993s+eFlP4p5qwLM4eTQ4xp4DDGBAWO2wGQXi0Q6 Np1bYdVg7/4ud73+o7KcGLiW8+NrrwwP3q6vrZuf/Gb23qP6szFgLhnwT4SZZX5qXW2W iXKvSKmPslpYTL6GAkzc2+aB8IDjdg58LmQ7h9CmDZKcT3oXJDO+ufpOfGsCeyr1uGLW m76g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733698139; x=1734302939; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5xxQ+Dq7R8GnM1J7sgIMgZ9zk0m58GoMVFOUgAxTchA=; b=CvzOWqBmp4e074xgwi255IWgOzP2k+0P4Qybp3Fbsh5WcxWAkuSIr1I4GR2BwHjVJy 6XC4vMMX5FRbyX3ANUjc2wNxeZPGA3eFUXZ6qtfvqIrzsZN54Bse93txsI5FVMS+zjW4 hQ2/eAcxox9j+xZnQNPvJZ5juXCw9/zloi3+teSihex0lvAV0PTJ6qPZoXRBvk1/BBHa oMJGW0bDqQGpYXaahwnSyVOjgS8TouhDCAhWrqJDGSayNXcsI9t4/W/0nGXPFeo63/lQ ZRlrUcC0wENaBAnRjKpHPeiW1R0InbzkhoTgBrxp+svGPmBbBoNN4eZ6231xsiT7Cj5O WHyQ== X-Gm-Message-State: AOJu0YwpB42H4WxNchPhGLZdWwFdoGqTyNWgkLMvIfiFgFLLNaRXhBcU 6F+H9vrdVu+JfPkHsdoHwxkKVBzdlBnk4l7FF8h1Fl9lNzzf6CP73J2tffBO4wusvKGQI0hpprf 3V3Lvgw== X-Gm-Gg: ASbGncsZSjmegayJvRL5AuO88pN+HWaewgVArHT2LaQRpuUvQjJNbYxvB/oBvFmjeDk i+Jt8ur4wIc2R0uzoXziFfrMjvx0JYJ9D/eGqdRvdSj0LDTkKU5TJ4UfBb0HQoxLQi8/LWBYxU+ YBaF0IR/+jOrQNEsWoPq4I15dVAmdthFVddYlRI507yW2HpLFJvpE5FRlv4/Uk7jRnlkBggKv+n eDgvBzs6cBQgNieUgqh0pqzOvqpw8PiGZedITraYBA4Pc2c2i3BQLpwUimBBDiAoraFi9VJ2nko n5vI9qKYFv72tRRLGEn2bE/psXVqRf+IzxpN X-Received: by 2002:a05:6830:4114:b0:71d:548d:6f76 with SMTP id 46e09a7af769-71dcf54b629mr7206117a34.26.1733698138847; Sun, 08 Dec 2024 14:48:58 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71dc497ee8fsm1925198a34.39.2024.12.08.14.48.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2024 14:48:58 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: bcain@oss.qualcomm.com, peter.maydell@linaro.org, mark.cave-ayland@ilande.co.uk Subject: [PATCH 10/17] target/hexagon: Use float32_muladd_scalbn for helper_sffma_sc Date: Sun, 8 Dec 2024 16:48:37 -0600 Message-ID: <20241208224844.570491-11-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241208224844.570491-1-richard.henderson@linaro.org> References: <20241208224844.570491-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::333; envelope-from=richard.henderson@linaro.org; helo=mail-ot1-x333.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org This instruction has a special case that 0 * x + c returns c without the normal sign folding that comes with 0 + -0. Use the new float_muladd_suppress_add_product_zero to describe this. Signed-off-by: Richard Henderson Reviewed-by: Brian Cain --- target/hexagon/op_helper.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/target/hexagon/op_helper.c b/target/hexagon/op_helper.c index aa5ab4a31f..eb010422bf 100644 --- a/target/hexagon/op_helper.c +++ b/target/hexagon/op_helper.c @@ -1192,15 +1192,10 @@ static float32 check_nan(float32 dst, float32 x, float_status *fp_status) float32 HELPER(sffma_sc)(CPUHexagonState *env, float32 RxV, float32 RsV, float32 RtV, float32 PuV) { - size4s_t tmp; arch_fpop_start(env); - RxV = check_nan(RxV, RxV, &env->fp_status); - RxV = check_nan(RxV, RsV, &env->fp_status); - RxV = check_nan(RxV, RtV, &env->fp_status); - tmp = internal_fmafx(RsV, RtV, RxV, fSXTN(8, 64, PuV), &env->fp_status); - if (!(float32_is_zero(RxV) && is_zero_prod(RsV, RtV))) { - RxV = tmp; - } + RxV = float32_muladd_scalbn(RsV, RtV, RxV, fSXTN(8, 64, PuV), + float_muladd_suppress_add_product_zero, + &env->fp_status); arch_fpop_end(env); return RxV; }