From patchwork Tue Nov 6 10:05:22 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Charlet X-Patchwork-Id: 197436 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 31F482C00B1 for ; Tue, 6 Nov 2012 21:05:36 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1352801137; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Cc:Subject:Message-ID: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=FM9HdaYUApiJoJ9KSonm Ji1H3HY=; b=BSZ/A0Nn/Lrr6wcPBnps9eoUuSmi2Wc1MHWEcePiXMPfWMNtYVte KGz1ikTPHZgRsWlojdh9dMBC2/ue7C+AfwKY27ogluvSP9UvWqT7i87jtXxqzC6V Ldg2CoZFnblwJgodPEuFJ/IeObJ3G3G3PU0Ob+Tcmx/eOc4HxC4YGe0= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Jca01dBUSb9iZINrdkcSHHvJLHc6+S5VmyrHXmlEHI9ch4/HUuFqMKL+yCNns6 Y3LkP1RzqFaVOmpo0Q0oebSGCrolpTVUlkhY6EZVMmQoU90UikOE5IzgpNHBS9Qa JEFIzg412yRvB3EIagUc4hfJ9xICIsLny3oFOoqcIYGXQ=; Received: (qmail 882 invoked by alias); 6 Nov 2012 10:05:31 -0000 Received: (qmail 874 invoked by uid 22791); 6 Nov 2012 10:05:31 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 06 Nov 2012 10:05:23 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 60FAE1C7F80; Tue, 6 Nov 2012 05:05:22 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id h3+qfkQn7QHO; Tue, 6 Nov 2012 05:05:22 -0500 (EST) Received: from kwai.gnat.com (kwai.gnat.com [205.232.38.4]) by rock.gnat.com (Postfix) with ESMTP id 36A8B1C7F7D; Tue, 6 Nov 2012 05:05:22 -0500 (EST) Received: by kwai.gnat.com (Postfix, from userid 4192) id 31DDF3FF09; Tue, 6 Nov 2012 05:05:22 -0500 (EST) Date: Tue, 6 Nov 2012 05:05:22 -0500 From: Arnaud Charlet To: gcc-patches@gcc.gnu.org Cc: Tristan Gingold Subject: [Ada] Document vax float point representation Message-ID: <20121106100522.GA11784@adacore.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Comments added. Tested on x86_64-pc-linux-gnu, committed on trunk 2012-11-06 Tristan Gingold * exp_vfpt.adb: Document VAX float point layout. Index: exp_vfpt.adb =================================================================== --- exp_vfpt.adb (revision 193215) +++ exp_vfpt.adb (working copy) @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1997-2010, Free Software Foundation, Inc. -- +-- Copyright (C) 1997-2012, Free Software Foundation, Inc. -- -- -- -- GNAT is free software; you can redistribute it and/or modify it under -- -- terms of the GNU General Public License as published by the Free Soft- -- @@ -37,6 +37,78 @@ package body Exp_VFpt is + -- Vax floating point format (from Vax Architecture Reference Manual + -- version 6): + -- + -- Float F: + -- -------- + -- + -- 1 1 + -- 5 4 7 6 0 + -- +-+---------------+--------------+ + -- |S| exp | fraction | A + -- +-+---------------+--------------+ + -- | fraction | A + 2 + -- +--------------------------------+ + -- + -- bit 15 is the sign bit, + -- bits 14:7 is the excess 128 binary exponent, + -- bits 6:0 and 31:16 the normalized 24-bit fraction with the redundant + -- most significant fraction bit not represented. + -- + -- An exponent value of 0 together with a sign bit of 0, is taken to + -- indicate that the datum has a value of 0. Exponent values of 1 through + -- 255 indicate true binary exponents of -127 to +127. An exponent value + -- of 0, together with a sign bit of 1, is taken as reserved. + -- + -- Note that fraction bits are not continuous in memory, VAX is little + -- endian (LSB first). + -- + -- Float D: + -- -------- + -- + -- 1 1 + -- 5 4 7 6 0 + -- +-+---------------+--------------+ + -- |S| exp | fraction | A + -- +-+---------------+--------------+ + -- | fraction | A + 2 + -- +--------------------------------+ + -- | fraction | A + 4 + -- +--------------------------------+ + -- | fraction | A + 6 + -- +--------------------------------+ + -- + -- Like Float F but with 55 bits for the fraction. + -- + -- Float G: + -- -------- + -- + -- 1 1 + -- 5 4 4 3 0 + -- +-+---------------------+--------+ + -- |S| exp | fract | A + -- +-+---------------------+--------+ + -- | fraction | A + 2 + -- +--------------------------------+ + -- | fraction | A + 4 + -- +--------------------------------+ + -- | fraction | A + 6 + -- +--------------------------------+ + -- + -- Exponent values of 1 through 2047 indicate trye binary exponents of + -- -1023 to +1023. + -- + -- Main differences compared to IEEE 754: + -- + -- * No denormalized numbers + -- * No infinity + -- * No NaN + -- * No -0.0 + -- * Reserved values (exp = 0, sign = 1) + -- * Vax mantissa represent values [0.5, 1) + -- * Bias is shifted by 1 (for single float: 128 on Vax, 127 on IEEE) + VAXFF_Digits : constant := 6; VAXDF_Digits : constant := 9; VAXGF_Digits : constant := 15;