From owner-freebsd-hackers@freebsd.org Sat May 25 20:04:48 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB7D915B514B for ; Sat, 25 May 2019 20:04:47 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F23978748A for ; Sat, 25 May 2019 20:04:46 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id x4PK4c52004137 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 25 May 2019 23:04:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua x4PK4c52004137 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id x4PK4cS7004136; Sat, 25 May 2019 23:04:38 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 25 May 2019 23:04:38 +0300 From: Konstantin Belousov To: Yuri Cc: Freebsd hackers list Subject: Re: What is the portable 128-bit floating point type? Message-ID: <20190525200437.GV2748@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on tom.home X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 May 2019 20:04:48 -0000 On Sat, May 25, 2019 at 12:42:26PM -0700, Yuri wrote: > 'long double' is 12 bytes on i386 and 16 bytes on amd64. > > There is a gcc-specific  __float128 type: > https://stackoverflow.com/questions/13516476/long-double-gcc-specific-and-float128 > Neither i386 nor amd64 have hardware-supported 128 bit floating point type. long double is defined by both i386 and amd64 Unix ABI as 80 bits (10 bytes) representation as defined by IEEEE FP standard and supported by x87 FPU (not-SSE). The difference in size is due to the different natural alignment between 32 and 64 bit ISA. The x86_64 psABI has interesting note that Android (non-Unix) ABI defines 128bit representation for long double. Operations on it must be implemented in software.