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 BA1473858D1E for ; Tue, 19 Mar 2024 19:56:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BA1473858D1E 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 BA1473858D1E 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=1710878221; cv=none; b=x3Wn4fpFCjXSWz0rvYZIkZJsUWoOk+EMIjdgcVdObyFKCSUCasjGFCbo+njWub/xeOJK+LStiZwzQVyGJQePKgviGe5bkXWWLE/bK//g+avZ62d5B0/Sg2eORxQN0amrKHhi1pJ+nPP0ynR5tmFxxmb8mhUm4skPqy25nblF6XU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1710878221; c=relaxed/simple; bh=syG5Utcg0/GBpsJomxcqD8vmWGrnWfh49SBXNd4iTrg=; h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version; b=o5hhiyFKPT0NEb2BmwT8micaozjRHNoUrWhPia2RiWo9SvG/ERlLeXit8gcqDx9fyN6lwPwWgJ+hO5KBVoUdL3HOfWqWzQ1APd70YmqRICen764mFhCGZ+44teI7JvP6Gmajju6oanyAIrNB3x7Ii2O42Inh+jIl0yoAqIXwsBc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1710878219; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RHaABpCJTLOCR2/ul5jsZzLJN0eq8zPFLaLJgOZC6+E=; b=fBmRCEmGDNR+/XD4BxezzNmd1tt4+1Udkfc+qUwN69LeAp2fBT4Y4R3k4uouo7hghSgDjZ VEb5r1qNpbn/b9QCAwQ4jVXJufCXoEqsYlz0Q6R6UZW8Gx0a9BPIjHF4WZInQryBVD14Mu khIX1vIFUyyFgMPF6xKJQ8xk8Eb/JUo= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-553-1Sdg_mwkNtqjDFh1z7dlSg-1; Tue, 19 Mar 2024 15:56:58 -0400 X-MC-Unique: 1Sdg_mwkNtqjDFh1z7dlSg-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-41401f598cfso20450015e9.2 for ; Tue, 19 Mar 2024 12:56:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710878216; x=1711483016; h=mime-version:references:message-id:in-reply-to:subject:cc:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=WJLYC4pDGJGhqQUqha1rPnailtNTZ8UoPL2Hrmq5mqY=; b=ahBmEU5f3fHj0UDG7f2LZwoYoa/PstttnR/ZyigpDht5nDuR3Jz0GFDWvkOH6a+Jvx VYieyXsQIQKNJG0oxgYhmCWhwSiFbAkdiim4ABsIpSeTn1ch5RAGFsAqeqJOSBrF9lig MA4pDKshWU5lZiV+BxfeR+ckLw06mmkKi8OQsthF870z/Tx3gUxrjbr9pkIpr7RVmdAu d8hGr/OCFvjl7/4ZaZdSKinWKMYhXBPmPTwBjuUqfKt1PMdawq/P8L1Oh/MNCVyVOybm Xw8K8Ec05FTNn4gdzLK1VBXtq1gmy5XaLFb5ydruV2JOT1miGR+BnO2adrsp2ZZfLMHQ MOZw== X-Forwarded-Encrypted: i=1; AJvYcCUtp5TEC/s2RVyfk7BOISdrmqjw7GhU1kmYB6fPxp9oeT4QmD2NUVKv6YjZK6ReBbgfWiupCF5/o+eyyBXRz8Z5pKBE0CoZ8g== X-Gm-Message-State: AOJu0YxLE6Id3iNmo8vj2CBaoYnXWml2pbDDIaptrbWfpbwe62CC9qIk byusx3DI+9aNSQ5h4Q4rLISIVX/1sEJlhqjhVbav+7Kaq0sg7ssr6lijVORq+XykECWcA2POREE krP7zJ58woy+yP6WZY36NHt0R4iaGfQ5IOtLF1bifAMe/ZtUbWpn8DSM= X-Received: by 2002:a05:600c:4694:b0:413:f290:c747 with SMTP id p20-20020a05600c469400b00413f290c747mr119394wmo.33.1710878215912; Tue, 19 Mar 2024 12:56:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHrwm4fW1a6EHtIdL/QQ9L4q+nhXxriPOYv2sKkgQgmXnfpb1pcybM4e8n3OoIcwi4y2W485A== X-Received: by 2002:a05:600c:4694:b0:413:f290:c747 with SMTP id p20-20020a05600c469400b00413f290c747mr119387wmo.33.1710878215541; Tue, 19 Mar 2024 12:56:55 -0700 (PDT) Received: from digraph.polyomino.org.uk (digraph.polyomino.org.uk. [2001:8b0:bf73:93f7::51bb:e332]) by smtp.gmail.com with ESMTPSA id fk4-20020a05600c0cc400b004146a036bb9sm339607wmb.13.2024.03.19.12.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 12:56:55 -0700 (PDT) Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.95) (envelope-from ) id 1rmfZP-008cti-Kv; Tue, 19 Mar 2024 19:56:23 +0000 Date: Tue, 19 Mar 2024 19:56:23 +0000 (UTC) From: Joseph Myers To: Hongtao Liu cc: liuhongt , gcc-patches@gcc.gnu.org, hjl.tools@gmail.com Subject: Re: [PATCH] Document -fexcess-precision=16. In-Reply-To: Message-ID: References: <20240318105530.3556213-1-hongtao.liu@intel.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/mixed; boundary="-1152306461-1369924301-1710878183=:2048957" X-Spam-Status: No, score=-3.7 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: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. ---1152306461-1369924301-1710878183=:2048957 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Tue, 19 Mar 2024, Hongtao Liu wrote: > On Tue, Mar 19, 2024 at 12:16 AM Joseph Myers wrote: > > > > On Mon, 18 Mar 2024, liuhongt wrote: > > > > > +If @option{-fexcess-precision=16} is specified, casts and assignments of > > > +@code{_Float16} and @code{bfloat16_t} cause value to be rounded to their > > > +semantic types if they're supported by the target. > > > > Isn't that option about rounding results of all operations, whether or not > > a cast or assignment is involved? That's certainly what the brief mention > > of this option in extend.texi says, and fits the intent that > > -fexcess-precision=16 corresponds to FLT_EVAL_METHOD == 16. > Yes, how about this. > > > +If @option{-fexcess-precision=16} is specified, each operation of > +@code{_Float16} and @code{bfloat16_t} causes value to be rounded to their > +semantic types if they're supported by the target. I'm sure sure it's quite right to say the operation causes the value to be rounded, considering it's results not arguments that are rounded, and from the user perspective the rounding is an implementation detail, it's just computing the results in the semantic type. So maybe more like: If @option{-fexcess-precision=16} is specified, constants and the results of expressions with types @code{_Float16} and @code{__bf16} are computed without excess precision. (Also, I've suggested there to use the built-in type name __bf16; the name __bfloat16 from avx512bf16vlintrin.h would also be a possibility. As far as I know, the bfloat16_t name is only in C++.) -- Joseph S. Myers josmyers@redhat.com ---1152306461-1369924301-1710878183=:2048957--