From patchwork Thu Nov 28 10:43:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 845943 Delivered-To: patch@linaro.org Received: by 2002:adf:f2c4:0:b0:382:43a8:7b94 with SMTP id d4csp160311wrp; Thu, 28 Nov 2024 02:51:12 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUvNMWUcdwlfMtO6YXtV+4gqxEowlPrFnVWF40QJPttIe/mGIQn1g8vnPVppdxPGOtt6beOqg==@linaro.org X-Google-Smtp-Source: AGHT+IFjI1DcRjP73V7pgWV4knelE8sZ3uvIOuFmUq6JqQWRlJjF5cLLZb7YMAUWwIhpz5Xp5dE0 X-Received: by 2002:a05:622a:1985:b0:466:a254:7341 with SMTP id d75a77b69052e-466b3510a34mr102493051cf.17.1732791072632; Thu, 28 Nov 2024 02:51:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1732791072; cv=none; d=google.com; s=arc-20240605; b=Vvs33o3wQ50NufrKWQbzJQOtRsjEXJSBu+9/sBye9I6sDKEdqS7IXgaZAs7ZHY9nzi IX00lG9pPKL3Av6Uuk+8i2GNgCSBYVjMClDCBsEFLJ0HHDkRpocsaYS7eWAIU07HQcte IiFuFGNok993qgGTnx/N3KxTOreU2ZXNls/Z2Y/ykGuKoy6rxqxbCHUZqqUcgqsv8lA5 cOxPFl+0+HEPzS0DuAbaXPS/tZ8x8vbuNQ/liTCk3hHO42fwQhRT/Bu9KxmEVNB051QK Jl1A/K8I6hP7K6p50HS34hwU2cj5z6H95mF0YMWrd5qygC3aJNfnztR2n+CWHaJXTJtU GUZQ== 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=xHFYmwmnqcmAvgEMbarhecchly8CdIQ7oYTdDVFhVcI=; fh=QgE9QYJDVj//6C0QJWGeEM+qaFVaxwMel1ZWqkEy6K0=; b=F/bZPqjWx2cWfNCfegX52vAS56LWecRfsM/ONMcRqx54t+f6pU6MAjEcsXLWZfwQmN Rr5/00ekeWA7WuwagbU78dbsPjcxw0WOqb8KTLiGu4nx8+v/UUqPnU+DURq2wRQCPo8E tqRpkUNny1F2FQnyr+5XFS2umCIkwxe/JmUPkMUf0T9O7f7ENHH7i7eeFJsxxf1oYnbZ KNUiV7qnpoz6ugjqBEsjQukzg7gxUdlsoczffoGwc9XFPDas60Xkapbq9gWxXr9HicFM wnfyuKQqKS4nMyXH4mDjhThZ6q6ES96+/4gzXnetbe0Tuo8lekyKJk8KyG0ccejdLdQN GUWg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=YbXEve57; 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-7b684923c8csi163640085a.130.2024.11.28.02.51.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Nov 2024 02:51:12 -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=YbXEve57; 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 1tGc2g-0006V3-CK; Thu, 28 Nov 2024 05:46:38 -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 1tGbzu-0002A7-PN for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:49 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGbzk-0000gd-2B for qemu-devel@nongnu.org; Thu, 28 Nov 2024 05:43:42 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-434aa222d96so7431095e9.0 for ; Thu, 28 Nov 2024 02:43:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1732790613; x=1733395413; 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=xHFYmwmnqcmAvgEMbarhecchly8CdIQ7oYTdDVFhVcI=; b=YbXEve57aOvZ5W0ozEJ/bACYhxz5jmq0Mmj31yAJH1ZrdC5dy3zRt34/YfN+u3RxQl 8gcZRDCr/I/1VFdGpyrDcS+Hzla2o5VhVZEFrDDksoShP7PdTj3SedFlyKiuyzw7nY96 Rq/19HnG8CNHpE+qH4X14+CrGILwacRLhGPa0lAW9aM3QMHMmoxw5ajKKGStiMEzWAEN QXrEtivva1wOIGAgg6+dZFWxu+P+jG3wXxGamW8N4cnYxWTnaoXJb0cP7kO9aPIsgOQf 8SP69dAWXoOIj4/EteK5Bt6SFuDQch2I2fzxT4uZBJ7hyBF7Muqx+ypT7ly0SCRl7GSt UcHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732790613; x=1733395413; 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=xHFYmwmnqcmAvgEMbarhecchly8CdIQ7oYTdDVFhVcI=; b=FJgM/GfXHJm1TxGj+TLbhR6pMOSZBVhONVmMOVzjtsi9uso1kPhNQaWIDsVhrBOh94 8KHKHWR8xWpe1kXjIQR5WRR5XOn0x3h2eRgIUrGTh5EGLqCRJgBUWoKokDKRurw2U3c3 h7lDO+bWehDyCH0zxSiRTPu+qnGcorhyJYQnoSwYOdEQ5P2KxQuXkRYwR7hggVdmEJSr PwnUspT9WCGCItYXSWKUQJJPxye2lWAyofS6vMh7Xtt58UgMsZ5f6vxfnM9IV24KnK37 o0J5k7jMexr6P0GnORBmtHKrFpRBYwuG55xrd9FNaPHqxhK2r0jaaGY4HAIgMwS6VK1u HWyw== X-Gm-Message-State: AOJu0YzRZn+Oor3xGbkJCs9TJV3yw2pM+kw19TBEOQErJoUkfe1Oq/iV TYlzipTYT1OcTEA6UYSzhYiIyvWsrBg5J/19FnduNDteRq6WyEaIrY+BAOXsju+rkElQM/pJrTD i X-Gm-Gg: ASbGnctB7uJVcGiNC2YA2h5/fudt87MzjFXsKAk+bYZP9DVt3D/Jcn1N9ahWzwfAgQZ fb09/O73sg5ZduAAkkG+gk1UXuntltCH45p1B09+/P1lHDyuxxs2YWdUkw2nLIpV57q2Dxvy9IO JgMQDn8U0sXwmvvnmB/jRVjhEW6pn32WuaFi+ZH56LoZuowxZbILKqRUoVsF4LFK4LsUuaHQGwD VIBgesulKlrujbntc1xv0kKipd3vLv/avakgbib8EI+r3Qt990PSWk= X-Received: by 2002:a05:6000:1449:b0:37d:4376:6e1d with SMTP id ffacd0b85a97d-385c6ed97f5mr6117943f8f.41.1732790609207; Thu, 28 Nov 2024 02:43:29 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-385ccd68958sm1292959f8f.67.2024.11.28.02.43.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 02:43:28 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-s390x@nongnu.org, =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , Paolo Bonzini , Eduardo Habkost , Song Gao , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Jiaxun Yang , Aleksandar Rikalo , Nicholas Piggin , Daniel Henrique Barboza , David Hildenbrand , Ilya Leoshkevich , Thomas Huth , Mark Cave-Ayland , Artyom Tarasenko , Max Filippov Subject: [PATCH for-10.0 18/25] target/ppc: Set Float3NaNPropRule explicitly Date: Thu, 28 Nov 2024 10:43:03 +0000 Message-Id: <20241128104310.3452934-19-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241128104310.3452934-1-peter.maydell@linaro.org> References: <20241128104310.3452934-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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=unavailable 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 Set the Float3NaNPropRule explicitly for PPC, and remove the ifdef from pickNaNMulAdd(). Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson --- target/ppc/cpu_init.c | 8 ++++++++ fpu/softfloat-specialize.c.inc | 6 ------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c index f18908a643a..eb9d7b13701 100644 --- a/target/ppc/cpu_init.c +++ b/target/ppc/cpu_init.c @@ -7270,6 +7270,14 @@ static void ppc_cpu_reset_hold(Object *obj, ResetType type) */ set_float_2nan_prop_rule(float_2nan_prop_ab, &env->fp_status); set_float_2nan_prop_rule(float_2nan_prop_ab, &env->vec_status); + /* + * NaN propagation for fused multiply-add: + * if fRA is a NaN return it; otherwise if fRB is a NaN return it; + * otherwise return fRC. Note that muladd on PPC is (fRA * fRC) + frB + * whereas QEMU labels the operands as (a * b) + c. + */ + set_float_3nan_prop_rule(float_3nan_prop_acb, &env->fp_status); + set_float_3nan_prop_rule(float_3nan_prop_acb, &env->vec_status); /* * For PPC, the (inf,zero,qnan) case sets InvalidOp, but we prefer * to return an input NaN if we have one (ie c) rather than generating diff --git a/fpu/softfloat-specialize.c.inc b/fpu/softfloat-specialize.c.inc index 32edb493776..d89ef62b38a 100644 --- a/fpu/softfloat-specialize.c.inc +++ b/fpu/softfloat-specialize.c.inc @@ -508,12 +508,6 @@ static int pickNaNMulAdd(FloatClass a_cls, FloatClass b_cls, FloatClass c_cls, } else { rule = float_3nan_prop_s_cab; } -#elif defined(TARGET_PPC) - /* - * If fRA is a NaN return it; otherwise if fRB is a NaN return it; - * otherwise return fRC. Note that muladd on PPC is (fRA * fRC) + frB - */ - rule = float_3nan_prop_acb; #elif defined(TARGET_S390X) rule = float_3nan_prop_s_abc; #elif defined(TARGET_SPARC)