From patchwork Thu Jan 16 21:43:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 857930 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:cc8:b0:385:e875:8a9e with SMTP id dq8csp418177wrb; Thu, 16 Jan 2025 13:44:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXFvswT5n+N1nECooit7MmWHkRt2uF5A4GrTh0aJYyp1BTASpGm5gBc9RmBpfYOHjy4kfeg1Q==@linaro.org X-Google-Smtp-Source: AGHT+IFuFIrI30vncaj4NJL0DeofLySVZTFiXakelh1Lg7ViYRhSi3khgtgTUXYQtv1BsLRAcj4W X-Received: by 2002:a05:620a:2b88:b0:7b6:6b07:e80d with SMTP id af79cd13be357-7be63288db0mr75605785a.57.1737063892023; Thu, 16 Jan 2025 13:44:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737063892; cv=none; d=google.com; s=arc-20240605; b=WtojZdNkR8aI7rPIoxuu5urqJBwfEfw63eqtcju+wZ8BINe2D0sIZS+x7PIhpE3tvx uzRIuihSzANvt7WWxsCLxHXlBs4vCllk8UMF3GvrBXH7cqzuMFitIUGTlWGnE1lEkZFY yfxfJGZuekbkax7AlDD5kuTpQOX3nX6R8WqVwrZKnS4ys39XvES1I0t5iOfeeABbQCDz JMedadpZ7YuSkZuVrI/h/9hzQc718+3M/RcMNF3eV37uD7tTaboBMG12wzuMCufQBTpv +TZ+JNBktbAZD6c4ybNSTxx78qwSq9dtZj6j0oqQ4zRdvNACcZAhRUQiKLZwD4wFWbKW Q9eQ== 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:message-id:date:subject:cc:to:from:dkim-signature; bh=CX5TSXdMoun14dJ7IVnouq8LDBWvCnit0CgMnLfjyNo=; fh=9csOnHC0saVeFO0sah17vzKGHjY6IXmYwLZkD9qWTnM=; b=XZNKK3Ay+fH3HYqvTDj23+tqfBRz7qcPWGpP+rEcc+J97VDC4FBBjZ+l0HVa6ogYuT SbAwiA8gZz6ZjQyj09ychz6BmIaNEIFLrp71pVTkrTaQBengwQzQwKpi6MidBjJhXFOX fE70Z87WmlR7OyU5V7bK4R2olJNTikp1ruY9NOiVUSgF3xmCt7BM6UcwO6a7fV/BKyqA Mke+1Z1yhP+/1IlWEw00WSOQbO+gQsP/Gzyd2L9PBa2kFZlHfpwh3IOw+v91q1xDRIEn tGxdAJ/XsT8vLZkgDh6eIo+cR8MRYWWdc8a0V4VPaXJIM6ysX+K+IfCgTbkPotgYZoaV Cd0Q==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="x6/xqN6q"; 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-7be614bee02si100583585a.293.2025.01.16.13.44.51 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 16 Jan 2025 13:44:51 -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="x6/xqN6q"; 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 1tYXep-0005wG-KG; Thu, 16 Jan 2025 16:44:07 -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 1tYXen-0005w5-RB for qemu-devel@nongnu.org; Thu, 16 Jan 2025 16:44:05 -0500 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tYXem-0007LQ-87 for qemu-devel@nongnu.org; Thu, 16 Jan 2025 16:44:05 -0500 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-4361f664af5so15123785e9.1 for ; Thu, 16 Jan 2025 13:44:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737063842; x=1737668642; darn=nongnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=CX5TSXdMoun14dJ7IVnouq8LDBWvCnit0CgMnLfjyNo=; b=x6/xqN6qxoKMl7FDm3N2sVyiq+fxNHwpgsS4JJ07xV0i8FDnQxQDpgZXl3MiCfciTz +HeobdLhRAN+ITxo3E7GnpNMYopXnY2vXjSh06TIrUZhnx0TCt6FrxnNcLE12r6WwWPR n7DIfsa0WwliIaGkc6s1lhNhvPUO3DyJt3KWvmsLPLrC6As/elIIjcdaFMS7F8NQwUP0 LwY+QLlWlCCfwD4Ku3bR6vI95rg5TA9goFxjgb17/EMPAD+YkOiFMdhkQ3HeOSI++4y5 KMHOJVGJ2Riy2Ag0Yi+XuDdqpGfpQq7L6Xo29Gr5ZozWhF7meWTPAj2x+afegDAwpvtg OyKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737063842; x=1737668642; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=CX5TSXdMoun14dJ7IVnouq8LDBWvCnit0CgMnLfjyNo=; b=lmIfdTOx54oOm9GOZXuHyuYCKKC3oJuWpFmYrT9MmHKe4F53ej3zWAvf0ywlYtx4LZ aKfdjceatkSZByaEiy9dBGQnfPtfpH5YTxQcQeBE52JwxoMsFC1Vc2vyBq4VYR3x/obC Xyf64tPktkCJeWgDAF+plvxXOPmaHmVBfb/jasm32uRAcANGzG0FrUxwUP9mOwwavz2t //jcB4BUxfRRdGN5JXqWnUhnaHiVGwMBwyL3sofeYM9SKE70itu9YJ2bG285Fbc7heKM XdycvH4lwrCWZepE12By8Bf33/qBWzNQn1HcG4MYw7rprR5c9zCh78zQ7omZYxx36oaC 2oTA== X-Gm-Message-State: AOJu0YwVNlBBEAmnzqyJfdCehhWFgNOYS49ePIIamcXf9UUPBGtO5v28 M+hBTjfgOa01g/q2KT/BBBMSQlSd6wLK7GGhTCnWrlsuoADpePIlbxFtnmLlvwU2UDvahmUE+LF DnAU= X-Gm-Gg: ASbGnctgU1kS2P2WhJ9rY892VqqTOIM22T7NIxMzu83jaid8OgXnuIoz4TFbpWBhUJb KgqZ/pCOE8MscElx/qzz71WHid95C9Pr9r8Gd8gwt5w8iGZb5zRRcS2gIHPh7q94NftAaTjQ9KX zz42aCrbZ97H2t+LNPjZT/QLiiFd4M+E7pwgHB1stmqoH4J2QzBsBvJy3AMDVV1ra9jVvSSWCHM mg9Mro4etzGmwcYqAOEI7mH1zL1GchOETzdw8020JrqaAWJC0C4Pd3M8QRBVIx2IB0qmn/GHF/A u9sNqirAvWKBMGLxx54lvl8PDTpbhpI= X-Received: by 2002:a05:600c:3ba7:b0:435:172:5052 with SMTP id 5b1f17b1804b1-438913becb8mr2079525e9.1.1737063842004; Thu, 16 Jan 2025 13:44:02 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c74c4f85sm73263865e9.18.2025.01.16.13.43.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 16 Jan 2025 13:44:00 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Peter Maydell , =?utf-8?q?Alex_Benn=C3=A9e?= , Aurelien Jarno , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= Subject: [PATCH] softfloat: Constify helpers returning float_status field Date: Thu, 16 Jan 2025 22:43:58 +0100 Message-ID: <20250116214359.67295-1-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::334; envelope-from=philmd@linaro.org; helo=mail-wm1-x334.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 These helpers don't alter float_status. Make it const. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- include/fpu/softfloat-helpers.h | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/include/fpu/softfloat-helpers.h b/include/fpu/softfloat-helpers.h index dceee23c823..4cb30a48220 100644 --- a/include/fpu/softfloat-helpers.h +++ b/include/fpu/softfloat-helpers.h @@ -124,58 +124,61 @@ static inline void set_no_signaling_nans(bool val, float_status *status) status->no_signaling_nans = val; } -static inline bool get_float_detect_tininess(float_status *status) +static inline bool get_float_detect_tininess(const float_status *status) { return status->tininess_before_rounding; } -static inline FloatRoundMode get_float_rounding_mode(float_status *status) +static inline FloatRoundMode get_float_rounding_mode(const float_status *status) { return status->float_rounding_mode; } -static inline int get_float_exception_flags(float_status *status) +static inline int get_float_exception_flags(const float_status *status) { return status->float_exception_flags; } static inline FloatX80RoundPrec -get_floatx80_rounding_precision(float_status *status) +get_floatx80_rounding_precision(const float_status *status) { return status->floatx80_rounding_precision; } -static inline Float2NaNPropRule get_float_2nan_prop_rule(float_status *status) +static inline Float2NaNPropRule +get_float_2nan_prop_rule(const float_status *status) { return status->float_2nan_prop_rule; } -static inline Float3NaNPropRule get_float_3nan_prop_rule(float_status *status) +static inline Float3NaNPropRule +get_float_3nan_prop_rule(const float_status *status) { return status->float_3nan_prop_rule; } -static inline FloatInfZeroNaNRule get_float_infzeronan_rule(float_status *status) +static inline FloatInfZeroNaNRule +get_float_infzeronan_rule(const float_status *status) { return status->float_infzeronan_rule; } -static inline uint8_t get_float_default_nan_pattern(float_status *status) +static inline uint8_t get_float_default_nan_pattern(const float_status *status) { return status->default_nan_pattern; } -static inline bool get_flush_to_zero(float_status *status) +static inline bool get_flush_to_zero(const float_status *status) { return status->flush_to_zero; } -static inline bool get_flush_inputs_to_zero(float_status *status) +static inline bool get_flush_inputs_to_zero(const float_status *status) { return status->flush_inputs_to_zero; } -static inline bool get_default_nan_mode(float_status *status) +static inline bool get_default_nan_mode(const float_status *status) { return status->default_nan_mode; }