Inital port from SJM R4 document
parent
cb01eeda67
commit
dfa363ccaa
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
@ -0,0 +1,176 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
@ -0,0 +1,93 @@
|
||||
# Porting Guide for Linux on Power
|
||||
TBD...
|
||||
|
||||
To build this project, one must ensure that the Docs-Master project has
|
||||
also been cloned at the same directory level as the Docs-Template project.
|
||||
This can be accomplished with the following steps:
|
||||
|
||||
1. Clone the master documentation project (Docs-Master) using the following command:
|
||||
|
||||
```
|
||||
$ git clone https://github.com/OpenPOWERFoundation/Docs-Master.git
|
||||
```
|
||||
|
||||
2. Clone this project (Docs-Template) using the following command:
|
||||
|
||||
```
|
||||
$ git clone https://ibm.github.com/scheel/SJM-Porting-Guide.git
|
||||
```
|
||||
|
||||
3. Build the project with these commands:
|
||||
```
|
||||
$ cd SJM-Porting-Guide
|
||||
$ mvn clean generate-sources
|
||||
```
|
||||
|
||||
The online version of the document can be found in the OpenPOWER Foundation
|
||||
Document library at [TBD](http://openpowerfoundation.org/?resource_lib=TBD).
|
||||
|
||||
The project which controls the look and feel of the document is the
|
||||
[Docs-Maven-Plugin project](https://github.com/OpenPOWERFoundation/Docs-Maven-Plugin), an
|
||||
OpenPOWER Foundation private project on GitHub. To obtain access to the Maven Plugin project,
|
||||
contact Jeff Scheel \([scheel@us.ibm.com](mailto://scheel@us.ibm.com)\) or
|
||||
Jeff Brown \([jeffdb@us.ibm.com](mailto://jeffdb@us.ibm.com)\).
|
||||
|
||||
## License
|
||||
This project is licensed under the Apache V2 license. More information
|
||||
can be found in the LICENSE file or online at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
## Community
|
||||
TBD...
|
||||
|
||||
## Contributions
|
||||
TBD...
|
||||
|
||||
Contributions to this project should conform to the `Developer Certificate
|
||||
of Origin` as defined at http://elinux.org/Developer_Certificate_Of_Origin.
|
||||
Commits to this project need to contain the following line to indicate
|
||||
the submitter accepts the DCO:
|
||||
```
|
||||
Signed-off-by: Your Name <your_email@domain.com>
|
||||
```
|
||||
By contributing in this way, you agree to the terms as follows:
|
||||
```
|
||||
Developer Certificate of Origin
|
||||
Version 1.1
|
||||
|
||||
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
|
||||
660 York Street, Suite 102,
|
||||
San Francisco, CA 94110 USA
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
|
||||
Developer's Certificate of Origin 1.1
|
||||
|
||||
By making a contribution to this project, I certify that:
|
||||
|
||||
(a) The contribution was created in whole or in part by me and I
|
||||
have the right to submit it under the open source license
|
||||
indicated in the file; or
|
||||
|
||||
(b) The contribution is based upon previous work that, to the best
|
||||
of my knowledge, is covered under an appropriate open source
|
||||
license and I have the right under that license to submit that
|
||||
work with modifications, whether created in whole or in part
|
||||
by me, under the same open source license (unless I am
|
||||
permitted to submit under a different license), as indicated
|
||||
in the file; or
|
||||
|
||||
(c) The contribution was provided directly to me by some other
|
||||
person who certified (a), (b) or (c) and I have not modified
|
||||
it.
|
||||
|
||||
(d) I understand and agree that this project and the contribution
|
||||
are public and that a record of the contribution (including all
|
||||
personal information I submit with it, including my sign-off) is
|
||||
maintained indefinitely and may be redistributed consistent with
|
||||
this project or the open source license(s) involved.
|
||||
```
|
||||
|
@ -0,0 +1,318 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017 OpenPOWER Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<appendix xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5.0"
|
||||
xml:id="app_intel_suffixes">
|
||||
<?dbhtml stop-chunking?>
|
||||
<title>Intel Intrinsic suffixes</title>
|
||||
|
||||
<section>
|
||||
<title>MMX</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pi16</literal></emphasis></term>
|
||||
<listitem><para>4 x packed short int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pi32</literal></emphasis></term>
|
||||
<listitem><para>2 x packed int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pi8</literal></emphasis></term>
|
||||
<listitem><para>8 x packed signed char</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pu16</literal></emphasis></term>
|
||||
<listitem><para>4 x packed unsigned short int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pu8</literal></emphasis></term>
|
||||
<listitem><para>8 x packed unsigned char</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_si64</literal></emphasis></term>
|
||||
<listitem><para>single 64-bit binary (logical)</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>SSE</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_ps</literal></emphasis></term>
|
||||
<listitem><para>4 x packed float</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_ss</literal></emphasis></term>
|
||||
<listitem><para>single scalar float</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_si32</literal></emphasis></term>
|
||||
<listitem><para>single 32-bit int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_si64</literal></emphasis></term>
|
||||
<listitem><para>single 64-bit long int</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>SSE2</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi16</literal></emphasis></term>
|
||||
<listitem><para>8 x packed short int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi32</literal></emphasis></term>
|
||||
<listitem><para>4 x packed int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi64</literal></emphasis></term>
|
||||
<listitem><para>2 x packed long int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi8</literal></emphasis></term>
|
||||
<listitem><para>16 x packed signed char</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu16</literal></emphasis></term>
|
||||
<listitem><para>8 x packed unsigned short int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu32</literal></emphasis></term>
|
||||
<listitem><para>4 x packed unsigned int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu8</literal></emphasis></term>
|
||||
<listitem><para>16 x packed unsigned char</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
<!-- Is this break really desired? -->
|
||||
<para/>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pd</literal></emphasis></term>
|
||||
<listitem><para>2 x packed double</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_sd</literal></emphasis></term>
|
||||
<listitem><para>single scalar double</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pi64</literal></emphasis></term>
|
||||
<listitem><para>single long int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_si128</literal></emphasis></term>
|
||||
<listitem><para>single 128-bit binary (logical)</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>AVX/AVX2 __m256_*</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_ps</literal></emphasis></term>
|
||||
<listitem><para>8 x packed float</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pd</literal></emphasis></term>
|
||||
<listitem><para>4 x packed double</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi16</literal></emphasis></term>
|
||||
<listitem><para>16 x packed short int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi32</literal></emphasis></term>
|
||||
<listitem><para>8 x packed int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi64</literal></emphasis></term>
|
||||
<listitem><para>4 x packed long int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi8</literal></emphasis></term>
|
||||
<listitem><para>32 x packed signed char</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu16</literal></emphasis></term>
|
||||
<listitem><para>16 x packed unsigned short int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu32</literal></emphasis></term>
|
||||
<listitem><para>8 x packed unsigned int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu8</literal></emphasis></term>
|
||||
<listitem><para>32 x packed unsigned char</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_ss</literal></emphasis></term>
|
||||
<listitem><para>single scalar float (broadcast/splat)</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_sd</literal></emphasis></term>
|
||||
<listitem><para>single scalar double</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_si256</literal></emphasis></term>
|
||||
<listitem><para>single 256-bit binary (logical)</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pd256</literal></emphasis></term>
|
||||
<listitem><para>cast / zero extend</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_ps256</literal></emphasis></term>
|
||||
<listitem><para>cast / zero extend</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pd128</literal></emphasis></term>
|
||||
<listitem><para>cast</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_ps128</literal></emphasis></term>
|
||||
<listitem><para>cast</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
<section>
|
||||
<title>AVX512 __m512_*</title>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_ps</literal></emphasis></term>
|
||||
<listitem><para>16 x packed float</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pd</literal></emphasis></term>
|
||||
<listitem><para>8 x packed double</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi16</literal></emphasis></term>
|
||||
<listitem><para>32 x packed short int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi32</literal></emphasis></term>
|
||||
<listitem><para>16 x packed int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi64</literal></emphasis></term>
|
||||
<listitem><para>8 x packed long int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epi8</literal></emphasis></term>
|
||||
<listitem><para>64 x packed signed char</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu16</literal></emphasis></term>
|
||||
<listitem><para>32 x packed unsigned short int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu32</literal></emphasis></term>
|
||||
<listitem><para>16 x packed unsigned int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu64</literal></emphasis></term>
|
||||
<listitem><para>8 x packed unsigned long int</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_epu8</literal></emphasis></term>
|
||||
<listitem><para>64 x packed unsigned char</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_ss</literal></emphasis></term>
|
||||
<listitem><para>single scalar float</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_sd</literal></emphasis></term>
|
||||
<listitem><para>single scalar double</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_si512</literal></emphasis></term>
|
||||
<listitem><para>single 512-bit binary (logical)</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_pd512</literal></emphasis></term>
|
||||
<listitem><para>cast / zero extend</para></listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><emphasis role="bold"><literal>_ps512</literal></emphasis></term>
|
||||
<listitem><para>cast / zero extend</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</section>
|
||||
|
||||
</appendix>
|
||||
|
@ -0,0 +1,103 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017 OpenPOWER Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<book xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5.0"
|
||||
xml:id="bk_main">
|
||||
|
||||
<title>Linux on Power Porting Guide</title>
|
||||
<subtitle>Vector Intrinsic</subtitle>
|
||||
|
||||
<info>
|
||||
<author>
|
||||
<personname>
|
||||
<surname>System Software Work Group</surname>
|
||||
</personname>
|
||||
<email>syssw-chair@openpowerfoundation.org</email>
|
||||
<affiliation>
|
||||
<orgname>OpenPOWER Foundation</orgname>
|
||||
</affiliation>
|
||||
</author>
|
||||
<copyright>
|
||||
<year>2017</year>
|
||||
<holder>OpenPOWER Foundation</holder>
|
||||
</copyright>
|
||||
<!-- TODO: Set the correct document releaseinfo -->
|
||||
<releaseinfo>Revision 0.1</releaseinfo>
|
||||
<productname>OpenPOWER</productname>
|
||||
<pubdate/>
|
||||
|
||||
<legalnotice role="apache2">
|
||||
|
||||
<annotation>
|
||||
<remark>Copyright details are filled in by the template.</remark>
|
||||
</annotation>
|
||||
</legalnotice>
|
||||
|
||||
<!-- TODO: Update the following text with the correct document description (first paragraph),
|
||||
Work Group name, and Work Product track (both in second paragraph). -->
|
||||
<abstract>
|
||||
<para>The goal of this project is to provide functional equivalents of the
|
||||
Intel MMX, SSE, and AVX intrinsic functions, that are commonly used in Linux
|
||||
applications, and make them (or equivalents) available for the PowerPC64LE
|
||||
platform.</para>
|
||||
|
||||
<para>This document is a Standard Track, Work Group Note work product owned by the
|
||||
System Software Workgroup and handled in compliance with the requirements outlined in the
|
||||
<citetitle>OpenPOWER Foundation Work Group (WG) Process</citetitle> document. It was
|
||||
created using the <citetitle>Master Template Guide</citetitle> version 0.9.5. Comments,
|
||||
questions, etc. can be submitted to the public mailing list for this document at
|
||||
<link xlink:href="http://tbd.openpowerfoundation.org">TBD</link>.</para>
|
||||
</abstract>
|
||||
|
||||
<revhistory>
|
||||
<!-- TODO: Update as new revisions created -->
|
||||
<revision>
|
||||
<date>2017-07-26</date>
|
||||
<revdescription>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>Revision 0.1 - initial draft from Steve Munroe</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</revdescription>
|
||||
</revision>
|
||||
</revhistory>
|
||||
</info>
|
||||
|
||||
<!-- The ch_preface.xml file is required by all documents -->
|
||||
<xi:include href="../../Docs-Master/common/ch_preface.xml"/>
|
||||
|
||||
<!-- Chapter heading files -->
|
||||
<xi:include href="ch_intel_intrinsic_porting.xml"/>
|
||||
<xi:include href="ch_howto_start.xml"/>
|
||||
|
||||
<!-- Placeholder files ATM -->
|
||||
<!--chapter><title>Placeholders</title>
|
||||
</chapter-->
|
||||
|
||||
|
||||
<!-- Document specific appendices -->
|
||||
<xi:include href="app_references.xml"/>
|
||||
<xi:include href="app_intel_suffixes.xml"/>
|
||||
|
||||
<!-- The app_foundation.xml appendix file is required by all documents. -->
|
||||
<xi:include href="../../Docs-Master/common/app_foundation.xml"/>
|
||||
|
||||
</book>
|
@ -0,0 +1,148 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
<parent>
|
||||
|
||||
<groupId>org.openpowerfoundation.docs</groupId>
|
||||
<artifactId>workgroup-pom</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<!-- TODO: Rename the artifactID field to some appropriate for your new document -->
|
||||
<artifactId>Porting-Guide-Vector-Intrinsics</artifactId>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<!-- TODO: Rename the name field to some appropriate for your new document -->
|
||||
<name>Porting-Guide-Vector-Intrinsics</name>
|
||||
|
||||
<properties>
|
||||
<!-- This is set by Jenkins according to the branch. -->
|
||||
<release.path.name></release.path.name>
|
||||
<comments.enabled>0</comments.enabled>
|
||||
</properties>
|
||||
<!-- ################################################ -->
|
||||
<!-- USE "mvn clean generate-sources" to run this POM -->
|
||||
<!-- ################################################ -->
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
|
||||
<groupId>org.openpowerfoundation.docs</groupId>
|
||||
|
||||
<artifactId>openpowerdocs-maven-plugin</artifactId>
|
||||
<!-- version set in ../pom.xml -->
|
||||
<executions>
|
||||
<execution>
|
||||
<id>generate-webhelp</id>
|
||||
<goals>
|
||||
<goal>generate-webhelp</goal>
|
||||
</goals>
|
||||
<phase>generate-sources</phase>
|
||||
<configuration>
|
||||
<!-- These parameters only apply to webhelp -->
|
||||
<enableDisqus>${comments.enabled}</enableDisqus>
|
||||
<disqusShortname>LoPAR-Virtualization</disqusShortname>
|
||||
<enableGoogleAnalytics>1</enableGoogleAnalytics>
|
||||
<googleAnalyticsId>UA-17511903-1</googleAnalyticsId>
|
||||
<generateToc>
|
||||
appendix toc,title
|
||||
article/appendix nop
|
||||
article toc,title
|
||||
book toc,title,figure,table,example,equation
|
||||
book/appendix nop
|
||||
book/chapter nop
|
||||
chapter toc,title
|
||||
chapter/section nop
|
||||
section toc
|
||||
part toc,title
|
||||
qandadiv toc
|
||||
qandaset toc
|
||||
reference toc,title
|
||||
set toc,title
|
||||
</generateToc>
|
||||
<!-- The following elements sets the autonumbering of sections in output for chapter numbers but no numbered sections-->
|
||||
<sectionAutolabel>1</sectionAutolabel>
|
||||
<tocSectionDepth>3</tocSectionDepth>
|
||||
<sectionLabelIncludesComponentLabel>1</sectionLabelIncludesComponentLabel>
|
||||
|
||||
<!-- TODO: Rename the webhelpDirname field to the new directory for new document -->
|
||||
<webhelpDirname>Vector-Intrinsics</webhelpDirname>
|
||||
|
||||
<!-- TODO: Rename the pdfFilenameBase field to the PDF name for new document -->
|
||||
<pdfFilenameBase>Vector-Intrinsics</pdfFilenameBase>
|
||||
|
||||
<!-- TODO: Define the appropriate work product type. These values are defined by the IPR Policy.
|
||||
Consult with the Work Group Chair or a Technical Steering Committee member if you have
|
||||
questions about which value to select.
|
||||
|
||||
If no value is provided below, the document will default to "Work Group Notes".-->
|
||||
<workProduct>workgroupNotes</workProduct>
|
||||
<!--workProduct>workgroupSpecification</workProduct-->
|
||||
<!-- workProduct>candidateStandard</workProduct -->
|
||||
<!-- workProduct>openpowerStandard</workProduct -->
|
||||
|
||||
<!-- TODO: Set the appropriate security policy for the document. For documents
|
||||
which are not "public" this will affect the document title page and
|
||||
create a vertical running ribbon on the internal margin of the
|
||||
security status in all CAPS. Values and definitions are formally
|
||||
defined by the IPR policy. A layman's definition follows:
|
||||
|
||||
public = this document may be shared outside the
|
||||
foundation and thus this setting must be
|
||||
used only when completely sure it allowed
|
||||
foundationConfidential = this document may be shared freely with
|
||||
OpenPOWER Foundation members but may not be
|
||||
shared publicly
|
||||
workgroupConfidential = this document may only be shared within the
|
||||
work group and should not be shared with
|
||||
other Foundation members or the public
|
||||
|
||||
The appropriate starting security for a new document is "workgroupConfidential". -->
|
||||
<!--security>workgroupConfidential</security -->
|
||||
<!-- security>foundationConfidential</security -->
|
||||
<security>public</security>
|
||||
|
||||
<!-- TODO: Set the appropriate work flow status for the document. For documents
|
||||
which are not "published" this will affect the document title page
|
||||
and create a vertical running ribbon on the internal margin of the
|
||||
security status in all CAPS. Values and definitions are formally
|
||||
defined by the IPR policy. A layman's definition follows:
|
||||
|
||||
published = this document has completed all reviews and has
|
||||
been published
|
||||
draft = this document is actively being updated and has
|
||||
not yet been reviewed
|
||||
review = this document is presently being reviewed
|
||||
|
||||
The appropriate starting security for a new document is "draft". -->
|
||||
<documentStatus>draft</documentStatus>
|
||||
<!-- documentStatus>review</documentStatus -->
|
||||
<!-- documentStatus>publish</documentStatus -->
|
||||
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<!-- These parameters apply to pdf and webhelp -->
|
||||
<xincludeSupported>true</xincludeSupported>
|
||||
<sourceDirectory>.</sourceDirectory>
|
||||
<includes>
|
||||
<!-- TODO: If you desire, you may change the following filename to something more appropriate for the new document -->
|
||||
bk_main.xml
|
||||
</includes>
|
||||
|
||||
<!-- **TODO: Set to the correct project URL. This likely needs input from the TSC. -->
|
||||
<!-- canonicalUrlBase>http://openpowerfoundation.org/docs/template-guide/content</canonicalUrlBase -->
|
||||
<glossaryCollection>${basedir}/../glossary/glossary-terms.xml</glossaryCollection>
|
||||
<includeCoverLogo>1</includeCoverLogo>
|
||||
<coverUrl>www.openpowerfoundation.org</coverUrl>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
|
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017 OpenPOWER Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<section xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5.0"
|
||||
xml:id="sec_api_implemented">
|
||||
<title>How the API is implemented</title>
|
||||
|
||||
<para>One pleasant surprise is that many (at least for the older Intel)
|
||||
Intrinsics are implemented directly in C vector extension code and/or a simple
|
||||
mapping to GCC target specific builtins. </para>
|
||||
|
||||
<xi:include href="sec_simple_examples.xml"/>
|
||||
<xi:include href="sec_extra_attributes.xml"/>
|
||||
<xi:include href="sec_how_findout.xml"/>
|
||||
<xi:include href="sec_other_intrinsic_examples.xml"/>
|
||||
|
||||
</section>
|
||||
|
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017 OpenPOWER Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<section xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5.0"
|
||||
xml:id="sec_floatingpoint_rounding">
|
||||
<title>Floating-point rounding modes</title>
|
||||
|
||||
<para>The Intel (x86 / x86_64) and PowerISA architectures both support the
|
||||
4 IEEE754 rounding modes. Again while the Intel Intrinsic API allows the
|
||||
application to change rounding modes via updates to the
|
||||
<literal>MXCSR</literal> it is a bad idea
|
||||
and should be replaced with the POSIX APIs (<literal>fegetround</literal> and
|
||||
<literal>fesetround</literal>). </para>
|
||||
|
||||
</section>
|
||||
|
@ -0,0 +1,49 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017 OpenPOWER Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<section xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5.0"
|
||||
xml:id="sec_performance">
|
||||
<title>Performance</title>
|
||||
|
||||
<para>The performance of a ported intrinsic depends on the specifics of the
|
||||
intrinsic and the context it is used in. Many of the SIMD operations have
|
||||
equivalent instructions in both architectures. For example the vector float and
|
||||
vector double match very closely. However the SSE and VSX scalars have subtle
|
||||
differences of how the scalar is positioned with the vector registers and what
|
||||
happens to the rest (non-scalar part) of the register (previously discussed in
|
||||
<xref linkend="sec_packed_vs_scalar_intrinsics"/>).
|
||||
This requires additional PowerISA instructions
|
||||
to preserve the non-scalar portion of the vector registers. This may or may not
|
||||
be important to the logic of the program being ported, but we have handle the
|
||||
case where it is.</para>
|
||||
|
||||
<para>This is where the context of now the intrinsic is used starts to
|
||||
matter. If the scalar intrinsics are used within a larger program the compiler
|
||||
may be able to eliminate the redundant register moves as the results are never
|
||||
used. In the other cases common set up (like permute vectors or bit masks) can
|
||||
be common-ed up and hoisted out of the loop. So it is very important to let the
|
||||
compiler do its job with higher optimization levels (<literal>-O3</literal>,
|
||||
<literal>-funroll-loops</literal>).</para>
|
||||
|
||||
<xi:include href="sec_performance_sse.xml"/>
|
||||
<xi:include href="sec_performance_mmx.xml"/>
|
||||
|
||||
</section>
|
||||
|
@ -0,0 +1,33 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017 OpenPOWER Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<section xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5.0"
|
||||
xml:id="sec_powerisa">
|
||||
<title>The PowerISA</title>
|
||||
|
||||
<para>The PowerISA is for historical reasons is organized at the top level
|
||||
by the distinction between older Vector Facility (Altivec / VMX) and the newer
|
||||
Vector-Scalar Floating-Point Operations (VSX). </para>
|
||||
|
||||
<xi:include href="sec_power_vmx.xml"/>
|
||||
<xi:include href="sec_power_vsx.xml"/>
|
||||
|
||||
</section>
|
||||
|
@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017 OpenPOWER Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<section xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5.0"
|
||||
xml:id="sec_powerisa_vector_facilities">
|
||||
<title>PowerISA Vector facilities</title>
|
||||
|
||||
<para>The PowerISA vector facilities (VMX and VSX) are extensive, but does
|
||||
not always provide a direct or obvious functional equivalent to the Intel
|
||||
Intrinsics. But being not obvious is not the same as imposible. It just
|
||||
requires some basic programing skills.</para>
|
||||
|
||||
<para>It is a good idea to have an overall understanding of the vector
|
||||
capabilities the PowerISA. You do not need to memorize every instructions but
|
||||
is helps to know where to look. Both the PowerISA and OpenPOWER ABI have a
|
||||
specific structure and organization that can help you find what you looking
|
||||
for. </para>
|
||||
|
||||
<para>It also helps to understand the relationship between the PowerISAs
|
||||
low level instructions and the higher abstraction of the vector intrinsics as
|
||||
defined by the OpenPOWER ABIs Vector Programming Interfaces and the the defacto
|
||||
standard of GCC's PowerPC AltiVec Built-in Functions.</para>
|
||||
|
||||
<xi:include href="sec_powerisa.xml"/>
|
||||
<xi:include href="sec_powerisa_vector_intrinsics.xml"/>
|
||||
<xi:include href="sec_powerisa_vector_size_type.xml"/>
|
||||
|
||||
</section>
|
||||
|
@ -0,0 +1,57 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017 OpenPOWER Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<section xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5.0"
|
||||
xml:id="sec_prefered_methods">
|
||||
<title>Prefered methods</title>
|
||||
|
||||
<para>As we will see there are multiple ways to implement the logic of
|
||||
these intrinsics. Some implementation methods are preferred because they allow
|
||||
the compiler to select instructions and provided the most flexibility for
|
||||
optimization across the whole sequence. Other methods may be required to
|
||||
deliver a specific semantic or to deliver better optimization than the current
|
||||
compiler is capable of. Some methods are more portable across multiple
|
||||
compilers (GCC, LLVM, ...). All of this should be taken into consideration for
|
||||
each intrinsic implementation. In general we should use the following list as a
|
||||
guide to these decisions:</para>
|
||||
|
||||
<orderedlist>
|
||||
<listitem>
|
||||
<para>Use C vector arithmetic, logical, dereference, etc., operators in
|
||||
preference to intrinsics.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Use the bi-endian interfaces from Appendix A of the ABI in
|
||||
preference to other intrinsics when available, as these are designed for
|
||||
portability among compilers.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>Use other, less well documented intrinsics (such as
|
||||
<literal>__builtin_vsx_*</literal>) when no better facility is available, in preference to
|
||||
assembly.</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>If necessary, use inline assembly, but know what you're
|
||||
doing.</para>
|
||||
</listitem>
|
||||
</orderedlist>
|
||||
|
||||
</section>
|
||||
|
@ -0,0 +1,62 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
Copyright (c) 2017 OpenPOWER Foundation
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
-->
|
||||
<section xmlns="http://docbook.org/ns/docbook"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="5.0"
|
||||
xml:id="sec_simple_examples">
|
||||
<title>Some simple examples</title>
|
||||
|
||||
<para>For example; a vector double splat looks like this:
|
||||
<programlisting><![CDATA[/* Create a vector with both elements equal to F. */
|
||||
extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_set1_pd (double __F)
|
||||
{
|
||||
return __extension__ (__m128d){ __F, __F };
|
||||
}]]></programlisting></para>
|
||||
|
||||
<para>Another example:
|
||||
<programlisting><![CDATA[extern __inline __m128d __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_add_pd (__m128d __A, __m128d __B)
|
||||
{
|
||||
return (__m128d) ((__v2df)__A + (__v2df)__B);
|
||||
}]]></programlisting></para>
|
||||
|
||||
<para>Note in the example above the cast to __v2df for the operation. Both
|
||||
__m128d and __v2df are vector double, but __v2df does no have the <literal>__may_alias__</literal>
|
||||
attribute. And one more example:
|
||||
<programlisting><![CDATA[extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__))
|
||||
_mm_mullo_epi16 (__m128i __A, __m128i __B)
|
||||
{
|
||||
return (__m128i) ((__v8hu)__A * (__v8hu)__B);
|
||||
}]]></programlisting></para>
|
||||
|
||||
<para>Note this requires a cast for the compiler to generate the correct
|
||||
code for the intended operation. The parameters and result are the generic
|
||||
<literal>__m128i</literal>, which is a vector long long with the
|
||||
<literal>__may_alias__</literal> attribute. But
|
||||
operation is a vector multiply low unsigned short (<literal>__v8hu</literal>). So not only do we
|
||||
use the cast to drop the <literal>__may_alias__</literal> attribute but we also need to cast to
|
||||
the correct (vector unsigned short) type for the specified operation.</para>
|
||||
|
||||
<para>I have successfully copied these (and similar) source snippets over
|
||||
to the PPC64LE implementation unchanged. This of course assumes the associated
|
||||
types are defined and with compatible attributes.</para>
|
||||
|
||||
</section>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
||||
|
||||
<parent>
|
||||
<groupId>org.openpowerfoundation.docs</groupId>
|
||||
<artifactId>master-pom</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<relativePath>../Docs-Master/pom.xml</relativePath>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>workgroup-pom</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<!-- TODO: Add new documents are build in the project, add their directories to this list to
|
||||
enable all document builds from the top level -->
|
||||
<module>Vector_Intrinsics</module>
|
||||
</modules>
|
||||
</project>
|
Loading…
Reference in New Issue