+2012-11-06 Tristan Gingold <gingold@adacore.com>
+
+ * exp_vfpt.adb: Document VAX float point layout.
+
+2012-11-06 Geert Bosch <bosch@adacore.com>
+
+ * eval_fat.adb (Machine): Don't return -0.0 on targets without
+ signed zeros.
+
+2012-11-06 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch9.adb (Analyze_Entry_Call_Alternative,
+ Check_Triggering_Statement): Reject properly an indirect call.
+
2012-11-06 Pascal Obry <obry@adacore.com>
* xoscons.adb, xutil.adb, xutil.ads: Add support for post-processing.
case Mode is
when Round_Even =>
- -- This rounding mode should not be used for static
- -- expressions, but only for compile-time evaluation of
- -- non-static expressions.
+ -- This rounding mode corresponds to the unbiased rounding
+ -- method that is used at run time. When the real value is
+ -- exactly between two machine numbers, choose the machine
+ -- number with its least significant bit equal to zero.
+
+ -- The recommendation advice in RM 4.9(38) is that static
+ -- expressions are rounded to machine numbers in the same
+ -- way as the target machine does.
if (Even and then N * 2 > D)
or else
-- Do not round to even as is done with IEEE arithmetic, but
-- instead round away from zero when the result is exactly
- -- between two machine numbers. See RM 4.9(38).
+ -- between two machine numbers. This biased rounding method
+ -- should not be used to convert static expressions to
+ -- machine numbers, see AI95-268.
if N * 2 >= D then
Fraction := Fraction + 1;
- Machine_Mantissa_Value (RT) + Uint_1;
begin
if X_Exp < Emin_Den or not Denorm_On_Target then
- if UR_Is_Negative (X) then
+ if Signed_Zeros_On_Target and then UR_Is_Negative (X) then
Error_Msg_N
("floating-point value underflows to -0.0?", Enode);
return Ureal_M_0;
-- --
-- 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- --
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;
Analyze (Call);
+ -- An indirect call in this context is illegal. A procedure call that
+ -- does not involve a renaming of an entry is illegal as well, but this
+ -- and other semantic errors are caught during resolution.
+
+ if Nkind (Call) = N_Explicit_Dereference then
+ Error_Msg_N
+ ("entry call or dispatching primitive of interface required ", N);
+ end if;
+
if Is_Non_Empty_List (Statements (N)) then
Analyze_Statements (Statements (N));
end if;
("dispatching operation of limited or synchronized " &
"interface required (RM 9.7.2(3))!", Error_Node);
end if;
+
+ elsif Nkind (Trigger) = N_Explicit_Dereference then
+ Error_Msg_N
+ ("entry call or dispatching primitive of interface required ",
+ Trigger);
end if;
end if;
end Check_Triggering_Statement;