From patchwork Sun Dec 8 22:48:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848280 Delivered-To: patch@linaro.org Received: by 2002:a5d:50c2:0:b0:385:e875:8a9e with SMTP id f2csp1840001wrt; Sun, 8 Dec 2024 14:50:10 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCUCxp1M4caf9uBfRDw29sWxI5pHRR57EI9tyemnzzmLYOMHlz/niZL/WdBHZR16bCLa18LpYg==@linaro.org X-Google-Smtp-Source: AGHT+IF/yDfS/wDmU1a8kLySXShGUgFMCIyrszLe7oTm2a4ru49UV3hSz4aS+7qnDo1eQGI/FBuh X-Received: by 2002:a05:622a:254:b0:466:85eb:6123 with SMTP id d75a77b69052e-46734cf3020mr160390181cf.22.1733698210339; Sun, 08 Dec 2024 14:50:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733698210; cv=none; d=google.com; s=arc-20240605; b=TopB5s9aboK54L0kZoe9EGWo6ItcqqhrCWzLhUVnaADgdzXZ7Nvwwvw6trXrQTL69i hjld3RvSc4hiwbtnTBeYhBO2vMkwYQ1m5z9PgOI7GpIYMpKOSqulkQ/X9PNGpX9lr3/y JeSx1etTibyJGKxg5Kj7IHUUry4YuW8fmute+XgFAznEM5vOaeBO/VcEGO+rYDjJZiIq gOnTwrWx8t+LRQT8CGRKiKWYzGi1LItzA1eSJ3vkVCxYKZE4hWXS3vwTMKcSk42bcgtb oG5xvoJLPmm8Tclmw5nu6JwWfPwTrkqI7PIph8zy+mg6k6SMPB3A/eZ6kwB8W9CQJTsd eSag== 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=l91xWhho4J5dS14PUrzWIvB5MRYtKAuibtsdCvv9Iy0=; fh=ZTutxOFfSTK00/NSefao3I8YzT34sqQTgDXNvfsMID8=; b=gDPl6EoeyTb0/1iPBCWcaduH6AQ8tQhYLBHQgYWTVt5Fh9HTZq50cOnhUqUPmmjI91 X7sYpZuGYF8lZ/iriMPR00uiT8D5zjstghTRUjqVexAZFoI3JABhLR9HN1CZUqnk/rpV ftWYu7Jr0xHmjilDyWhK7wTPRcVKV1ZDu9N6xhNE1KPnv5cl+ZOf/WDxxt6jHf5oBkbp R6kE5BJncv4+Es4pheIQ2YphA6ENr33ZZUiWKue6KTUd1EIHoIPbT2pPuy96bMQCEu07 fHdIrXCvMeuV1Zvw1WsdLwR0jtGTjqFrAGnR77HvJk/kJvS5ff3n5G8d+Ee+OhfJVOav gawA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ZsXhEviF; 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-467297fc5e5si99573981cf.381.2024.12.08.14.50.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 08 Dec 2024 14:50:10 -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=ZsXhEviF; 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 1tKQ5R-0007DM-5k; Sun, 08 Dec 2024 17:49:14 -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 1tKQ5K-0007CX-MA for qemu-devel@nongnu.org; Sun, 08 Dec 2024 17:49:06 -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 1tKQ5I-0006Fv-QF for qemu-devel@nongnu.org; Sun, 08 Dec 2024 17:49:06 -0500 Received: by mail-ot1-x333.google.com with SMTP id 46e09a7af769-71d40003870so1003039a34.0 for ; Sun, 08 Dec 2024 14:49:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733698144; x=1734302944; 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=l91xWhho4J5dS14PUrzWIvB5MRYtKAuibtsdCvv9Iy0=; b=ZsXhEviFBXLSqWxruIYSJ5SfPWVzfrpw+4ehagkuGgDTYxgrXzNDmveimRfu5Vx62l HpdoqbKF5+PFsXix4r1Xc5QHHL7PdEMvv3GIGatsvdKpTQGQx3XKjZUHQe84hN8sg9iv uHUUN7KQsARkl+vKYAEUMcW6N2GhT8oEDMS6cEMec+5l/wdlVYQkelSF7mrm5dTu81lu vII+z7uESLjtm0dynWV8ZdGG86EpN2LCNJBGCHud9OR8sGeLu939Q6SCSQjv50e0XY/q TYnSo83WnSpb0l3LmMZDW7uojlcyHZpblGNAdAPbxeTVX1MsHr5e7yvRDwmqPCFGz6Yo gajQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733698144; x=1734302944; 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=l91xWhho4J5dS14PUrzWIvB5MRYtKAuibtsdCvv9Iy0=; b=dsvXrlfsMeYfCXi7ahel59eb3UiVfnh68fv3uUaTr06zWvWE6hbkcV8WTlIO9o7gJ7 eNS1hfXVdsXWgaZ50zZXN+q6noqMho8G7J7Hlbpb9KCL96jB4b/o+YzyuSmnzYBQdnF4 cDSl0yvp1ZwbbcILpqdw0x19fYsR4w7iAwP4qhMRa7wuZtHfduNE8xVbfjS9/YKdUbGS Jmg97s4Vfdk9YBSBt9fxDycLJEoXbgbVizXJ0CxAjF4iTUKrKJhE8yZ/NF872eLr0sdU ZnReff8Pw4PwP1av2EMy3pS54rXSZd+Mq/4CKdPh7OD8E+w5K5JhQzF/Seglbi45hdwk 4vPA== X-Gm-Message-State: AOJu0YyFTuJRnoX2wx/xdAAoZS1Ohuthnq9DUOj9HNnWbGrvUyQ15pKt A2YFptUguc+W/+xpsrzhenweIg8Wo1gKPQosvnWXbgWO6inmIa7fq2NfKU6j8E5HWkKA1zKZrF9 fkAl2NQ== X-Gm-Gg: ASbGnctr8M+DG6eKecUM/3HQNKfW1sxwODVTW50Ak6yBRij98Db8EhPkughPpLTqZa4 oCeNOuCNA4DS6JPlPjPe7kIG/52hxOhupPcCGxhKmedSP5r2CHT8armU/T9wMkd7/BDm+0K1FiA UYKhnk7UyL/wyAgZjyNc22YwLppbAQFQYwJhhvSTjhzYaz9Tbcn5/gXPLR4Dtjb6OyqlpjDkTnm 9t/wq4Ufm3yhCSgSJ6Zq/oEzWqCDDK051+EPRH0T0yPEOs6YLlHCu6IKa2pW7AG2CxlgwVI/b6q xT3D16ahWgTlKyUqDp+TIEIQIKchejsUMEbx X-Received: by 2002:a05:6830:1504:b0:71d:eee3:fd24 with SMTP id 46e09a7af769-71deee3fe4dmr1530980a34.0.1733698143780; Sun, 08 Dec 2024 14:49:03 -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.49.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 Dec 2024 14:49:03 -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 14/17] target/hexagon: Remove Float Date: Sun, 8 Dec 2024 16:48:41 -0600 Message-ID: <20241208224844.570491-15-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 structure, with bitfields, is incorrect for big-endian. Use the existing float32_getexp_raw which uses extract32. Signed-off-by: Richard Henderson Reviewed-by: Brian Cain --- target/hexagon/fma_emu.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/target/hexagon/fma_emu.c b/target/hexagon/fma_emu.c index bce3bd4dfb..c359eecffd 100644 --- a/target/hexagon/fma_emu.c +++ b/target/hexagon/fma_emu.c @@ -53,16 +53,6 @@ typedef union { }; } Double; -typedef union { - float f; - uint32_t i; - struct { - uint32_t mant:23; - uint32_t exp:8; - uint32_t sign:1; - }; -} Float; - static uint64_t float64_getmant(float64 f64) { Double a = { .i = f64 }; @@ -92,12 +82,12 @@ int32_t float64_getexp(float64 f64) int32_t float32_getexp(float32 f32) { - Float a = { .i = f32 }; + int exp = float32_getexp_raw(f32); if (float32_is_normal(f32)) { - return a.exp; + return exp; } if (float32_is_denormal(f32)) { - return a.exp + 1; + return exp + 1; } return -1; }