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.133.124]) by sourceware.org (Postfix) with ESMTPS id 081ED3858D35 for ; Thu, 17 Aug 2023 19:15:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 081ED3858D35 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1692299725; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Cdj9FWWycPCn39x/LSKP003XQXBy1mGSbjrXMJC+Z10=; b=LHwvIvZ/31Hwww50fwBuefYuxjFArQU0D18OJopm5xGBFp8eajmxRwwP8oSfBBwrIaYuCy gLNi/VKOZV1yEZlTV70546RDzLxVeOK66IU2G+sEkK/uzYx7X/JQNWR1mnVS/Cxe6Eisr1 VgCg2lPzoSq6vEGCI3EAu7vxSdEBn4A= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-hpX-e86jMcSbgx9Llxda9A-1; Thu, 17 Aug 2023 15:15:24 -0400 X-MC-Unique: hpX-e86jMcSbgx9Llxda9A-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0333A101A528; Thu, 17 Aug 2023 19:15:24 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.2.16.43]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 49C7F492C13; Thu, 17 Aug 2023 19:15:23 +0000 (UTC) From: Florian Weimer To: "H.J. Lu via Libc-alpha" Cc: Paul Zimmermann , "H.J. Lu" Subject: Re: [PATCH] x86_64: Add sinh with FMA References: <20230814151634.2860117-1-hjl.tools@gmail.com> Date: Thu, 17 Aug 2023 21:15:22 +0200 In-Reply-To: (H. J. Lu via Libc-alpha's message of "Wed, 16 Aug 2023 10:23:05 -0700") Message-ID: <87bkf5pjjp.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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=-4.6 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 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: * H. J. Lu via Libc-alpha: > On Wed, Aug 16, 2023 at 7:45=E2=80=AFAM Paul Zimmermann > wrote: >> >> Hi H.J., >> >> I get no improvement in accuracy. The largest known ulp error is still >> the same: >> >> sinh 0 -1 -0x1.633c654fee2bap+9 [2] [1.93] 1.92222 1.922214006544865 >> >> Maybe the FMA is not used for large inputs? >> > > There is only one FMA insn in __ieee754_sinh_fma: > > 114: c4 e2 e9 9b 05 00 00 00 00 vfmsub132sd 0x0(%rip),%xmm2,%xmm0 > > Since it calls __ieee754_exp and __expm1, with > > commit 1b214630ce6f7e0099b8b6f87246246739b079cf (master) > Author: H.J. Lu > Date: Fri Aug 11 08:04:08 2023 -0700 > > x86_64: Add expm1 with FMA > > On Skylake, it improves expm1 bench performance by: > > Before After Improvement > max 70.204 68.054 3% > min 20.709 16.2 22% > mean 22.1221 16.7367 24% > > There is very little improvement with a single FMA insn. If you specialize the implementation for FMA, could you avoid the indirect call to __ieee754_exp and __expm1? Thanks, Florian