1-- Taken from altivec of GNAT examples (http://www.adacore.com/developers/code-samples/gnat-examples/) 2-- ==================================================================================================== 3-- This example shows how to create and manipulate vectors by the mean of high 4-- level views. 5 6with GNAT.Altivec; use GNAT.Altivec; 7with GNAT.Altivec.Conversions; use GNAT.Altivec.Conversions; 8with GNAT.Altivec.Vector_Operations; use GNAT.Altivec.Vector_Operations; 9with GNAT.Altivec.Vector_Types; use GNAT.Altivec.Vector_Types; 10with GNAT.Altivec.Vector_Views; use GNAT.Altivec.Vector_Views; 11 12with GNAT.IO; use GNAT.IO; 13 14procedure Altivec is 15 16 View_A : constant VUI_View := (Values => (1, 2, 3, 4)); 17 Vector_A : constant vector_unsigned_int := To_Vector (View_A); 18 19 View_B : constant VUI_View := (Values => (1, 1, 1, 1)); 20 Vector_B : constant vector_unsigned_int := To_Vector (View_B); 21 22 Vector_C : vector_unsigned_int; 23 View_C : VUI_View; 24 25begin 26 Vector_C := vec_add (Vector_A, Vector_B); 27 -- C = A + B 28 29 View_C := To_View (Vector_C); 30 31 for I in View_C.Values'Range loop 32 Put_Line (unsigned_int'Image (View_C.Values (I))); 33 end loop; 34 35end Altivec; 36