From patchwork Tue Dec 3 20:39:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 846982 Delivered-To: patch@linaro.org Received: by 2002:a5d:44cd:0:b0:385:e875:8a9e with SMTP id z13csp715453wrr; Tue, 3 Dec 2024 12:42:20 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXoRejoFsBs0wUNLYkqmW3PfdBfUlN6Z6poOfyo7TF2ljJ3171Z/saOSL0FBoHft/3vGTx/lg==@linaro.org X-Google-Smtp-Source: AGHT+IGz4YSTh19BNcLuv49x0viY+gjxTfoOaqD+QHbHc3l/KLcpfO7k+bHIOSwStDwvOIPHcmJ/ X-Received: by 2002:a05:6359:45a4:b0:1ca:9dcc:e6b8 with SMTP id e5c5f4694b2df-1caeaaa518emr428944055d.10.1733258540113; Tue, 03 Dec 2024 12:42:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733258540; cv=none; d=google.com; s=arc-20240605; b=Dd4/7mCig9cDVxxNPcHaw2qnRZL2saDClNUkv16DqFvHdtuGdozGv2JBwVVvSCwilA 2wDsXS1CG6sKn7D39JGk+IFxPRdG+0aw5y2PgKHs0JFD+kLDQd4rClq5FT5Q0yAqgJmy j4VfbPlVp3AvNlV+8Zm6zmk1EVoAbKrAvdBNVKlBdArQTGhLi2BoHClQKzTCPeDvQvkD eVgQLmGpciDFKvdGSFYHN6skY/NuDbwIgRfWlw8u48/8jEtadh27ziv1aq0CEunNCnHW AG16Xw9imk5ptwGwEcilusbP2E33Ajkj31YTBAMF9LQyq6smRUIVfi+rvnF4UFj8C9a/ GfRA== 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=HxoUNyLc0dEDDQUspYmsgb0BaeY/3JixWBMZpMBDUos=; fh=UQCixiNfr28ZOrfhmxiGPA65dFhly8CmRsnoYC6xI9k=; b=OZEPzCLcmcL1PmutHBeRVg7ZmWZuMEP/Viv+528dgoIPpVtUu1Az8se1raUWth/Qcq brZ10fp98UfKVdbMsNWtIEcNDF6EhcaS8ea8DKyQHTocPq8W6xbztFXMTU6QwpQyenYg ym7a0RqBVLfF5bYDb4xM9L/TrVcuaZM2qwK/0YH4qM8cHsXDuoiuPIZ1rvLSr43WyMDQ tAs7Vl0FL6b6276WjE4erSgFWpJzwvGjoGqqP5T+++leyQupHpGjD6o3NSF2jWebbqf4 RpiAzYBHUDfp679N5us8eEJGrnvD1Oaw1U8soZBlem2DwNntw1PXd7+FxYBzQp1ug11E UTCg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="p/drL0Th"; 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 d75a77b69052e-466c4256b2csi142070081cf.525.2024.12.03.12.42.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 03 Dec 2024 12:42:20 -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="p/drL0Th"; 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 1tIZgu-0001Yu-3z; Tue, 03 Dec 2024 15:40:16 -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 1tIZgd-0001LT-2E for qemu-devel@nongnu.org; Tue, 03 Dec 2024 15:40:00 -0500 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tIZga-0003As-UV for qemu-devel@nongnu.org; Tue, 03 Dec 2024 15:39:58 -0500 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-29e5bf419ebso1564515fac.1 for ; Tue, 03 Dec 2024 12:39:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733258395; x=1733863195; 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=HxoUNyLc0dEDDQUspYmsgb0BaeY/3JixWBMZpMBDUos=; b=p/drL0ThAQJr0KFGIuGN9wo88HHdKek9SKBBvVsiAUvsgbDMiEPqANFG/Thu6Ls15+ IRz3+vyQMTwNAeRjSVpjdM1Amm1JzyGuZuGVjavg2kvxmeIXG5bk6TAyUDf8uRNejLT9 9pt/8JGfh97I5Lsn0sb7vorj1K7K6N6HKnPOt73YcZEKwLzPKt2pdq8vqcDyrBvcMESL zo5KDY3S4bMfLLY7Anxfm167NBJ2tzbsWG9joGELIJc0z/1hz1oaeer8KNKTA2vcavJ8 5bT71ITohoF0HgM0ztoT9ScG6j3E5SRpz8yP+l+nqQ5bscKNlyASJxsK/WIyvIK8Fbok IrrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733258395; x=1733863195; 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=HxoUNyLc0dEDDQUspYmsgb0BaeY/3JixWBMZpMBDUos=; b=Ej3dl1yMs+MqzNNX4RyT651tWu1kmbSYrXYnRGQla2dCBlcV3ASa3QUq5ThfFljuoO syTUmvdbblRHwJwOAO8SYAWl4187Njw8KWRhBGpipUz6Hf+NWS9ZVCd8UAY8s57oOBRx 69RZTNyHZwh/aegWOIthhs/5I8V2eNz7wbXkJMGOekfyKAdRc95DQarMerR5TBsTn8nG xxGPQlHJJR/fni0LTYHbiits3yXW6AGPF6RLElXAC8vpE7tUqy9pnYh7vQ0ub7R08FMw ec6lFk2MNx6C1DCpXBT0miHJOrOy1Ro0stwD/bX9hzpMOhqEOLAEqfVwc1l4eWIcbY7/ E7qg== X-Gm-Message-State: AOJu0YxjOvyRFu9338/DD98lrGM9r0guMJWiicpwzYL8N4QLjD8VE6CT 3+VSkS41bLYMPejqQPUeGKfvHnyl9jaBBjLJBMYHg63GmV7pki9DMu7elgC+ibpXF7Vxz+5ZWC4 Q4iI= X-Gm-Gg: ASbGncuAFjJenIWjnbEhW96VktYNpgfaCQaph+f3Ps69C/p0Nl0JQVPmYUzQjqLxd0r ZjinwZnR0NmVG9HpN5n09he9BVRmTd+4Pfe1UvUDFb90x8QwRrjt91H7B2qxTibtf6Ect/AsCXB NLbnU28mqu2KhkVl/D9Jn6M9SQH71Vlqgz/uQwXd5y13v2syeQrihlks5nwG/AeES7btMrm5/a0 VnhuS6m5axOKGNoCBkk9H5GE2SH4gLIow0mqoDvTIzHZTPPDTZJie8PDHg9fVrI8mXyycFX63IE Et/3bNy/CX19+1zx7qdDQc0o8IPxFQcTBKne X-Received: by 2002:a05:6871:10d:b0:29e:20c4:2217 with SMTP id 586e51a60fabf-29e888949cfmr4315626fac.33.1733258394905; Tue, 03 Dec 2024 12:39:54 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-29e3ae09f25sm2684018fac.49.2024.12.03.12.39.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 12:39:54 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org Subject: [PATCH 04/11] softfloat: Remove which from parts_pick_nan_muladd Date: Tue, 3 Dec 2024 14:39:41 -0600 Message-ID: <20241203203949.483774-5-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241203203949.483774-1-richard.henderson@linaro.org> References: <20241203203949.483774-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2d.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 Assign the pointer return value to 'a' directly, rather than going through an intermediary index. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- fpu/softfloat-parts.c.inc | 32 ++++++++++---------------------- 1 file changed, 10 insertions(+), 22 deletions(-) diff --git a/fpu/softfloat-parts.c.inc b/fpu/softfloat-parts.c.inc index 6423e12406..77f16ac158 100644 --- a/fpu/softfloat-parts.c.inc +++ b/fpu/softfloat-parts.c.inc @@ -65,9 +65,9 @@ static FloatPartsN *partsN(pick_nan_muladd)(FloatPartsN *a, FloatPartsN *b, FloatPartsN *c, float_status *s, int ab_mask, int abc_mask) { - int which; bool infzero = (ab_mask == float_cmask_infzero); bool have_snan = (abc_mask & float_cmask_snan); + FloatPartsN *ret; if (unlikely(have_snan)) { float_raise(float_flag_invalid | float_flag_invalid_snan, s); @@ -98,42 +98,30 @@ static FloatPartsN *partsN(pick_nan_muladd)(FloatPartsN *a, FloatPartsN *b, default: g_assert_not_reached(); } - which = 2; + ret = c; } else { - FloatClass cls[3] = { a->cls, b->cls, c->cls }; + FloatPartsN *val[3] = { a, b, c }; Float3NaNPropRule rule = s->float_3nan_prop_rule; assert(rule != float_3nan_prop_none); if (have_snan && (rule & R_3NAN_SNAN_MASK)) { /* We have at least one SNaN input and should prefer it */ do { - which = rule & R_3NAN_1ST_MASK; + ret = val[rule & R_3NAN_1ST_MASK]; rule >>= R_3NAN_1ST_LENGTH; - } while (!is_snan(cls[which])); + } while (!is_snan(ret->cls)); } else { do { - which = rule & R_3NAN_1ST_MASK; + ret = val[rule & R_3NAN_1ST_MASK]; rule >>= R_3NAN_1ST_LENGTH; - } while (!is_nan(cls[which])); + } while (!is_nan(ret->cls)); } } - switch (which) { - case 0: - break; - case 1: - a = b; - break; - case 2: - a = c; - break; - default: - g_assert_not_reached(); + if (is_snan(ret->cls)) { + parts_silence_nan(ret, s); } - if (is_snan(a->cls)) { - parts_silence_nan(a, s); - } - return a; + return ret; default_nan: parts_default_nan(a, s);