Commit 0c4683cf by Arnaud Charlet

[multiple changes]

2011-08-04  Arnaud Charlet  <charlet@adacore.com>

	* makeutl.adb: Minor reformatting.

2011-08-04  Olivier Hainque  <hainque@adacore.com>

	* g-altive.ads: Update comments to reflect that only the soft
	binding is available today.

From-SVN: r177359
parent f142b5bc
2011-08-04 Arnaud Charlet <charlet@adacore.com>
* makeutl.adb: Minor reformatting.
2011-08-04 Olivier Hainque <hainque@adacore.com>
* g-altive.ads: Update comments to reflect that only the soft
binding is available today.
2011-08-04 Robert Dewar <dewar@adacore.com> 2011-08-04 Robert Dewar <dewar@adacore.com>
* bindgen.adb, einfo.adb, sem_ch12.adb, s-tasren.adb, sem_res.adb, * bindgen.adb, einfo.adb, sem_ch12.adb, s-tasren.adb, sem_res.adb,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2004-2009, Free Software Foundation, Inc. -- -- Copyright (C) 2004-2011, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- 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- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -34,13 +34,8 @@ ...@@ -34,13 +34,8 @@
------------------------- -------------------------
-- This is the root of a package hierarchy offering an Ada binding to the -- This is the root of a package hierarchy offering an Ada binding to the
-- PowerPC AltiVec extensions. These extensions basically consist in a set of -- PowerPC AltiVec extensions, a set of 128bit vector types together with a
-- 128bit vector types together with a set of subprograms operating on such -- set of subprograms operating on them. Relevant documents are:
-- vectors. On a real Altivec capable target, vector objects map to hardware
-- vector registers and the subprograms map to a set of specific hardware
-- instructions.
-- Relevant documents are:
-- o AltiVec Technology, Programming Interface Manual (1999-06) -- o AltiVec Technology, Programming Interface Manual (1999-06)
-- to which we will refer as [PIM], describes the data types, the -- to which we will refer as [PIM], describes the data types, the
...@@ -53,11 +48,11 @@ ...@@ -53,11 +48,11 @@
-- These documents, as well as a number of others of general interest on the -- These documents, as well as a number of others of general interest on the
-- AltiVec technology, are available from the Motorola/AltiVec Web site at -- AltiVec technology, are available from the Motorola/AltiVec Web site at
-- http://www.motorola.com/altivec -- http://www.freescale.com/altivec
-- We offer two versions of this binding: one for real AltiVec capable -- The binding interface is structured to allow alternate implementations:
-- targets, and one for other targets. In the latter case, everything is -- for real AltiVec capable targets, and for other targets. In the latter
-- emulated in software. We will refer to the two bindings as: -- case, everything is emulated in software. We refer to the two versions as:
-- o The Hard binding for AltiVec capable targets (with the appropriate -- o The Hard binding for AltiVec capable targets (with the appropriate
-- hardware support and corresponding instruction set) -- hardware support and corresponding instruction set)
...@@ -65,17 +60,13 @@ ...@@ -65,17 +60,13 @@
-- o The Soft binding for other targets (with the low level primitives -- o The Soft binding for other targets (with the low level primitives
-- emulated in software). -- emulated in software).
-- The two versions of the binding are expected to be equivalent from the
-- functional standpoint. The same client application code should observe no
-- difference in operation results, even if the Soft version is used on a
-- non-powerpc target. The Hard binding is naturally expected to run faster
-- than the Soft version on the same target.
-- We also offer interfaces not strictly part of the base AltiVec API, such -- We also offer interfaces not strictly part of the base AltiVec API, such
-- as vector conversions to/from array representations, which are of interest -- as vector conversions to/from array representations, which are of interest
-- for client applications (e.g. for vector initialization purposes) and may -- for client applications (e.g. for vector initialization purposes) and may
-- also be used as implementation facilities. -- also be used as implementation facilities.
-- Only the soft binding is available today.
----------------------------------------- -----------------------------------------
-- General package architecture survey -- -- General package architecture survey --
----------------------------------------- -----------------------------------------
...@@ -84,8 +75,8 @@ ...@@ -84,8 +75,8 @@
-- values, the possible types of which are declared in this root package to -- values, the possible types of which are declared in this root package to
-- be generally accessible. -- be generally accessible.
-- From the user standpoint, the two versions of the binding are available -- From the user standpoint, the binding materializes as a consistent
-- through a consistent hierarchy of units providing identical services: -- hierarchy of units:
-- GNAT.Altivec -- GNAT.Altivec
-- (component types) -- (component types)
...@@ -99,7 +90,7 @@ ...@@ -99,7 +90,7 @@
-- Vector types are defined in the GNAT.Altivec.Vector_Types package -- Vector types are defined in the GNAT.Altivec.Vector_Types package
-- On these types, the user can apply the Altivec operations defined in -- On these types, users can apply the Altivec operations defined in
-- GNAT.Altivec.Vector_Operations. Their layout is opaque and may vary across -- GNAT.Altivec.Vector_Operations. Their layout is opaque and may vary across
-- configurations, for it is typically target-endianness dependant. -- configurations, for it is typically target-endianness dependant.
...@@ -116,43 +107,20 @@ ...@@ -116,43 +107,20 @@
-- The GNAT.Altivec.Conversions package is provided to convert a View to the -- The GNAT.Altivec.Conversions package is provided to convert a View to the
-- corresponding Vector and vice-versa. -- corresponding Vector and vice-versa.
-- The two versions of the binding rely on a low level internal interface,
-- and switching from one version to the other amounts to select one low
-- level implementation instead of the other.
-- The bindings are provided as a set of sources together with a project file
-- (altivec.gpr). The hard/soft binding selection is controlled by a project
-- variable on targets where switching makes sense. See the example usage
-- section below.
--------------------------- ---------------------------
-- Underlying principles -- -- Underlying principles --
--------------------------- ---------------------------
-- The general organization sketched above has been devised from a number -- Internally, the binding relies on an abstraction of the Altivec API, a
-- of driving ideas: -- rich set of functions around a core of low level primitives mapping to
-- AltiVec instructions. See for instance "vec_add" in [PIM-4.4 Generic and
-- o From the clients standpoint, the two versions of the binding should be -- Specific AltiVec operations], with no less than six result/arguments
-- as easily exchangeable as possible, -- combinations of byte vector types that map to "vaddubm".
-- o From the maintenance standpoint, we want to avoid as much code
-- duplication as possible.
-- o From both standpoints above, we want to maintain a clear interface
-- separation between the base bindings to the Motorola API and the
-- additional facilities.
-- The identification of the low level interface is directly inspired by the -- The "soft" version is a software emulation of the low level primitives.
-- base API organization, basically consisting of a rich set of functions
-- around a core of low level primitives mapping to AltiVec instructions.
-- See for instance "vec_add" in [PIM-4.4 Generic and Specific AltiVec -- The "hard" version would map to real AltiVec instructions via GCC builtins
-- operations]: no less than six result/arguments combinations of byte vector -- and inlining.
-- types map to "vaddubm".
-- The "hard" version of the low level primitives map to real AltiVec
-- instructions via the corresponding GCC builtins. The "soft" version is
-- a software emulation of those.
------------------- -------------------
-- Example usage -- -- Example usage --
...@@ -168,6 +136,8 @@ ...@@ -168,6 +136,8 @@
-- use GNAT.Altivec; -- use GNAT.Altivec;
-- with Ada.Text_IO; use Ada.Text_IO;
-- procedure Sample is -- procedure Sample is
-- Va : Vector_Unsigned_Int := To_Vector ((Values => (1, 2, 3, 4))); -- Va : Vector_Unsigned_Int := To_Vector ((Values => (1, 2, 3, 4)));
-- Vb : Vector_Unsigned_Int := To_Vector ((Values => (1, 2, 3, 4))); -- Vb : Vector_Unsigned_Int := To_Vector ((Values => (1, 2, 3, 4)));
...@@ -183,28 +153,7 @@ ...@@ -183,28 +153,7 @@
-- end loop; -- end loop;
-- end; -- end;
-- This currently requires the GNAT project management facilities to compile, -- $ gnatmake sample.adb
-- to automatically retrieve the set of necessary sources and switches
-- depending on your configuration. For the example above, customizing the
-- switches to include -g also, this would be something like:
-- sample.gpr
--
-- with "altivec.gpr";
--
-- project Sample is
-- for Source_Dirs use (".");
-- for Main use ("sample");
-- package Compiler is
-- for Default_Switches ("Ada") use
-- Altivec.Compiler'Default_Switches ("Ada") & "-g";
-- end Compiler;
-- end Sample;
-- $ gnatmake -Psample
-- [...] -- [...]
-- $ ./sample -- $ ./sample
-- 2 -- 2
......
...@@ -1581,7 +1581,7 @@ package body Makeutl is ...@@ -1581,7 +1581,7 @@ package body Makeutl is
if Number_Of_Mains (Tree) = 0 if Number_Of_Mains (Tree) = 0
and then Mains.Count_Of_Mains_With_No_Tree = 0 and then Mains.Count_Of_Mains_With_No_Tree = 0
then then
Debug_Output ("add_Mains_From_Project", Project.Name); Debug_Output ("Add_Mains_From_Project", Project.Name);
List := Project.Mains; List := Project.Mains;
if List /= Prj.Nil_String then if List /= Prj.Nil_String then
......
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