From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id E740C3858D38 for ; Wed, 24 Jan 2024 18:10:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E740C3858D38 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E740C3858D38 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706119858; cv=none; b=geLxpPELkKFj3ATjr2pn7rQ/kNKX4jSYAE6TGizyGCryQFarakEWcG7Q5qY+lMwcW3hLtZUFMaI0ifVHx8CvlkBSS5h/3uy4AvwjzoOcibFvQxg5kTbKSjHNIxBQty8YPTEmX9jFFFz5uAke07eJYTKtfu5v3l7ecUu2zzwL9aY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1706119858; c=relaxed/simple; bh=Z0KXEhhf/axB+SIfhxo7ugDWu/xwPQgiYg2DF/I62IA=; h=DKIM-Signature:Message-ID:Subject:From:To:Date:MIME-Version; b=rFk/OwwpFbeij8Zo8Kgixf2ojxKq/7KankU1AapuPHgBl94jXZ614iARG0V6sUqlLVB1SIQ9+SIQgvwZKgtvoN65hVM7b43ZMSX3gotmQKD0pFtDySxnVAGITE/v7bb4RrIG1eRs/HBnrL1YLjbkwzWc0ntl/Wfx5JiWxdkzw1Y= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706119856; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KPJt4v3JCLnupWzVi8XcLfhQ1PkVBKIyqcBTzbpBFjE=; b=Hj08/9X1ubhX4uFHZKm0Hl8kujekKKLA9mjQUywmmz+ExpAJVRbA/qkI8uYkqNrHIHKuLl fORGOsYu677PzappLTfrbOPqBPV8DEsoiSxVShT0WClF04zUIMzJQ53Xw5zyvsuZ9YOZUr 5ptUWiXxsZocJbk2LZKY2kn2vErgYTU= Received: from mail-yw1-f200.google.com (mail-yw1-f200.google.com [209.85.128.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-543-o-s-l9A5PE-jzqKchW--9w-1; Wed, 24 Jan 2024 13:10:55 -0500 X-MC-Unique: o-s-l9A5PE-jzqKchW--9w-1 Received: by mail-yw1-f200.google.com with SMTP id 00721157ae682-5f250d8f876so106031087b3.3 for ; Wed, 24 Jan 2024 10:10:55 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706119854; x=1706724654; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=KPJt4v3JCLnupWzVi8XcLfhQ1PkVBKIyqcBTzbpBFjE=; b=CxjWO4PswkSBhilHpFU2yIEBw61NcvtaQQ1IYnnBWaGpwfEXLGNBG7cp+8r+Lpx5Fr VtZU3eIYrG7I+sNg99Ywl6ibAcjWQjltNJAhRLwOEPtPq8EL6Ld60Zt5BHKykTYEFuSP E3NQFDvTRzKFFihAXk3s/G7PVubG31e0T5ctFvjJT3M2IWbpq8dYgR60Yt2ReXrzhQUY qWIXD6TC1nDiM5FWO4PC0ygp6vQtw9h2ZeuueOYRhzE++ausoMrMXQXQcZBiCNd0+8X4 ywsNdh6gpo7vYTdz7GxMRmEyLZzqvPx+5Zb4Do+9hhmBgzKeFCftHp+4VLkQUELT3nYp E4yA== X-Gm-Message-State: AOJu0Yz+Gn3+CcIT/RcEGyzTCMBFQPkw83uuwvE1uKW0n2YOm6U6Lhee UyFUiZggkcUtckyxEjr0x63r6eDyyV9mpBbuJOqKXWsoInQc0VSh3zJfc7QdKTcaW3doEgD+okO Pvzs9FjlUYkmRYfYrOyRKBWu3KCvuNed7gfojahxdYo0PuBoeEzmyCgA= X-Received: by 2002:a0d:fcc2:0:b0:5d7:1941:357e with SMTP id m185-20020a0dfcc2000000b005d71941357emr1309977ywf.101.1706119854702; Wed, 24 Jan 2024 10:10:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IHN7nGz8US0ceEEvcb8nkKFaMa7UpGfPZukM3t7ezGYdEe8ksGyIv9senG6kkVBKnw3Td0HSQ== X-Received: by 2002:a0d:fcc2:0:b0:5d7:1941:357e with SMTP id m185-20020a0dfcc2000000b005d71941357emr1309966ywf.101.1706119854393; Wed, 24 Jan 2024 10:10:54 -0800 (PST) Received: from t14s.localdomain (c-76-28-97-5.hsd1.ma.comcast.net. [76.28.97.5]) by smtp.gmail.com with ESMTPSA id gq1-20020a05690c444100b005ff3fdb8bf8sm94312ywb.2.2024.01.24.10.10.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 10:10:54 -0800 (PST) Message-ID: Subject: Re: [PATCH] libgccjit: Fix float playback for cross-compilation From: David Malcolm To: Antoni Boucher , "jit@gcc.gnu.org" , "gcc-patches@gcc.gnu.org" Date: Wed, 24 Jan 2024 13:10:52 -0500 In-Reply-To: References: User-Agent: Evolution 3.44.4 (3.44.4-2.fc36) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, 2024-01-11 at 18:42 -0500, Antoni Boucher wrote: > Hi. > This patch fixes the bug 113343. > I'm wondering if there's a better solution than using mpfr. > The only other solution I found is real_from_string, but that seems > overkill to convert the number to a string. > I could not find a better way to create a real value from a host > double. I took a look, and I don't see a better way; it seems weird to go through a string stage. Ideally there would be a real_from_host_double, but I don't see one. Is there a cross-platform way to directly access the representation of a host double? > If there's no solution, do we lose some precision by using mpfr? > Running Rust's core library tests, there was a difference of one > decimal, so I'm wondering if there's some lost precision, or if it's > just because those tests don't work on m68k which was my test target. Sorry, can you clarify what you mean by "a difference of one decimal" above? > Also, I'm not sure how to write a test this fix. Any ideas? I think we don't need cross-compilation-specific tests, we should just use and/or extend the existing coverage for gcc_jit_context_new_rvalue_from_double e.g. in test-constants.c and test-types.c We probably should have test coverage for "awkward" values; we already have coverage for DBL_MIN and DBL_MAX, but we don't yet have test coverage for: * quiet/signaling NaN * +ve/-ve inf * -ve zero Thanks Dave