annotate gcc/ada/libgnat/g-ssvety.ads @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 ------------------------------------------------------------------------------
kono
parents:
diff changeset
2 -- --
kono
parents:
diff changeset
3 -- GNAT COMPILER COMPONENTS --
kono
parents:
diff changeset
4 -- --
kono
parents:
diff changeset
5 -- G N A T . S S E . V E C T O R _ T Y P E S --
kono
parents:
diff changeset
6 -- --
kono
parents:
diff changeset
7 -- S p e c --
kono
parents:
diff changeset
8 -- --
145
1830386684a0 gcc-9.2.0
anatofuz
parents: 131
diff changeset
9 -- Copyright (C) 2009-2019, Free Software Foundation, Inc. --
111
kono
parents:
diff changeset
10 -- --
kono
parents:
diff changeset
11 -- GNAT is free software; you can redistribute it and/or modify it under --
kono
parents:
diff changeset
12 -- terms of the GNU General Public License as published by the Free Soft- --
kono
parents:
diff changeset
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
kono
parents:
diff changeset
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
kono
parents:
diff changeset
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
kono
parents:
diff changeset
16 -- or FITNESS FOR A PARTICULAR PURPOSE. --
kono
parents:
diff changeset
17 -- --
kono
parents:
diff changeset
18 -- As a special exception under Section 7 of GPL version 3, you are granted --
kono
parents:
diff changeset
19 -- additional permissions described in the GCC Runtime Library Exception, --
kono
parents:
diff changeset
20 -- version 3.1, as published by the Free Software Foundation. --
kono
parents:
diff changeset
21 -- --
kono
parents:
diff changeset
22 -- You should have received a copy of the GNU General Public License and --
kono
parents:
diff changeset
23 -- a copy of the GCC Runtime Library Exception along with this program; --
kono
parents:
diff changeset
24 -- see the files COPYING3 and COPYING.RUNTIME respectively. If not, see --
kono
parents:
diff changeset
25 -- <http://www.gnu.org/licenses/>. --
kono
parents:
diff changeset
26 -- --
kono
parents:
diff changeset
27 -- GNAT was originally developed by the GNAT team at New York University. --
kono
parents:
diff changeset
28 -- Extensive contributions were provided by Ada Core Technologies Inc. --
kono
parents:
diff changeset
29 -- --
kono
parents:
diff changeset
30 ------------------------------------------------------------------------------
kono
parents:
diff changeset
31
kono
parents:
diff changeset
32 -- This unit exposes the Ada __m128 like data types to represent the contents
kono
parents:
diff changeset
33 -- of SSE registers, for use by bindings to the SSE intrinsic operations.
kono
parents:
diff changeset
34
kono
parents:
diff changeset
35 -- See GNAT.SSE for the list of targets where this facility is supported
kono
parents:
diff changeset
36
kono
parents:
diff changeset
37 package GNAT.SSE.Vector_Types is
kono
parents:
diff changeset
38
kono
parents:
diff changeset
39 -- The reference guide states a few usage guidelines for the C types:
kono
parents:
diff changeset
40
kono
parents:
diff changeset
41 -- Since these new data types are not basic ANSI C data types, you
kono
parents:
diff changeset
42 -- must observe the following usage restrictions:
kono
parents:
diff changeset
43 --
kono
parents:
diff changeset
44 -- * Use new data types only on either side of an assignment, as a
kono
parents:
diff changeset
45 -- return value, or as a parameter. You cannot use it with other
kono
parents:
diff changeset
46 -- arithmetic expressions ("+", "-", and so on).
kono
parents:
diff changeset
47 --
kono
parents:
diff changeset
48 -- * Use new data types as objects in aggregates, such as unions to
kono
parents:
diff changeset
49 -- access the byte elements and structures.
kono
parents:
diff changeset
50 --
kono
parents:
diff changeset
51 -- * Use new data types only with the respective intrinsics described
kono
parents:
diff changeset
52 -- in this documentation.
kono
parents:
diff changeset
53
kono
parents:
diff changeset
54 type m128 is private; -- SSE >= 1
kono
parents:
diff changeset
55 type m128d is private; -- SSE >= 2
kono
parents:
diff changeset
56 type m128i is private; -- SSE >= 2
kono
parents:
diff changeset
57
kono
parents:
diff changeset
58 private
kono
parents:
diff changeset
59 -- Each of the m128 types maps to a specific vector_type with an extra
kono
parents:
diff changeset
60 -- "may_alias" attribute as in GCC's definitions for C, for instance in
kono
parents:
diff changeset
61 -- xmmintrin.h:
kono
parents:
diff changeset
62
kono
parents:
diff changeset
63 -- /* The Intel API is flexible enough that we must allow aliasing
kono
parents:
diff changeset
64 -- with other vector types, and their scalar components. */
kono
parents:
diff changeset
65 -- typedef float __m128
kono
parents:
diff changeset
66 -- __attribute__ ((__vector_size__ (16), __may_alias__));
kono
parents:
diff changeset
67
kono
parents:
diff changeset
68 -- /* Internal data types for implementing the intrinsics. */
kono
parents:
diff changeset
69 -- typedef float __v4sf __attribute__ ((__vector_size__ (16)));
kono
parents:
diff changeset
70
kono
parents:
diff changeset
71 ------------
kono
parents:
diff changeset
72 -- m128 --
kono
parents:
diff changeset
73 ------------
kono
parents:
diff changeset
74
kono
parents:
diff changeset
75 -- The __m128 data type can hold four 32-bit floating-point values
kono
parents:
diff changeset
76
kono
parents:
diff changeset
77 type m128 is array (1 .. 4) of Float32;
kono
parents:
diff changeset
78 for m128'Alignment use VECTOR_ALIGN;
kono
parents:
diff changeset
79 pragma Machine_Attribute (m128, "vector_type");
kono
parents:
diff changeset
80 pragma Machine_Attribute (m128, "may_alias");
kono
parents:
diff changeset
81
kono
parents:
diff changeset
82 -------------
kono
parents:
diff changeset
83 -- m128d --
kono
parents:
diff changeset
84 -------------
kono
parents:
diff changeset
85
kono
parents:
diff changeset
86 -- The __m128d data type can hold two 64-bit floating-point values
kono
parents:
diff changeset
87
kono
parents:
diff changeset
88 type m128d is array (1 .. 2) of Float64;
kono
parents:
diff changeset
89 for m128d'Alignment use VECTOR_ALIGN;
kono
parents:
diff changeset
90 pragma Machine_Attribute (m128d, "vector_type");
kono
parents:
diff changeset
91 pragma Machine_Attribute (m128d, "may_alias");
kono
parents:
diff changeset
92
kono
parents:
diff changeset
93 -------------
kono
parents:
diff changeset
94 -- m128i --
kono
parents:
diff changeset
95 -------------
kono
parents:
diff changeset
96
kono
parents:
diff changeset
97 -- The __m128i data type can hold sixteen 8-bit, eight 16-bit, four 32-bit,
kono
parents:
diff changeset
98 -- or two 64-bit integer values.
kono
parents:
diff changeset
99
kono
parents:
diff changeset
100 type m128i is array (1 .. 2) of Integer64;
kono
parents:
diff changeset
101 for m128i'Alignment use VECTOR_ALIGN;
kono
parents:
diff changeset
102 pragma Machine_Attribute (m128i, "vector_type");
kono
parents:
diff changeset
103 pragma Machine_Attribute (m128i, "may_alias");
kono
parents:
diff changeset
104
kono
parents:
diff changeset
105 end GNAT.SSE.Vector_Types;