Commit cd8e18e7 by Olivier Hainque Committed by Arnaud Charlet

g-allein.ads, [...]: Code clean ups.

2015-02-20  Olivier Hainque  <hainque@adacore.com>

	* g-allein.ads, g-alveop.ads, g-alveop.adb: Code clean ups.

From-SVN: r220865
parent 9b9e7e8a
2015-02-20 Olivier Hainque <hainque@adacore.com> 2015-02-20 Olivier Hainque <hainque@adacore.com>
* g-allein.ads (vec_vspltw): Remove. * g-allein.ads, g-alveop.ads, g-alveop.adb: Code clean ups.
* g-alveop.ad?: Replace vec_vspltw renamings by proper Inline_Always
wrappers with Intrinsic convention.
2015-02-20 Olivier Hainque <hainque@adacore.com>
* g-allein.ads (vec_dstt): Remove.
* g-alveop.ad?: Replace vec_dstt renamings by proper Inline_Always
wrappers with Intrinsic convention.
2015-02-20 Olivier Hainque <hainque@adacore.com>
* g-allein.ads (vec_dst): Remove.
* g-alveop.ad?: Replace vec_dst renamings by proper Inline_Always
wrappers with Intrinsic convention.
2015-02-20 Olivier Hainque <hainque@adacore.com>
* g-allein.ads (vec_dss, vec_dssall): Remove.
* g-alveop.ads (vec_dss, vec_dssall): Rename the ll versions.
2015-02-20 Robert Dewar <dewar@adacore.com> 2015-02-20 Robert Dewar <dewar@adacore.com>
......
...@@ -33,292 +33,17 @@ ...@@ -33,292 +33,17 @@
-- both bindings (Hard or Soft), and relevant to the interfacing with the -- both bindings (Hard or Soft), and relevant to the interfacing with the
-- underlying Low Level support. -- underlying Low Level support.
-- The set of "services" includes: with GNAT.Altivec.Vector_Types; use GNAT.Altivec.Vector_Types;
-- with GNAT.Altivec.Low_Level_Vectors; use GNAT.Altivec.Low_Level_Vectors;
-- o Imports to the low level routines for which a direct binding is
-- mandatory (or just possible when analyzed as such).
--
-- o Conversion routines (unchecked) between low level types, or between
-- various pointer representations.
with GNAT.Altivec.Vector_Types;
with GNAT.Altivec.Low_Level_Vectors;
with Ada.Unchecked_Conversion; with Ada.Unchecked_Conversion;
package GNAT.Altivec.Low_Level_Interface is package GNAT.Altivec.Low_Level_Interface is
----------------------------------------------------------------------------
-- Imports for "argument must be literal" constraints in the Hard binding --
----------------------------------------------------------------------------
use GNAT.Altivec.Vector_Types;
-- vec_sld --
-- ??? The base GCC implementation maps everything to vsldoi_4si, while
-- it defines builtin variants for all the modes. Adjust here, to avoid
-- the infamous argument mode mismatch.
function vec_sld_vf_vf_cint_r_vf
(A : vector_float;
B : vector_float;
C : c_int) return vector_float;
pragma Import
(LL_Altivec, vec_sld_vf_vf_cint_r_vf, "__builtin_altivec_vsldoi_4sf");
function vec_sld_vsi_vsi_cint_r_vsi
(A : vector_signed_int;
B : vector_signed_int;
C : c_int) return vector_signed_int;
pragma Import
(LL_Altivec, vec_sld_vsi_vsi_cint_r_vsi, "__builtin_altivec_vsldoi_4si");
function vec_sld_vui_vui_cint_r_vui
(A : vector_unsigned_int;
B : vector_unsigned_int;
C : c_int) return vector_unsigned_int;
pragma Import
(LL_Altivec, vec_sld_vui_vui_cint_r_vui, "__builtin_altivec_vsldoi_4si");
function vec_sld_vbi_vbi_cint_r_vbi
(A : vector_bool_int;
B : vector_bool_int;
C : c_int) return vector_bool_int;
pragma Import
(LL_Altivec, vec_sld_vbi_vbi_cint_r_vbi, "__builtin_altivec_vsldoi_4si");
function vec_sld_vss_vss_cint_r_vss
(A : vector_signed_short;
B : vector_signed_short;
C : c_int) return vector_signed_short;
pragma Import
(LL_Altivec, vec_sld_vss_vss_cint_r_vss, "__builtin_altivec_vsldoi_8hi");
function vec_sld_vus_vus_cint_r_vus
(A : vector_unsigned_short;
B : vector_unsigned_short;
C : c_int) return vector_unsigned_short;
pragma Import
(LL_Altivec, vec_sld_vus_vus_cint_r_vus, "__builtin_altivec_vsldoi_8hi");
function vec_sld_vbs_vbs_cint_r_vbs
(A : vector_bool_short;
B : vector_bool_short;
C : c_int) return vector_bool_short;
pragma Import
(LL_Altivec, vec_sld_vbs_vbs_cint_r_vbs, "__builtin_altivec_vsldoi_8hi");
function vec_sld_vx_vx_cint_r_vx
(A : vector_pixel;
B : vector_pixel;
C : c_int) return vector_pixel;
pragma Import
(LL_Altivec, vec_sld_vx_vx_cint_r_vx, "__builtin_altivec_vsldoi_8hi");
function vec_sld_vsc_vsc_cint_r_vsc
(A : vector_signed_char;
B : vector_signed_char;
C : c_int) return vector_signed_char;
pragma Import
(LL_Altivec, vec_sld_vsc_vsc_cint_r_vsc, "__builtin_altivec_vsldoi_16qi");
function vec_sld_vuc_vuc_cint_r_vuc
(A : vector_unsigned_char;
B : vector_unsigned_char;
C : c_int) return vector_unsigned_char;
pragma Import
(LL_Altivec, vec_sld_vuc_vuc_cint_r_vuc, "__builtin_altivec_vsldoi_16qi");
function vec_sld_vbc_vbc_cint_r_vbc
(A : vector_bool_char;
B : vector_bool_char;
C : c_int) return vector_bool_char;
pragma Import
(LL_Altivec, vec_sld_vbc_vbc_cint_r_vbc, "__builtin_altivec_vsldoi_16qi");
-- vec_splat --
function vec_splat_vsc_cint_r_vsc
(A : vector_signed_char;
B : c_int) return vector_signed_char;
pragma Import
(LL_Altivec, vec_splat_vsc_cint_r_vsc, "__builtin_altivec_vspltb");
function vec_splat_vuc_cint_r_vuc
(A : vector_unsigned_char;
B : c_int) return vector_unsigned_char;
pragma Import
(LL_Altivec, vec_splat_vuc_cint_r_vuc, "__builtin_altivec_vspltb");
function vec_splat_vbc_cint_r_vbc
(A : vector_bool_char;
B : c_int) return vector_bool_char;
pragma Import
(LL_Altivec, vec_splat_vbc_cint_r_vbc, "__builtin_altivec_vspltb");
function vec_splat_vss_cint_r_vss
(A : vector_signed_short;
B : c_int) return vector_signed_short;
pragma Import
(LL_Altivec, vec_splat_vss_cint_r_vss, "__builtin_altivec_vsplth");
function vec_splat_vus_cint_r_vus
(A : vector_unsigned_short;
B : c_int) return vector_unsigned_short;
pragma Import
(LL_Altivec, vec_splat_vus_cint_r_vus, "__builtin_altivec_vsplth");
function vec_splat_vbs_cint_r_vbs
(A : vector_bool_short;
B : c_int) return vector_bool_short;
pragma Import
(LL_Altivec, vec_splat_vbs_cint_r_vbs, "__builtin_altivec_vsplth");
function vec_splat_vx_cint_r_vx
(A : vector_pixel;
B : c_int) return vector_pixel;
pragma Import
(LL_Altivec, vec_splat_vx_cint_r_vx, "__builtin_altivec_vsplth");
function vec_splat_vf_cint_r_vf
(A : vector_float;
B : c_int) return vector_float;
pragma Import
(LL_Altivec, vec_splat_vf_cint_r_vf, "__builtin_altivec_vspltw");
function vec_splat_vsi_cint_r_vsi
(A : vector_signed_int;
B : c_int) return vector_signed_int;
pragma Import
(LL_Altivec, vec_splat_vsi_cint_r_vsi, "__builtin_altivec_vspltw");
function vec_splat_vui_cint_r_vui
(A : vector_unsigned_int;
B : c_int) return vector_unsigned_int;
pragma Import
(LL_Altivec, vec_splat_vui_cint_r_vui, "__builtin_altivec_vspltw");
function vec_splat_vbi_cint_r_vbi
(A : vector_bool_int;
B : c_int) return vector_bool_int;
pragma Import
(LL_Altivec, vec_splat_vbi_cint_r_vbi, "__builtin_altivec_vspltw");
-- vec_vspltb --
function vec_vspltb_vsc_cint_r_vsc
(A : vector_signed_char;
B : c_int) return vector_signed_char;
pragma Import
(LL_Altivec, vec_vspltb_vsc_cint_r_vsc, "__builtin_altivec_vspltb");
function vec_vspltb_vuc_cint_r_vuc
(A : vector_unsigned_char;
B : c_int) return vector_unsigned_char;
pragma Import
(LL_Altivec, vec_vspltb_vuc_cint_r_vuc, "__builtin_altivec_vspltb");
function vec_vspltb_vbc_cint_r_vbc
(A : vector_bool_char;
B : c_int) return vector_bool_char;
pragma Import
(LL_Altivec, vec_vspltb_vbc_cint_r_vbc, "__builtin_altivec_vspltb");
-- vec_splat_s8 --
function vec_splat_s8_cint_r_vsc
(A : c_int) return vector_signed_char;
pragma Import
(LL_Altivec, vec_splat_s8_cint_r_vsc, "__builtin_altivec_vspltisb");
-- vec_splat_s16 --
function vec_splat_s16_cint_r_vss
(A : c_int) return vector_signed_short;
pragma Import
(LL_Altivec, vec_splat_s16_cint_r_vss, "__builtin_altivec_vspltish");
-- vec_splat_s32 --
function vec_splat_s32_cint_r_vsi
(A : c_int) return vector_signed_int;
pragma Import
(LL_Altivec, vec_splat_s32_cint_r_vsi, "__builtin_altivec_vspltisw");
-- vec_splat_u8 --
function vec_splat_u8_cint_r_vuc
(A : c_int) return vector_unsigned_char;
pragma Import
(LL_Altivec, vec_splat_u8_cint_r_vuc, "__builtin_altivec_vspltisb");
-- vec_splat_u16 --
function vec_splat_u16_cint_r_vus
(A : c_int) return vector_unsigned_short;
pragma Import
(LL_Altivec, vec_splat_u16_cint_r_vus, "__builtin_altivec_vspltish");
-- vec_splat_u32 --
function vec_splat_u32_cint_r_vui
(A : c_int) return vector_unsigned_int;
pragma Import
(LL_Altivec, vec_splat_u32_cint_r_vui, "__builtin_altivec_vspltisw");
------------------------------------------------------------
-- Imports for low-level signature consistent subprograms --
------------------------------------------------------------
----------------------------------------- -----------------------------------------
-- Conversions between low level types -- -- Conversions between low level types --
----------------------------------------- -----------------------------------------
use GNAT.Altivec.Low_Level_Vectors;
-- Something like...
--
-- TYPES="LL_VBC LL_VUC LL_VSC LL_VBS LL_VUS LL_VSS \
-- LL_VBI LL_VUI LL_VSI LL_VF LL_VP"
-- for TT in `echo $TYPES`; do
-- for ST in `echo $TYPES`; do
-- echo "function To_$TT is new Ada.Unchecked_Conversion ($ST, $TT);"
-- done
-- echo ""
-- done
function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VBC, LL_VBC); function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VBC, LL_VBC);
function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VUC, LL_VBC); function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VUC, LL_VBC);
function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VSC, LL_VBC); function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VSC, LL_VBC);
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
with GNAT.Altivec.Low_Level_Vectors; use GNAT.Altivec.Low_Level_Vectors; with GNAT.Altivec.Low_Level_Interface; use GNAT.Altivec.Low_Level_Interface;
package body GNAT.Altivec.Vector_Operations is package body GNAT.Altivec.Vector_Operations is
...@@ -8273,6 +8273,116 @@ package body GNAT.Altivec.Vector_Operations is ...@@ -8273,6 +8273,116 @@ package body GNAT.Altivec.Vector_Operations is
return To_LL_VP (vsplth (To_LL_VSS (A), B)); return To_LL_VP (vsplth (To_LL_VSS (A), B));
end vec_vsplth; end vec_vsplth;
-- vec_vspltb --
function vec_vspltb
(A : vector_unsigned_char;
B : c_int) return vector_unsigned_char
is
begin
return To_LL_VUC (vspltb (To_LL_VSC (A), B));
end vec_vspltb;
function vec_vspltb
(A : vector_bool_char;
B : c_int) return vector_bool_char
is
begin
return To_LL_VBC (vspltb (To_LL_VSC (A), B));
end vec_vspltb;
-- vec_splat_u8 --
function vec_splat_u8
(A : c_int) return vector_unsigned_char
is
begin
return To_LL_VUC (vspltisb (A));
end vec_splat_u8;
-- vec_splat_u16 --
function vec_splat_u16
(A : c_int) return vector_unsigned_short
is
begin
return To_LL_VUS (vspltish (A));
end vec_splat_u16;
-- vec_splat_u32 --
function vec_splat_u32
(A : c_int) return vector_unsigned_int
is
begin
return To_LL_VUI (vspltisw (A));
end vec_splat_u32;
-- vec_sld --
function vec_sld
(A : vector_unsigned_int;
B : vector_unsigned_int;
C : c_int) return vector_unsigned_int
is
begin
return To_LL_VUI (vsldoi_4si (To_LL_VSI (A), To_LL_VSI (B), C));
end vec_sld;
function vec_sld
(A : vector_bool_int;
B : vector_bool_int;
C : c_int) return vector_bool_int
is
begin
return To_LL_VBI (vsldoi_4si (To_LL_VSI (A), To_LL_VSI (B), C));
end vec_sld;
function vec_sld
(A : vector_unsigned_short;
B : vector_unsigned_short;
C : c_int) return vector_unsigned_short
is
begin
return To_LL_VUS (vsldoi_8hi (To_LL_VSS (A), To_LL_VSS (B), C));
end vec_sld;
function vec_sld
(A : vector_bool_short;
B : vector_bool_short;
C : c_int) return vector_bool_short
is
begin
return To_LL_VBS (vsldoi_8hi (To_LL_VSS (A), To_LL_VSS (B), C));
end vec_sld;
function vec_sld
(A : vector_pixel;
B : vector_pixel;
C : c_int) return vector_pixel
is
begin
return To_LL_VP (vsldoi_8hi (To_LL_VSS (A), To_LL_VSS (B), C));
end vec_sld;
function vec_sld
(A : vector_unsigned_char;
B : vector_unsigned_char;
C : c_int) return vector_unsigned_char
is
begin
return To_LL_VUC (vsldoi_16qi (To_LL_VSC (A), To_LL_VSC (B), C));
end vec_sld;
function vec_sld
(A : vector_bool_char;
B : vector_bool_char;
C : c_int) return vector_bool_char
is
begin
return To_LL_VBC (vsldoi_16qi (To_LL_VSC (A), To_LL_VSC (B), C));
end vec_sld;
----------------------------------- -----------------------------------
-- Bodies for Altivec predicates -- -- Bodies for Altivec predicates --
----------------------------------- -----------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment