1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
5 -- G N A T . A L T I V E C . L O W _ L E V E L _ I N T E R F A C E --
9 -- Copyright (C) 2004-2015, 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 entities to be used internally by the units common to
33 -- both bindings (Hard or Soft), and relevant to the interfacing with the
34 -- underlying Low Level support.
36 -- The set of "services" includes:
38 -- o Imports to the low level routines for which a direct binding is
39 -- mandatory (or just possible when analyzed as such).
41 -- o Conversion routines (unchecked) between low level types, or between
42 -- various pointer representations.
44 with GNAT.Altivec.Vector_Types;
45 with GNAT.Altivec.Low_Level_Vectors;
47 with Ada.Unchecked_Conversion;
49 package GNAT.Altivec.Low_Level_Interface is
51 ----------------------------------------------------------------------------
52 -- Imports for "argument must be literal" constraints in the Hard binding --
53 ----------------------------------------------------------------------------
55 use GNAT.Altivec.Vector_Types;
59 procedure vec_dss_cint
63 (LL_Altivec, vec_dss_cint, "__builtin_altivec_dss");
67 procedure vec_dst_kvucp_cint_cint
68 (A : const_vector_unsigned_char_ptr;
73 (LL_Altivec, vec_dst_kvucp_cint_cint, "__builtin_altivec_dst");
75 procedure vec_dst_kvscp_cint_cint
76 (A : const_vector_signed_char_ptr;
81 (LL_Altivec, vec_dst_kvscp_cint_cint, "__builtin_altivec_dst");
83 procedure vec_dst_kvbcp_cint_cint
84 (A : const_vector_bool_char_ptr;
89 (LL_Altivec, vec_dst_kvbcp_cint_cint, "__builtin_altivec_dst");
91 procedure vec_dst_kvusp_cint_cint
92 (A : const_vector_unsigned_short_ptr;
97 (LL_Altivec, vec_dst_kvusp_cint_cint, "__builtin_altivec_dst");
99 procedure vec_dst_kvssp_cint_cint
100 (A : const_vector_signed_short_ptr;
105 (LL_Altivec, vec_dst_kvssp_cint_cint, "__builtin_altivec_dst");
107 procedure vec_dst_kvbsp_cint_cint
108 (A : const_vector_bool_short_ptr;
113 (LL_Altivec, vec_dst_kvbsp_cint_cint, "__builtin_altivec_dst");
115 procedure vec_dst_kvxp_cint_cint
116 (A : const_vector_pixel_ptr;
121 (LL_Altivec, vec_dst_kvxp_cint_cint, "__builtin_altivec_dst");
123 procedure vec_dst_kvuip_cint_cint
124 (A : const_vector_unsigned_int_ptr;
129 (LL_Altivec, vec_dst_kvuip_cint_cint, "__builtin_altivec_dst");
131 procedure vec_dst_kvsip_cint_cint
132 (A : const_vector_signed_int_ptr;
137 (LL_Altivec, vec_dst_kvsip_cint_cint, "__builtin_altivec_dst");
139 procedure vec_dst_kvbip_cint_cint
140 (A : const_vector_bool_int_ptr;
145 (LL_Altivec, vec_dst_kvbip_cint_cint, "__builtin_altivec_dst");
147 procedure vec_dst_kvfp_cint_cint
148 (A : const_vector_float_ptr;
153 (LL_Altivec, vec_dst_kvfp_cint_cint, "__builtin_altivec_dst");
155 procedure vec_dst_kucp_cint_cint
156 (A : const_unsigned_char_ptr;
161 (LL_Altivec, vec_dst_kucp_cint_cint, "__builtin_altivec_dst");
163 procedure vec_dst_kscp_cint_cint
164 (A : const_signed_char_ptr;
169 (LL_Altivec, vec_dst_kscp_cint_cint, "__builtin_altivec_dst");
171 procedure vec_dst_kusp_cint_cint
172 (A : const_unsigned_short_ptr;
177 (LL_Altivec, vec_dst_kusp_cint_cint, "__builtin_altivec_dst");
179 procedure vec_dst_ksp_cint_cint
180 (A : const_short_ptr;
185 (LL_Altivec, vec_dst_ksp_cint_cint, "__builtin_altivec_dst");
187 procedure vec_dst_kuip_cint_cint
188 (A : const_unsigned_int_ptr;
193 (LL_Altivec, vec_dst_kuip_cint_cint, "__builtin_altivec_dst");
195 procedure vec_dst_kip_cint_cint
201 (LL_Altivec, vec_dst_kip_cint_cint, "__builtin_altivec_dst");
203 procedure vec_dst_kulongp_cint_cint
204 (A : const_unsigned_long_ptr;
209 (LL_Altivec, vec_dst_kulongp_cint_cint, "__builtin_altivec_dst");
211 procedure vec_dst_klongp_cint_cint
217 (LL_Altivec, vec_dst_klongp_cint_cint, "__builtin_altivec_dst");
219 procedure vec_dst_kfp_cint_cint
220 (A : const_float_ptr;
225 (LL_Altivec, vec_dst_kfp_cint_cint, "__builtin_altivec_dst");
229 procedure vec_dstst_kvucp_cint_cint
230 (A : const_vector_unsigned_char_ptr;
235 (LL_Altivec, vec_dstst_kvucp_cint_cint, "__builtin_altivec_dstst");
237 procedure vec_dstst_kvscp_cint_cint
238 (A : const_vector_signed_char_ptr;
243 (LL_Altivec, vec_dstst_kvscp_cint_cint, "__builtin_altivec_dstst");
245 procedure vec_dstst_kvbcp_cint_cint
246 (A : const_vector_bool_char_ptr;
251 (LL_Altivec, vec_dstst_kvbcp_cint_cint, "__builtin_altivec_dstst");
253 procedure vec_dstst_kvusp_cint_cint
254 (A : const_vector_unsigned_short_ptr;
259 (LL_Altivec, vec_dstst_kvusp_cint_cint, "__builtin_altivec_dstst");
261 procedure vec_dstst_kvssp_cint_cint
262 (A : const_vector_signed_short_ptr;
267 (LL_Altivec, vec_dstst_kvssp_cint_cint, "__builtin_altivec_dstst");
269 procedure vec_dstst_kvbsp_cint_cint
270 (A : const_vector_bool_short_ptr;
275 (LL_Altivec, vec_dstst_kvbsp_cint_cint, "__builtin_altivec_dstst");
277 procedure vec_dstst_kvxp_cint_cint
278 (A : const_vector_pixel_ptr;
283 (LL_Altivec, vec_dstst_kvxp_cint_cint, "__builtin_altivec_dstst");
285 procedure vec_dstst_kvuip_cint_cint
286 (A : const_vector_unsigned_int_ptr;
291 (LL_Altivec, vec_dstst_kvuip_cint_cint, "__builtin_altivec_dstst");
293 procedure vec_dstst_kvsip_cint_cint
294 (A : const_vector_signed_int_ptr;
299 (LL_Altivec, vec_dstst_kvsip_cint_cint, "__builtin_altivec_dstst");
301 procedure vec_dstst_kvbip_cint_cint
302 (A : const_vector_bool_int_ptr;
307 (LL_Altivec, vec_dstst_kvbip_cint_cint, "__builtin_altivec_dstst");
309 procedure vec_dstst_kvfp_cint_cint
310 (A : const_vector_float_ptr;
315 (LL_Altivec, vec_dstst_kvfp_cint_cint, "__builtin_altivec_dstst");
317 procedure vec_dstst_kucp_cint_cint
318 (A : const_unsigned_char_ptr;
323 (LL_Altivec, vec_dstst_kucp_cint_cint, "__builtin_altivec_dstst");
325 procedure vec_dstst_kscp_cint_cint
326 (A : const_signed_char_ptr;
331 (LL_Altivec, vec_dstst_kscp_cint_cint, "__builtin_altivec_dstst");
333 procedure vec_dstst_kusp_cint_cint
334 (A : const_unsigned_short_ptr;
339 (LL_Altivec, vec_dstst_kusp_cint_cint, "__builtin_altivec_dstst");
341 procedure vec_dstst_ksp_cint_cint
342 (A : const_short_ptr;
347 (LL_Altivec, vec_dstst_ksp_cint_cint, "__builtin_altivec_dstst");
349 procedure vec_dstst_kuip_cint_cint
350 (A : const_unsigned_int_ptr;
355 (LL_Altivec, vec_dstst_kuip_cint_cint, "__builtin_altivec_dstst");
357 procedure vec_dstst_kip_cint_cint
363 (LL_Altivec, vec_dstst_kip_cint_cint, "__builtin_altivec_dstst");
365 procedure vec_dstst_kulongp_cint_cint
366 (A : const_unsigned_long_ptr;
371 (LL_Altivec, vec_dstst_kulongp_cint_cint, "__builtin_altivec_dstst");
373 procedure vec_dstst_klongp_cint_cint
379 (LL_Altivec, vec_dstst_klongp_cint_cint, "__builtin_altivec_dstst");
381 procedure vec_dstst_kfp_cint_cint
382 (A : const_float_ptr;
387 (LL_Altivec, vec_dstst_kfp_cint_cint, "__builtin_altivec_dstst");
391 procedure vec_dststt_kvucp_cint_cint
392 (A : const_vector_unsigned_char_ptr;
397 (LL_Altivec, vec_dststt_kvucp_cint_cint, "__builtin_altivec_dststt");
399 procedure vec_dststt_kvscp_cint_cint
400 (A : const_vector_signed_char_ptr;
405 (LL_Altivec, vec_dststt_kvscp_cint_cint, "__builtin_altivec_dststt");
407 procedure vec_dststt_kvbcp_cint_cint
408 (A : const_vector_bool_char_ptr;
413 (LL_Altivec, vec_dststt_kvbcp_cint_cint, "__builtin_altivec_dststt");
415 procedure vec_dststt_kvusp_cint_cint
416 (A : const_vector_unsigned_short_ptr;
421 (LL_Altivec, vec_dststt_kvusp_cint_cint, "__builtin_altivec_dststt");
423 procedure vec_dststt_kvssp_cint_cint
424 (A : const_vector_signed_short_ptr;
429 (LL_Altivec, vec_dststt_kvssp_cint_cint, "__builtin_altivec_dststt");
431 procedure vec_dststt_kvbsp_cint_cint
432 (A : const_vector_bool_short_ptr;
437 (LL_Altivec, vec_dststt_kvbsp_cint_cint, "__builtin_altivec_dststt");
439 procedure vec_dststt_kvxp_cint_cint
440 (A : const_vector_pixel_ptr;
445 (LL_Altivec, vec_dststt_kvxp_cint_cint, "__builtin_altivec_dststt");
447 procedure vec_dststt_kvuip_cint_cint
448 (A : const_vector_unsigned_int_ptr;
453 (LL_Altivec, vec_dststt_kvuip_cint_cint, "__builtin_altivec_dststt");
455 procedure vec_dststt_kvsip_cint_cint
456 (A : const_vector_signed_int_ptr;
461 (LL_Altivec, vec_dststt_kvsip_cint_cint, "__builtin_altivec_dststt");
463 procedure vec_dststt_kvbip_cint_cint
464 (A : const_vector_bool_int_ptr;
469 (LL_Altivec, vec_dststt_kvbip_cint_cint, "__builtin_altivec_dststt");
471 procedure vec_dststt_kvfp_cint_cint
472 (A : const_vector_float_ptr;
477 (LL_Altivec, vec_dststt_kvfp_cint_cint, "__builtin_altivec_dststt");
479 procedure vec_dststt_kucp_cint_cint
480 (A : const_unsigned_char_ptr;
485 (LL_Altivec, vec_dststt_kucp_cint_cint, "__builtin_altivec_dststt");
487 procedure vec_dststt_kscp_cint_cint
488 (A : const_signed_char_ptr;
493 (LL_Altivec, vec_dststt_kscp_cint_cint, "__builtin_altivec_dststt");
495 procedure vec_dststt_kusp_cint_cint
496 (A : const_unsigned_short_ptr;
501 (LL_Altivec, vec_dststt_kusp_cint_cint, "__builtin_altivec_dststt");
503 procedure vec_dststt_ksp_cint_cint
504 (A : const_short_ptr;
509 (LL_Altivec, vec_dststt_ksp_cint_cint, "__builtin_altivec_dststt");
511 procedure vec_dststt_kuip_cint_cint
512 (A : const_unsigned_int_ptr;
517 (LL_Altivec, vec_dststt_kuip_cint_cint, "__builtin_altivec_dststt");
519 procedure vec_dststt_kip_cint_cint
525 (LL_Altivec, vec_dststt_kip_cint_cint, "__builtin_altivec_dststt");
527 procedure vec_dststt_kulongp_cint_cint
528 (A : const_unsigned_long_ptr;
533 (LL_Altivec, vec_dststt_kulongp_cint_cint, "__builtin_altivec_dststt");
535 procedure vec_dststt_klongp_cint_cint
541 (LL_Altivec, vec_dststt_klongp_cint_cint, "__builtin_altivec_dststt");
543 procedure vec_dststt_kfp_cint_cint
544 (A : const_float_ptr;
549 (LL_Altivec, vec_dststt_kfp_cint_cint, "__builtin_altivec_dststt");
553 procedure vec_dstt_kvucp_cint_cint
554 (A : const_vector_unsigned_char_ptr;
559 (LL_Altivec, vec_dstt_kvucp_cint_cint, "__builtin_altivec_dstt");
561 procedure vec_dstt_kvscp_cint_cint
562 (A : const_vector_signed_char_ptr;
567 (LL_Altivec, vec_dstt_kvscp_cint_cint, "__builtin_altivec_dstt");
569 procedure vec_dstt_kvbcp_cint_cint
570 (A : const_vector_bool_char_ptr;
575 (LL_Altivec, vec_dstt_kvbcp_cint_cint, "__builtin_altivec_dstt");
577 procedure vec_dstt_kvusp_cint_cint
578 (A : const_vector_unsigned_short_ptr;
583 (LL_Altivec, vec_dstt_kvusp_cint_cint, "__builtin_altivec_dstt");
585 procedure vec_dstt_kvssp_cint_cint
586 (A : const_vector_signed_short_ptr;
591 (LL_Altivec, vec_dstt_kvssp_cint_cint, "__builtin_altivec_dstt");
593 procedure vec_dstt_kvbsp_cint_cint
594 (A : const_vector_bool_short_ptr;
599 (LL_Altivec, vec_dstt_kvbsp_cint_cint, "__builtin_altivec_dstt");
601 procedure vec_dstt_kvxp_cint_cint
602 (A : const_vector_pixel_ptr;
607 (LL_Altivec, vec_dstt_kvxp_cint_cint, "__builtin_altivec_dstt");
609 procedure vec_dstt_kvuip_cint_cint
610 (A : const_vector_unsigned_int_ptr;
615 (LL_Altivec, vec_dstt_kvuip_cint_cint, "__builtin_altivec_dstt");
617 procedure vec_dstt_kvsip_cint_cint
618 (A : const_vector_signed_int_ptr;
623 (LL_Altivec, vec_dstt_kvsip_cint_cint, "__builtin_altivec_dstt");
625 procedure vec_dstt_kvbip_cint_cint
626 (A : const_vector_bool_int_ptr;
631 (LL_Altivec, vec_dstt_kvbip_cint_cint, "__builtin_altivec_dstt");
633 procedure vec_dstt_kvfp_cint_cint
634 (A : const_vector_float_ptr;
639 (LL_Altivec, vec_dstt_kvfp_cint_cint, "__builtin_altivec_dstt");
641 procedure vec_dstt_kucp_cint_cint
642 (A : const_unsigned_char_ptr;
647 (LL_Altivec, vec_dstt_kucp_cint_cint, "__builtin_altivec_dstt");
649 procedure vec_dstt_kscp_cint_cint
650 (A : const_signed_char_ptr;
655 (LL_Altivec, vec_dstt_kscp_cint_cint, "__builtin_altivec_dstt");
657 procedure vec_dstt_kusp_cint_cint
658 (A : const_unsigned_short_ptr;
663 (LL_Altivec, vec_dstt_kusp_cint_cint, "__builtin_altivec_dstt");
665 procedure vec_dstt_ksp_cint_cint
666 (A : const_short_ptr;
671 (LL_Altivec, vec_dstt_ksp_cint_cint, "__builtin_altivec_dstt");
673 procedure vec_dstt_kuip_cint_cint
674 (A : const_unsigned_int_ptr;
679 (LL_Altivec, vec_dstt_kuip_cint_cint, "__builtin_altivec_dstt");
681 procedure vec_dstt_kip_cint_cint
687 (LL_Altivec, vec_dstt_kip_cint_cint, "__builtin_altivec_dstt");
689 procedure vec_dstt_kulongp_cint_cint
690 (A : const_unsigned_long_ptr;
695 (LL_Altivec, vec_dstt_kulongp_cint_cint, "__builtin_altivec_dstt");
697 procedure vec_dstt_klongp_cint_cint
703 (LL_Altivec, vec_dstt_klongp_cint_cint, "__builtin_altivec_dstt");
705 procedure vec_dstt_kfp_cint_cint
706 (A : const_float_ptr;
711 (LL_Altivec, vec_dstt_kfp_cint_cint, "__builtin_altivec_dstt");
715 -- ??? The base GCC implementation maps everything to vsldoi_4si, while
716 -- it defines builtin variants for all the modes. Adjust here, to avoid
717 -- the infamous argument mode mismatch.
719 function vec_sld_vf_vf_cint_r_vf
722 C : c_int) return vector_float;
725 (LL_Altivec, vec_sld_vf_vf_cint_r_vf, "__builtin_altivec_vsldoi_4sf");
727 function vec_sld_vsi_vsi_cint_r_vsi
728 (A : vector_signed_int;
729 B : vector_signed_int;
730 C : c_int) return vector_signed_int;
733 (LL_Altivec, vec_sld_vsi_vsi_cint_r_vsi, "__builtin_altivec_vsldoi_4si");
735 function vec_sld_vui_vui_cint_r_vui
736 (A : vector_unsigned_int;
737 B : vector_unsigned_int;
738 C : c_int) return vector_unsigned_int;
741 (LL_Altivec, vec_sld_vui_vui_cint_r_vui, "__builtin_altivec_vsldoi_4si");
743 function vec_sld_vbi_vbi_cint_r_vbi
744 (A : vector_bool_int;
746 C : c_int) return vector_bool_int;
749 (LL_Altivec, vec_sld_vbi_vbi_cint_r_vbi, "__builtin_altivec_vsldoi_4si");
751 function vec_sld_vss_vss_cint_r_vss
752 (A : vector_signed_short;
753 B : vector_signed_short;
754 C : c_int) return vector_signed_short;
757 (LL_Altivec, vec_sld_vss_vss_cint_r_vss, "__builtin_altivec_vsldoi_8hi");
759 function vec_sld_vus_vus_cint_r_vus
760 (A : vector_unsigned_short;
761 B : vector_unsigned_short;
762 C : c_int) return vector_unsigned_short;
765 (LL_Altivec, vec_sld_vus_vus_cint_r_vus, "__builtin_altivec_vsldoi_8hi");
767 function vec_sld_vbs_vbs_cint_r_vbs
768 (A : vector_bool_short;
769 B : vector_bool_short;
770 C : c_int) return vector_bool_short;
773 (LL_Altivec, vec_sld_vbs_vbs_cint_r_vbs, "__builtin_altivec_vsldoi_8hi");
775 function vec_sld_vx_vx_cint_r_vx
778 C : c_int) return vector_pixel;
781 (LL_Altivec, vec_sld_vx_vx_cint_r_vx, "__builtin_altivec_vsldoi_8hi");
783 function vec_sld_vsc_vsc_cint_r_vsc
784 (A : vector_signed_char;
785 B : vector_signed_char;
786 C : c_int) return vector_signed_char;
789 (LL_Altivec, vec_sld_vsc_vsc_cint_r_vsc, "__builtin_altivec_vsldoi_16qi");
791 function vec_sld_vuc_vuc_cint_r_vuc
792 (A : vector_unsigned_char;
793 B : vector_unsigned_char;
794 C : c_int) return vector_unsigned_char;
797 (LL_Altivec, vec_sld_vuc_vuc_cint_r_vuc, "__builtin_altivec_vsldoi_16qi");
799 function vec_sld_vbc_vbc_cint_r_vbc
800 (A : vector_bool_char;
801 B : vector_bool_char;
802 C : c_int) return vector_bool_char;
805 (LL_Altivec, vec_sld_vbc_vbc_cint_r_vbc, "__builtin_altivec_vsldoi_16qi");
809 function vec_splat_vsc_cint_r_vsc
810 (A : vector_signed_char;
811 B : c_int) return vector_signed_char;
814 (LL_Altivec, vec_splat_vsc_cint_r_vsc, "__builtin_altivec_vspltb");
816 function vec_splat_vuc_cint_r_vuc
817 (A : vector_unsigned_char;
818 B : c_int) return vector_unsigned_char;
821 (LL_Altivec, vec_splat_vuc_cint_r_vuc, "__builtin_altivec_vspltb");
823 function vec_splat_vbc_cint_r_vbc
824 (A : vector_bool_char;
825 B : c_int) return vector_bool_char;
828 (LL_Altivec, vec_splat_vbc_cint_r_vbc, "__builtin_altivec_vspltb");
830 function vec_splat_vss_cint_r_vss
831 (A : vector_signed_short;
832 B : c_int) return vector_signed_short;
835 (LL_Altivec, vec_splat_vss_cint_r_vss, "__builtin_altivec_vsplth");
837 function vec_splat_vus_cint_r_vus
838 (A : vector_unsigned_short;
839 B : c_int) return vector_unsigned_short;
842 (LL_Altivec, vec_splat_vus_cint_r_vus, "__builtin_altivec_vsplth");
844 function vec_splat_vbs_cint_r_vbs
845 (A : vector_bool_short;
846 B : c_int) return vector_bool_short;
849 (LL_Altivec, vec_splat_vbs_cint_r_vbs, "__builtin_altivec_vsplth");
851 function vec_splat_vx_cint_r_vx
853 B : c_int) return vector_pixel;
856 (LL_Altivec, vec_splat_vx_cint_r_vx, "__builtin_altivec_vsplth");
858 function vec_splat_vf_cint_r_vf
860 B : c_int) return vector_float;
863 (LL_Altivec, vec_splat_vf_cint_r_vf, "__builtin_altivec_vspltw");
865 function vec_splat_vsi_cint_r_vsi
866 (A : vector_signed_int;
867 B : c_int) return vector_signed_int;
870 (LL_Altivec, vec_splat_vsi_cint_r_vsi, "__builtin_altivec_vspltw");
872 function vec_splat_vui_cint_r_vui
873 (A : vector_unsigned_int;
874 B : c_int) return vector_unsigned_int;
877 (LL_Altivec, vec_splat_vui_cint_r_vui, "__builtin_altivec_vspltw");
879 function vec_splat_vbi_cint_r_vbi
880 (A : vector_bool_int;
881 B : c_int) return vector_bool_int;
884 (LL_Altivec, vec_splat_vbi_cint_r_vbi, "__builtin_altivec_vspltw");
888 function vec_vspltw_vf_cint_r_vf
890 B : c_int) return vector_float;
893 (LL_Altivec, vec_vspltw_vf_cint_r_vf, "__builtin_altivec_vspltw");
895 function vec_vspltw_vsi_cint_r_vsi
896 (A : vector_signed_int;
897 B : c_int) return vector_signed_int;
900 (LL_Altivec, vec_vspltw_vsi_cint_r_vsi, "__builtin_altivec_vspltw");
902 function vec_vspltw_vui_cint_r_vui
903 (A : vector_unsigned_int;
904 B : c_int) return vector_unsigned_int;
907 (LL_Altivec, vec_vspltw_vui_cint_r_vui, "__builtin_altivec_vspltw");
909 function vec_vspltw_vbi_cint_r_vbi
910 (A : vector_bool_int;
911 B : c_int) return vector_bool_int;
914 (LL_Altivec, vec_vspltw_vbi_cint_r_vbi, "__builtin_altivec_vspltw");
918 function vec_vsplth_vbs_cint_r_vbs
919 (A : vector_bool_short;
920 B : c_int) return vector_bool_short;
923 (LL_Altivec, vec_vsplth_vbs_cint_r_vbs, "__builtin_altivec_vsplth");
925 function vec_vsplth_vss_cint_r_vss
926 (A : vector_signed_short;
927 B : c_int) return vector_signed_short;
930 (LL_Altivec, vec_vsplth_vss_cint_r_vss, "__builtin_altivec_vsplth");
932 function vec_vsplth_vus_cint_r_vus
933 (A : vector_unsigned_short;
934 B : c_int) return vector_unsigned_short;
937 (LL_Altivec, vec_vsplth_vus_cint_r_vus, "__builtin_altivec_vsplth");
939 function vec_vsplth_vx_cint_r_vx
941 B : c_int) return vector_pixel;
944 (LL_Altivec, vec_vsplth_vx_cint_r_vx, "__builtin_altivec_vsplth");
948 function vec_vspltb_vsc_cint_r_vsc
949 (A : vector_signed_char;
950 B : c_int) return vector_signed_char;
953 (LL_Altivec, vec_vspltb_vsc_cint_r_vsc, "__builtin_altivec_vspltb");
955 function vec_vspltb_vuc_cint_r_vuc
956 (A : vector_unsigned_char;
957 B : c_int) return vector_unsigned_char;
960 (LL_Altivec, vec_vspltb_vuc_cint_r_vuc, "__builtin_altivec_vspltb");
962 function vec_vspltb_vbc_cint_r_vbc
963 (A : vector_bool_char;
964 B : c_int) return vector_bool_char;
967 (LL_Altivec, vec_vspltb_vbc_cint_r_vbc, "__builtin_altivec_vspltb");
971 function vec_splat_s8_cint_r_vsc
972 (A : c_int) return vector_signed_char;
975 (LL_Altivec, vec_splat_s8_cint_r_vsc, "__builtin_altivec_vspltisb");
979 function vec_splat_s16_cint_r_vss
980 (A : c_int) return vector_signed_short;
983 (LL_Altivec, vec_splat_s16_cint_r_vss, "__builtin_altivec_vspltish");
987 function vec_splat_s32_cint_r_vsi
988 (A : c_int) return vector_signed_int;
991 (LL_Altivec, vec_splat_s32_cint_r_vsi, "__builtin_altivec_vspltisw");
995 function vec_splat_u8_cint_r_vuc
996 (A : c_int) return vector_unsigned_char;
999 (LL_Altivec, vec_splat_u8_cint_r_vuc, "__builtin_altivec_vspltisb");
1003 function vec_splat_u16_cint_r_vus
1004 (A : c_int) return vector_unsigned_short;
1007 (LL_Altivec, vec_splat_u16_cint_r_vus, "__builtin_altivec_vspltish");
1011 function vec_splat_u32_cint_r_vui
1012 (A : c_int) return vector_unsigned_int;
1015 (LL_Altivec, vec_splat_u32_cint_r_vui, "__builtin_altivec_vspltisw");
1017 ------------------------------------------------------------
1018 -- Imports for low-level signature consistent subprograms --
1019 ------------------------------------------------------------
1023 procedure vec_dssall;
1026 (LL_Altivec, vec_dssall, "__builtin_altivec_dssall");
1028 -----------------------------------------
1029 -- Conversions between low level types --
1030 -----------------------------------------
1032 use GNAT.Altivec.Low_Level_Vectors;
1034 -- Something like...
1036 -- TYPES="LL_VBC LL_VUC LL_VSC LL_VBS LL_VUS LL_VSS \
1037 -- LL_VBI LL_VUI LL_VSI LL_VF LL_VP"
1038 -- for TT in `echo $TYPES`; do
1039 -- for ST in `echo $TYPES`; do
1040 -- echo "function To_$TT is new Ada.Unchecked_Conversion ($ST, $TT);"
1045 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VBC, LL_VBC);
1046 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VUC, LL_VBC);
1047 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VSC, LL_VBC);
1048 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VBS, LL_VBC);
1049 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VUS, LL_VBC);
1050 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VSS, LL_VBC);
1051 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VBI, LL_VBC);
1052 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VUI, LL_VBC);
1053 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VSI, LL_VBC);
1054 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VF, LL_VBC);
1055 function To_LL_VBC is new Ada.Unchecked_Conversion (LL_VP, LL_VBC);
1057 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VBC, LL_VUC);
1058 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VUC, LL_VUC);
1059 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VSC, LL_VUC);
1060 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VBS, LL_VUC);
1061 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VUS, LL_VUC);
1062 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VSS, LL_VUC);
1063 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VBI, LL_VUC);
1064 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VUI, LL_VUC);
1065 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VSI, LL_VUC);
1066 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VF, LL_VUC);
1067 function To_LL_VUC is new Ada.Unchecked_Conversion (LL_VP, LL_VUC);
1069 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VBC, LL_VSC);
1070 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VUC, LL_VSC);
1071 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VSC, LL_VSC);
1072 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VBS, LL_VSC);
1073 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VUS, LL_VSC);
1074 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VSS, LL_VSC);
1075 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VBI, LL_VSC);
1076 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VUI, LL_VSC);
1077 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VSI, LL_VSC);
1078 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VF, LL_VSC);
1079 function To_LL_VSC is new Ada.Unchecked_Conversion (LL_VP, LL_VSC);
1081 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VBC, LL_VBS);
1082 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VUC, LL_VBS);
1083 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VSC, LL_VBS);
1084 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VBS, LL_VBS);
1085 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VUS, LL_VBS);
1086 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VSS, LL_VBS);
1087 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VBI, LL_VBS);
1088 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VUI, LL_VBS);
1089 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VSI, LL_VBS);
1090 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VF, LL_VBS);
1091 function To_LL_VBS is new Ada.Unchecked_Conversion (LL_VP, LL_VBS);
1093 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VBC, LL_VUS);
1094 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VUC, LL_VUS);
1095 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VSC, LL_VUS);
1096 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VBS, LL_VUS);
1097 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VUS, LL_VUS);
1098 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VSS, LL_VUS);
1099 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VBI, LL_VUS);
1100 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VUI, LL_VUS);
1101 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VSI, LL_VUS);
1102 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VF, LL_VUS);
1103 function To_LL_VUS is new Ada.Unchecked_Conversion (LL_VP, LL_VUS);
1105 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VBC, LL_VSS);
1106 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VUC, LL_VSS);
1107 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VSC, LL_VSS);
1108 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VBS, LL_VSS);
1109 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VUS, LL_VSS);
1110 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VSS, LL_VSS);
1111 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VBI, LL_VSS);
1112 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VUI, LL_VSS);
1113 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VSI, LL_VSS);
1114 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VF, LL_VSS);
1115 function To_LL_VSS is new Ada.Unchecked_Conversion (LL_VP, LL_VSS);
1117 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VBC, LL_VBI);
1118 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VUC, LL_VBI);
1119 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VSC, LL_VBI);
1120 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VBS, LL_VBI);
1121 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VUS, LL_VBI);
1122 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VSS, LL_VBI);
1123 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VBI, LL_VBI);
1124 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VUI, LL_VBI);
1125 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VSI, LL_VBI);
1126 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VF, LL_VBI);
1127 function To_LL_VBI is new Ada.Unchecked_Conversion (LL_VP, LL_VBI);
1129 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VBC, LL_VUI);
1130 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VUC, LL_VUI);
1131 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VSC, LL_VUI);
1132 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VBS, LL_VUI);
1133 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VUS, LL_VUI);
1134 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VSS, LL_VUI);
1135 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VBI, LL_VUI);
1136 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VUI, LL_VUI);
1137 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VSI, LL_VUI);
1138 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VF, LL_VUI);
1139 function To_LL_VUI is new Ada.Unchecked_Conversion (LL_VP, LL_VUI);
1141 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VBC, LL_VSI);
1142 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VUC, LL_VSI);
1143 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VSC, LL_VSI);
1144 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VBS, LL_VSI);
1145 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VUS, LL_VSI);
1146 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VSS, LL_VSI);
1147 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VBI, LL_VSI);
1148 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VUI, LL_VSI);
1149 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VSI, LL_VSI);
1150 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VF, LL_VSI);
1151 function To_LL_VSI is new Ada.Unchecked_Conversion (LL_VP, LL_VSI);
1153 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VBC, LL_VF);
1154 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VUC, LL_VF);
1155 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VSC, LL_VF);
1156 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VBS, LL_VF);
1157 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VUS, LL_VF);
1158 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VSS, LL_VF);
1159 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VBI, LL_VF);
1160 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VUI, LL_VF);
1161 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VSI, LL_VF);
1162 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VF, LL_VF);
1163 function To_LL_VF is new Ada.Unchecked_Conversion (LL_VP, LL_VF);
1165 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VBC, LL_VP);
1166 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VUC, LL_VP);
1167 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VSC, LL_VP);
1168 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VBS, LL_VP);
1169 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VUS, LL_VP);
1170 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VSS, LL_VP);
1171 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VBI, LL_VP);
1172 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VUI, LL_VP);
1173 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VSI, LL_VP);
1174 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VF, LL_VP);
1175 function To_LL_VP is new Ada.Unchecked_Conversion (LL_VP, LL_VP);
1177 ----------------------------------------------
1178 -- Conversions between pointer/access types --
1179 ----------------------------------------------
1182 new Ada.Unchecked_Conversion (vector_unsigned_char_ptr, c_ptr);
1184 new Ada.Unchecked_Conversion (vector_signed_char_ptr, c_ptr);
1186 new Ada.Unchecked_Conversion (vector_bool_char_ptr, c_ptr);
1188 new Ada.Unchecked_Conversion (vector_unsigned_short_ptr, c_ptr);
1190 new Ada.Unchecked_Conversion (vector_signed_short_ptr, c_ptr);
1192 new Ada.Unchecked_Conversion (vector_bool_short_ptr, c_ptr);
1194 new Ada.Unchecked_Conversion (vector_unsigned_int_ptr, c_ptr);
1196 new Ada.Unchecked_Conversion (vector_signed_int_ptr, c_ptr);
1198 new Ada.Unchecked_Conversion (vector_bool_int_ptr, c_ptr);
1200 new Ada.Unchecked_Conversion (vector_float_ptr, c_ptr);
1202 new Ada.Unchecked_Conversion (vector_pixel_ptr, c_ptr);
1204 new Ada.Unchecked_Conversion (const_vector_bool_char_ptr, c_ptr);
1206 new Ada.Unchecked_Conversion (const_vector_signed_char_ptr, c_ptr);
1208 new Ada.Unchecked_Conversion (const_vector_unsigned_char_ptr, c_ptr);
1210 new Ada.Unchecked_Conversion (const_vector_bool_short_ptr, c_ptr);
1212 new Ada.Unchecked_Conversion (const_vector_signed_short_ptr, c_ptr);
1214 new Ada.Unchecked_Conversion (const_vector_unsigned_short_ptr, c_ptr);
1216 new Ada.Unchecked_Conversion (const_vector_bool_int_ptr, c_ptr);
1218 new Ada.Unchecked_Conversion (const_vector_signed_int_ptr, c_ptr);
1220 new Ada.Unchecked_Conversion (const_vector_unsigned_int_ptr, c_ptr);
1222 new Ada.Unchecked_Conversion (const_vector_float_ptr, c_ptr);
1224 new Ada.Unchecked_Conversion (const_vector_pixel_ptr, c_ptr);
1226 new Ada.Unchecked_Conversion (c_ptr, c_ptr);
1228 new Ada.Unchecked_Conversion (signed_char_ptr, c_ptr);
1230 new Ada.Unchecked_Conversion (unsigned_char_ptr, c_ptr);
1232 new Ada.Unchecked_Conversion (short_ptr, c_ptr);
1234 new Ada.Unchecked_Conversion (signed_short_ptr, c_ptr);
1236 new Ada.Unchecked_Conversion (unsigned_short_ptr, c_ptr);
1238 new Ada.Unchecked_Conversion (int_ptr, c_ptr);
1240 new Ada.Unchecked_Conversion (signed_int_ptr, c_ptr);
1242 new Ada.Unchecked_Conversion (unsigned_int_ptr, c_ptr);
1244 new Ada.Unchecked_Conversion (long_ptr, c_ptr);
1246 new Ada.Unchecked_Conversion (signed_long_ptr, c_ptr);
1248 new Ada.Unchecked_Conversion (unsigned_long_ptr, c_ptr);
1250 new Ada.Unchecked_Conversion (float_ptr, c_ptr);
1252 new Ada.Unchecked_Conversion (const_signed_char_ptr, c_ptr);
1254 new Ada.Unchecked_Conversion (const_unsigned_char_ptr, c_ptr);
1256 new Ada.Unchecked_Conversion (const_short_ptr, c_ptr);
1258 new Ada.Unchecked_Conversion (const_signed_short_ptr, c_ptr);
1260 new Ada.Unchecked_Conversion (const_unsigned_short_ptr, c_ptr);
1262 new Ada.Unchecked_Conversion (const_int_ptr, c_ptr);
1264 new Ada.Unchecked_Conversion (const_signed_int_ptr, c_ptr);
1266 new Ada.Unchecked_Conversion (const_unsigned_int_ptr, c_ptr);
1268 new Ada.Unchecked_Conversion (const_long_ptr, c_ptr);
1270 new Ada.Unchecked_Conversion (const_signed_long_ptr, c_ptr);
1272 new Ada.Unchecked_Conversion (const_unsigned_long_ptr, c_ptr);
1274 new Ada.Unchecked_Conversion (const_float_ptr, c_ptr);
1276 new Ada.Unchecked_Conversion (constv_char_ptr, c_ptr);
1278 new Ada.Unchecked_Conversion (constv_signed_char_ptr, c_ptr);
1280 new Ada.Unchecked_Conversion (constv_unsigned_char_ptr, c_ptr);
1282 new Ada.Unchecked_Conversion (constv_short_ptr, c_ptr);
1284 new Ada.Unchecked_Conversion (constv_signed_short_ptr, c_ptr);
1286 new Ada.Unchecked_Conversion (constv_unsigned_short_ptr, c_ptr);
1288 new Ada.Unchecked_Conversion (constv_int_ptr, c_ptr);
1290 new Ada.Unchecked_Conversion (constv_signed_int_ptr, c_ptr);
1292 new Ada.Unchecked_Conversion (constv_unsigned_int_ptr, c_ptr);
1294 new Ada.Unchecked_Conversion (constv_long_ptr, c_ptr);
1296 new Ada.Unchecked_Conversion (constv_signed_long_ptr, c_ptr);
1298 new Ada.Unchecked_Conversion (constv_unsigned_long_ptr, c_ptr);
1300 new Ada.Unchecked_Conversion (constv_float_ptr, c_ptr);
1302 end GNAT.Altivec.Low_Level_Interface;