1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- G N A T . A L T I V E C . C O N V E R S I O N S --
9 -- Copyright (C) 2009, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
19 -- additional permissions described in the GCC Runtime Library Exception, --
20 -- version 3.1, as published by the Free Software Foundation. --
22 -- You should have received a copy of the GNU General Public License and --
23 -- a copy of the GCC Runtime Library Exception along with this program; --
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
25 -- <http://www.gnu.org/licenses/>. --
27 -- GNAT was originally developed by the GNAT team at New York University. --
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
30 ------------------------------------------------------------------------------
32 -- This unit provides the Vector/Views conversions
34 with GNAT
.Altivec
.Vector_Types
; use GNAT
.Altivec
.Vector_Types
;
35 with GNAT
.Altivec
.Vector_Views
; use GNAT
.Altivec
.Vector_Views
;
37 package GNAT
.Altivec
.Conversions
is
43 function To_Vector
(S
: VUC_View
) return VUC
;
44 function To_Vector
(S
: VSC_View
) return VSC
;
45 function To_Vector
(S
: VBC_View
) return VBC
;
47 function To_View
(S
: VUC
) return VUC_View
;
48 function To_View
(S
: VSC
) return VSC_View
;
49 function To_View
(S
: VBC
) return VBC_View
;
51 ----------------------
52 -- short components --
53 ----------------------
55 function To_Vector
(S
: VUS_View
) return VUS
;
56 function To_Vector
(S
: VSS_View
) return VSS
;
57 function To_Vector
(S
: VBS_View
) return VBS
;
59 function To_View
(S
: VUS
) return VUS_View
;
60 function To_View
(S
: VSS
) return VSS_View
;
61 function To_View
(S
: VBS
) return VBS_View
;
67 function To_Vector
(S
: VUI_View
) return VUI
;
68 function To_Vector
(S
: VSI_View
) return VSI
;
69 function To_Vector
(S
: VBI_View
) return VBI
;
71 function To_View
(S
: VUI
) return VUI_View
;
72 function To_View
(S
: VSI
) return VSI_View
;
73 function To_View
(S
: VBI
) return VBI_View
;
75 ----------------------
76 -- float components --
77 ----------------------
79 function To_Vector
(S
: VF_View
) return VF
;
81 function To_View
(S
: VF
) return VF_View
;
83 ----------------------
84 -- pixel components --
85 ----------------------
87 function To_Vector
(S
: VP_View
) return VP
;
89 function To_View
(S
: VP
) return VP_View
;
93 -- We want the above subprograms to always be inlined in the case of the
94 -- hard PowerPC AltiVec support in order to avoid the unnecessary function
95 -- call. On the other hand there is no problem with inlining these
96 -- subprograms on little-endian targets.
98 pragma Inline_Always
(To_Vector
);
99 pragma Inline_Always
(To_View
);
101 end GNAT
.Altivec
.Conversions
;