From 1098e722a58fa099463b42eebd3761b1e53588d5 Mon Sep 17 00:00:00 2001 From: Arnaud Charlet Date: Fri, 20 Feb 2015 14:54:40 +0100 Subject: [PATCH] [multiple changes] 2015-02-20 Robert Dewar * sem_prag.adb: Minor comment clarification. 2015-02-20 Olivier Hainque * g-allein.ads (vec_ctf, vec_vcsfx, vec_vcfux): Remove. * g-alleve.ads, g-alleva.adb (vcfux): Likewise. * g-alveop.ads (vec_vcfsx, vec_vcfux): Just rename the ll versions. (vec_ctf): Now renamings as well. From-SVN: r220857 --- gcc/ada/ChangeLog | 11 ++++++ gcc/ada/g-allein.ads | 54 +------------------------ gcc/ada/g-alleve.adb | 10 ++--- gcc/ada/g-alleve.ads | 6 +-- gcc/ada/g-alveop.ads | 93 +++++++++++++++++++------------------------- gcc/ada/sem_prag.adb | 3 +- 6 files changed, 61 insertions(+), 116 deletions(-) diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 9fdfd9ed5d8..5d18df4fa76 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,14 @@ +2015-02-20 Robert Dewar + + * sem_prag.adb: Minor comment clarification. + +2015-02-20 Olivier Hainque + + * g-allein.ads (vec_ctf, vec_vcsfx, vec_vcfux): Remove. + * g-alleve.ads, g-alleva.adb (vcfux): Likewise. + * g-alveop.ads (vec_vcfsx, vec_vcfux): Just rename the ll versions. + (vec_ctf): Now renamings as well. + 2015-02-20 Robert Dewar * switch-c.adb, bindgen.adb: Minor reformatting. diff --git a/gcc/ada/g-allein.ads b/gcc/ada/g-allein.ads index 1346fdd56c5..3224c2cf01f 100644 --- a/gcc/ada/g-allein.ads +++ b/gcc/ada/g-allein.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2015, 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- -- @@ -54,58 +54,6 @@ package GNAT.Altivec.Low_Level_Interface is use GNAT.Altivec.Vector_Types; - -- vec_ctf -- - - function vec_ctf_vui_cint_r_vf - (A : vector_unsigned_int; - B : c_int) return vector_float; - - pragma Import - (LL_Altivec, vec_ctf_vui_cint_r_vf, "__builtin_altivec_vcfux"); - - function vec_ctf_vsi_cint_r_vf - (A : vector_signed_int; - B : c_int) return vector_float; - - pragma Import - (LL_Altivec, vec_ctf_vsi_cint_r_vf, "__builtin_altivec_vcfsx"); - - -- vec_vcfsx -- - - function vec_vcfsx_vsi_cint_r_vf - (A : vector_signed_int; - B : c_int) return vector_float; - - pragma Import - (LL_Altivec, vec_vcfsx_vsi_cint_r_vf, "__builtin_altivec_vcfsx"); - - -- vec_vcfux -- - - function vec_vcfux_vui_cint_r_vf - (A : vector_unsigned_int; - B : c_int) return vector_float; - - pragma Import - (LL_Altivec, vec_vcfux_vui_cint_r_vf, "__builtin_altivec_vcfux"); - - -- vec_cts -- - - function vec_cts_vf_cint_r_vsi - (A : vector_float; - B : c_int) return vector_signed_int; - - pragma Import - (LL_Altivec, vec_cts_vf_cint_r_vsi, "__builtin_altivec_vctsxs"); - - -- vec_ctu -- - - function vec_ctu_vf_cint_r_vui - (A : vector_float; - B : c_int) return vector_unsigned_int; - - pragma Import - (LL_Altivec, vec_ctu_vf_cint_r_vui, "__builtin_altivec_vctuxs"); - -- vec_dss -- procedure vec_dss_cint diff --git a/gcc/ada/g-alleve.adb b/gcc/ada/g-alleve.adb index 39d0b7240db..962401d9885 100644 --- a/gcc/ada/g-alleve.adb +++ b/gcc/ada/g-alleve.adb @@ -7,7 +7,7 @@ -- B o d y -- -- (Soft Binding Version) -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2015, 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- -- @@ -2524,9 +2524,9 @@ package body GNAT.Altivec.Low_Level_Vectors is -- vcfux -- ----------- - function vcfux (A : LL_VSI; B : c_int) return LL_VF is + function vcfux (A : LL_VUI; B : c_int) return LL_VF is + VA : constant VUI_View := To_View (A); D : VF_View; - VA : constant VUI_View := To_View (To_LL_VUI (A)); K : Vfloat_Range; begin @@ -2588,7 +2588,7 @@ package body GNAT.Altivec.Low_Level_Vectors is -- vctuxs -- ------------ - function vctuxs (A : LL_VF; B : c_int) return LL_VSI is + function vctuxs (A : LL_VF; B : c_int) return LL_VUI is VA : constant VF_View := To_View (A); D : VUI_View; K : Vfloat_Range; @@ -2602,7 +2602,7 @@ package body GNAT.Altivec.Low_Level_Vectors is * F64 (2.0 ** Integer (B))); end loop; - return To_LL_VSI (To_Vector (D)); + return To_Vector (D); end vctuxs; --------- diff --git a/gcc/ada/g-alleve.ads b/gcc/ada/g-alleve.ads index 8c46dab6536..66718c1732f 100644 --- a/gcc/ada/g-alleve.ads +++ b/gcc/ada/g-alleve.ads @@ -7,7 +7,7 @@ -- S p e c -- -- (Soft Binding Version) -- -- -- --- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2015, 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- -- @@ -111,11 +111,11 @@ package GNAT.Altivec.Low_Level_Vectors is function vcmpgtsw (A : LL_VSI; B : LL_VSI) return LL_VSI; function vcmpgtfp (A : LL_VF; B : LL_VF) return LL_VSI; - function vcfux (A : LL_VSI; B : c_int) return LL_VF; + function vcfux (A : LL_VUI; B : c_int) return LL_VF; function vcfsx (A : LL_VSI; B : c_int) return LL_VF; function vctsxs (A : LL_VF; B : c_int) return LL_VSI; - function vctuxs (A : LL_VF; B : c_int) return LL_VSI; + function vctuxs (A : LL_VF; B : c_int) return LL_VUI; procedure dss (A : c_int); procedure dssall; diff --git a/gcc/ada/g-alveop.ads b/gcc/ada/g-alveop.ads index 351e450570a..6c9d8000512 100644 --- a/gcc/ada/g-alveop.ads +++ b/gcc/ada/g-alveop.ads @@ -6,7 +6,7 @@ -- -- -- S p e c -- -- -- --- Copyright (C) 2004-2014, Free Software Foundation, Inc. -- +-- Copyright (C) 2004-2015, 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- -- @@ -34,17 +34,13 @@ with GNAT.Altivec.Vector_Types; use GNAT.Altivec.Vector_Types; with GNAT.Altivec.Low_Level_Interface; use GNAT.Altivec.Low_Level_Interface; +with GNAT.Altivec.Low_Level_Vectors; package GNAT.Altivec.Vector_Operations is - -- The vast majority of the operations exposed here are overloads over a - -- much smaller set of low level primitives with type conversions around. - -- - -- In some cases, a direct binding without any intermediate body is - -- possible or even mandatory for technical reasons. What we provide - -- here for such cases are renamings of straight imports exposed by - -- Altivec.Low_Level_Interface. See the comments in the private part for - -- additional details. + -- The vast majority of the operations exposed here are type conversion + -- wrappers around a much smaller set of low level primitives, exposed by + -- the Altivec.Low_Level_Interface package. ------------------------------------------------------- -- [PIM-4.4 Generic and Specific AltiVec operations] -- @@ -850,45 +846,33 @@ package GNAT.Altivec.Vector_Operations is (A : vector_float; B : vector_float) return vector_bool_int; - -- vec_ctf -- - - function vec_ctf - (A : vector_unsigned_int; - B : c_int) return vector_float - renames Low_Level_Interface.vec_ctf_vui_cint_r_vf; - - function vec_ctf - (A : vector_signed_int; - B : c_int) return vector_float - renames Low_Level_Interface.vec_ctf_vsi_cint_r_vf; - -- vec_vcfsx -- function vec_vcfsx (A : vector_signed_int; B : c_int) return vector_float - renames Low_Level_Interface.vec_vcfsx_vsi_cint_r_vf; + renames Low_Level_Vectors.vcfsx; -- vec_vcfux -- function vec_vcfux (A : vector_unsigned_int; B : c_int) return vector_float - renames Low_Level_Interface.vec_vcfux_vui_cint_r_vf; + renames Low_Level_Vectors.vcfux; - -- vec_cts -- + -- vec_vctsxs -- - function vec_cts + function vec_vctsxs (A : vector_float; B : c_int) return vector_signed_int - renames Low_Level_Interface.vec_cts_vf_cint_r_vsi; + renames Low_Level_Vectors.vctsxs; - -- vec_ctu -- + -- vec_vctuxs -- - function vec_ctu + function vec_vctuxs (A : vector_float; B : c_int) return vector_unsigned_int - renames Low_Level_Interface.vec_ctu_vf_cint_r_vui; + renames Low_Level_Vectors.vctuxs; -- vec_dss -- @@ -5825,6 +5809,32 @@ package GNAT.Altivec.Vector_Operations is -- Straight overloads of routines aboves -- ------------------------------------------- + -- vec_ctf -- + + function vec_ctf + (A : vector_unsigned_int; + B : c_int) return vector_float + renames vec_vcfux; + + function vec_ctf + (A : vector_signed_int; + B : c_int) return vector_float + renames vec_vcfsx; + + -- vec_cts -- + + function vec_cts + (A : vector_float; + B : c_int) return vector_signed_int + renames vec_vctsxs; + + -- vec_ctu -- + + function vec_ctu + (A : vector_float; + B : c_int) return vector_unsigned_int + renames vec_vctuxs; + -- vec_vaddcuw -- function vec_vaddcuw @@ -6096,20 +6106,6 @@ package GNAT.Altivec.Vector_Operations is B : vector_float) return vector_bool_int renames vec_cmpge; - -- vec_vctsxs -- - - function vec_vctsxs - (A : vector_float; - B : c_int) return vector_signed_int - renames vec_cts; - - -- vec_vctuxs -- - - function vec_vctuxs - (A : vector_float; - B : c_int) return vector_unsigned_int - renames vec_ctu; - -- vec_vexptefp -- function vec_vexptefp @@ -7868,17 +7864,6 @@ private -- begin -- return To_VBC (vcmpgtub (To_VSC (B), To_VSC (A))); -- end vec_cmplt; - -- - -- Conversely, a direct (without wrapper) binding is sometimes mandatory - -- in the Hard binding case, because the corresponding low level code - -- accept only literal values for some arguments. Inlined calls to the - -- wrapper with proper arguments would be fine, but the wrapper body - -- itself would not be compilable. These can of course also be used in the - -- Soft binding, and so are naturally in this common unit. - -- - -- Fortunately, the sets of operations for which a wrapper is required - -- and the set of operations for which a wrapper would not be compilable - -- do not intersect. ----------------------------- -- Inlining considerations -- diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 823e4cbafd0..ec7292eae88 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -15730,7 +15730,8 @@ package body Sem_Prag is ("pragma% only allowed for private type", Arg1); end if; - -- Not allowed for abstract type + -- Not allowed for abstract type in the non-class case (it is + -- allowed to use Invariant'Class for abstract types). if Is_Abstract_Type (Typ) and then not Class_Present (N) then Error_Pragma_Arg -- 2.30.2