From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 695B7C433ED for ; Wed, 12 May 2021 11:15:23 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D311660720 for ; Wed, 12 May 2021 11:15:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D311660720 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53212 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgmpl-0004zx-Nt for qemu-devel@archiver.kernel.org; Wed, 12 May 2021 07:15:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgmnq-0001uS-BN for qemu-devel@nongnu.org; Wed, 12 May 2021 07:13:22 -0400 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:42734) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgmno-0000N8-By for qemu-devel@nongnu.org; Wed, 12 May 2021 07:13:21 -0400 Received: by mail-wr1-x42a.google.com with SMTP id x8so911860wrq.9 for ; Wed, 12 May 2021 04:13:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=references:user-agent:from:to:cc:subject:date:in-reply-to :message-id:mime-version:content-transfer-encoding; bh=++zlG59kIcGW04JH3G6R/eUYQ6HcLlg60G/2dS9RCyw=; b=xZc1lv78hZZ4GeTayl+6BdIahOUC9sclgj/q36WckLAOrKtMXLgzV75haoT+iPZ/nI OObpq3tdLRq0+LJFM77AGRnIhlE8LkIfaxHknaElNmpaftuHugehFL1lReiC1nDXBcZy kuTedL3Tayjmi0oQB195IkFhwra2XyD98FVA0tTSYJgLjXBsBQX8qFFkCjR/2Skf5EpZ otsTlCZpCRZjdVizQCn+EmemOyBFqp/ya77qTzvwiVI1eq4APQQuk9XFSRatWu5/PBDk FT3U2kHDZi8oT1bNKAKODUXJfuRKk4Y08MveP0S0eFWz6Y932elVvahqP4IKkECdE1zg p2tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:references:user-agent:from:to:cc:subject:date :in-reply-to:message-id:mime-version:content-transfer-encoding; bh=++zlG59kIcGW04JH3G6R/eUYQ6HcLlg60G/2dS9RCyw=; b=s5wbWAfeuKSMR4X1fVtptUV1tb88S3kfp0xJO//Ndw1fDgZT0fICI6woEd4JkfZoZN COl+Vd4SgI06D/bVCD+pqLW2+fQV+WxSbpP8yWpO8u7WR06hAMaDjoC1/zzOIgyoc9Bv xd1oUsG7CyReG0kpj9/7oi6UUhDzIiugvbBoZCgZeC0Y4AsXJG77vItul1O/lVKU62KP fYNQqZlQ0GEBYjXmAKzL4JFwKMCOTDsw3nIElnRpTAAtz7BDE0jmza3urBb9ul+Wrmjt /Use+dEdqbmYdvRJR5WaWAPAwVtCNTdOz4GLud8KHQR3tD5p8DD9iThcGBsCxCvAktcA LvVA== X-Gm-Message-State: AOAM531aj3ezoY1PrV6hi4AOrDmmAZpVH+I5pZd6SPI425Xf+RkK7CGx 4G9eWlt5RxVTzpcZoMESziE19Q== X-Google-Smtp-Source: ABdhPJwCOU4qq6NG/6JgSiopGogDA030RW3lBqQLr0uENwOxMvPDHKS/R3aM7C0R2Gsm5XxQWDSfNw== X-Received: by 2002:a5d:5603:: with SMTP id l3mr43198526wrv.79.1620817997999; Wed, 12 May 2021 04:13:17 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id g8sm854117wmp.40.2021.05.12.04.13.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 May 2021 04:13:17 -0700 (PDT) Received: from zen (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 10E651FF7E; Wed, 12 May 2021 12:13:16 +0100 (BST) References: <20210508014802.892561-1-richard.henderson@linaro.org> <20210508014802.892561-26-richard.henderson@linaro.org> <87a6p1gyn7.fsf@linaro.org> User-agent: mu4e 1.5.13; emacs 28.0.50 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Richard Henderson Subject: Re: [PATCH 25/72] softfloat: Rearrange FloatParts64 Date: Wed, 12 May 2021 12:08:56 +0100 In-reply-to: Message-ID: <87v97ofbn8.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::42a; envelope-from=alex.bennee@linaro.org; helo=mail-wr1-x42a.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org, david@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Richard Henderson writes: > On 5/11/21 8:57 AM, Alex Benn=C3=A9e wrote: >>> + union { >>> + /* Routines that know the structure may reference the singular= name. */ >>> + uint64_t frac; >>> + /* >>> + * Routines expanded with multiple structures reference "hi" a= nd "lo". >>> + * In this structure, the one word is both highest and lowest. >>> + */ >>> + uint64_t frac_hi; >>> + uint64_t frac_lo; >> This confuses me. Is this because it could be frac_hi or frac_lo at >> the >> "top" of the structure because of endian issues? > > Nothing about endianness. There is exactly one element, so it is both > the "first" and "last", both "high" and "low". > > Generic code will examine the "high" word when looking at overflow and > things related, and the "low" word when doing rounding. > > This anonymous union gives the same element 3 different names. Right, that makes things clearer. How about: Routines expanded with multiple structures reference "hi" and "lo" depending on the operation. In the case of FloatParts64 they are both the same word but aliased here to make the code easier to follow. ? Either way have a: Reviewed-by: Alex Benn=C3=A9e --=20 Alex Benn=C3=A9e