From patchwork Wed May 9 17:42:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kelvin Nilsen X-Patchwork-Id: 911061 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-477447-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Rjyu5Oef"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40h3bH5ZWsz9s4t for ; Thu, 10 May 2018 03:42:34 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; q=dns; s=default; b=XrOT1 7ehCUxoDFAwz3L5SW5lAnrYc6qsKXeNEo800Y/oOhoMQsRg1JDaCbaJUb5KVzcU9 5idy5eUjFFKp6SrH56UYfbEgwdqlaCyVyrqF23w1t92u6tW4OXmX1twgMptR9a5e 3vaom9upQVoRrNvRJ93IhUjO7QBfrJgmWd4ydU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:content-type :content-transfer-encoding:message-id; s=default; bh=52XFMH6TyZI rYk1DRrpc6qUsn44=; b=Rjyu5Oef0owfR1qjwCvaHIJqPMAWfc690XOwTVl/7TW XyXpKyk4JFuHaUpC3iNrYzK9thDI56AHcugovrAZgLzkqZfh4/kLmzSpFbFtb/Gk p/NIT1Am1iulljMBEBs6dITDg6Ol5VWV2YovvOU1FsUySPBFCb/2+P3mXepdwcX0 = Received: (qmail 98337 invoked by alias); 9 May 2018 17:42:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 98318 invoked by uid 89); 9 May 2018 17:42:24 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-17.1 required=5.0 tests=BAYES_00, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 spammy=transactions, darn, __float128 X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 09 May 2018 17:42:18 +0000 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w49He30k118512 for ; Wed, 9 May 2018 13:42:16 -0400 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hv4y5j358-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 09 May 2018 13:42:15 -0400 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 9 May 2018 11:42:14 -0600 Received: from b03cxnp07029.gho.boulder.ibm.com (9.17.130.16) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 9 May 2018 11:42:13 -0600 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp07029.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w49HgDfr9503216; Wed, 9 May 2018 10:42:13 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 02F2013603A; Wed, 9 May 2018 11:42:13 -0600 (MDT) Received: from Kelvins-MacBook-Pro-2.local (unknown [9.80.207.5]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id 73DC7136048; Wed, 9 May 2018 11:42:12 -0600 (MDT) To: gcc-patches@gcc.gnu.org Cc: segher@gcc.gnu.org From: Kelvin Nilsen Subject: [PATCH v2, rs6000] Improve Documentation of Built-In Functions Part 1 Date: Wed, 9 May 2018 12:42:11 -0500 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18050917-8235-0000-0000-00000D75691E X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008997; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000259; SDB=6.01029866; UDB=6.00526281; IPR=6.00809001; MB=3.00021014; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-09 17:42:14 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18050917-8236-0000-0000-000040DE673C Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-05-09_07:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805090166 This is the first of several planned patches to address shortcomings in existing documentation of PowerPC built-in functions. The focus of this particular patch is to improve documentation of basic built-in functions that do not require inclusion of special header files. A summary of this patch follows: 1. Change the name of the first PowerPC built-in section from "PowerPC Built-in Functions" to "Basic PowerPC Built-in Functions". This section has never described all PowerPC built-in functions. 2. Introduce subsubsections within this section to independently describe built-in functions that target particular ISA levels. Sort function descriptions into appropriate subsubsections. 3. Add descriptions of three new features that can be tested with the __builtin_cpu_supports function: darn, htm-no-suspend, and scv. 4. Corrected the spellings of several built-in functions: __builtin_fmaf128_round_to_odd, __builtin_addg6s, __builtin_cbctdt, __builtin_cdtbcd. This patch is limited in scope in order to manage complexity of the diffs. Subsequent patches will address different sections of the documentation. Subsequent patches will also add new function descriptions into these sections. This differs from the previous draft patch in the following regards: 1. This patch adds back in documentation of the __builtin_fabsq, __builtin_copysignq, __builtin_infq, __builtin_huge_valq, __builtin_nanq, __builtin_nansq, __builtin_sqrtf128, and __builtin_fmaf128 functions. 2. Consistently, changed subsubsection names from "Low-Level PowerPC Built-in ... " to "Basic PowerPC Built-in ... " 3. Changed subsubsection name from "... Available on All Targets" to "... Available on All Configurations". 4. Used @code{} font for darn and tsuspend. instruction names. 5. Removed unnecessary parentheses around many option descriptions. 6. Clarified that the result returned from the __builtin_darn_32 function is conditioned. 7. Enhanced the ChangeLog to call out each of the subsection names (within extend.texi) that is affected by this patch. 8. Changed the menu reference to the newly named "Basic PowerPC Built-in Functions" 9. Added a new sub-menu to identify the subsubsections of the "Basic PowerPC Built-in Functions" section. I have bootstrapped and regression tested without regressions on both powerpc64le-unknown-linux (P8) and on powerpc-linux (P8 big-endian, with both -m32 and -m64 target options). I have built and reviewed the gcc.pdf on the little-endian test platform. I did not build the gcc.pdf file on my big-endian test platform because it is missing relevant fonts. Is this ok for the trunk? 2018-05-09 Kelvin Nilsen * doc/extend.texi (PowerPC Built-in Functions): Rename this subsection. (Basic PowerPC Built-in Functions): The new name of the subsection previously known as "PowerPC Built-in Functions". (Basic PowerPC Built-in Functions Available on all Configurations): New subsubsection. (Basic PowerPC Built-in Functions Available on ISA 2.05): Likewise. (Basic PowerPC Built-in Functions Available on ISA 2.06): Likewise. (Basic PowerPC Built-in Functions Available on ISA 2.07): Likewise. (Basic PowerPC Built-in Functions Available on ISA 3.0): Likewise. Index: gcc/doc/extend.texi =================================================================== --- gcc/doc/extend.texi (revision 260073) +++ gcc/doc/extend.texi (working copy) @@ -12475,7 +12475,7 @@ * MSP430 Built-in Functions:: * NDS32 Built-in Functions:: * picoChip Built-in Functions:: -* PowerPC Built-in Functions:: +* Basic PowerPC Built-in Functions:: * PowerPC AltiVec/VSX Built-in Functions:: * PowerPC Hardware Transactional Memory Built-in Functions:: * PowerPC Atomic Memory Operation Functions:: @@ -15534,12 +15534,25 @@ @end table -@node PowerPC Built-in Functions -@subsection PowerPC Built-in Functions +@node Basic PowerPC Built-in Functions +@subsection Basic PowerPC Built-in Functions -The following built-in functions are always available and can be used to -check the PowerPC target platform type: +@menu +* Basic PowerPC Built-in Functions Available on all Configurations:: +* Basic PowerPC Built-in Functions Available on ISA 2.05:: +* Basic PowerPC Built-in Functions Available on ISA 2.06:: +* Basic PowerPC Built-in Functions Available on ISA 2.07:: +* Basic PowerPC Built-in Functions Available on ISA 3.0:: +@end menu +This section describes PowerPC built-in functions that do not require +the inclusion of any special header files to declare prototypes or +provide macro definitions. The sections that follow describe +additional PowerPC built-in functions. + +@node Basic PowerPC Built-in Functions Available on all Configurations +@subsubsection Basic PowerPC Built-in Functions Available on all Configurations + @deftypefn {Built-in Function} void __builtin_cpu_init (void) This function is a @code{nop} on the PowerPC platform and is included solely to maintain API compatibility with the x86 builtins. @@ -15643,6 +15656,8 @@ CPU supports the Embedded ISA category. @item cellbe CPU has a CELL broadband engine. +@item darn +CPU supports the @code{darn} (deliver a random number) instruction. @item dfp CPU has a decimal floating point unit. @item dscr @@ -15659,6 +15674,9 @@ CPU has hardware transaction memory instructions. @item htm-nosc Kernel aborts hardware transactions when a syscall is made. +@item htm-no-suspend +CPU supports hardware transaction memory but does not support the +@code{tsuspend.} instruction. @item ic_snoop CPU supports icache snooping capabilities. @item ieee128 @@ -15687,6 +15705,8 @@ CPU supports 64-bit mode execution. @item ppcle CPU supports a little-endian mode that uses address swizzling. +@item scv +Kernel supports system call vectored. @item smt CPU support simultaneous multi-threading. @item spe @@ -15718,19 +15738,81 @@ @end smallexample @end deftypefn -These built-in functions are available for the PowerPC family of +The following built-in functions are also available on all PowerPC processors: @smallexample -float __builtin_recipdivf (float, float); -float __builtin_rsqrtf (float); -double __builtin_recipdiv (double, double); -double __builtin_rsqrt (double); uint64_t __builtin_ppc_get_timebase (); unsigned long __builtin_ppc_mftb (); -double __builtin_unpack_longdouble (long double, int); -long double __builtin_pack_longdouble (double, double); @end smallexample +The @code{__builtin_ppc_get_timebase} and @code{__builtin_ppc_mftb} +functions generate instructions to read the Time Base Register. The +@code{__builtin_ppc_get_timebase} function may generate multiple +instructions and always returns the 64 bits of the Time Base Register. +The @code{__builtin_ppc_mftb} function always generates one instruction and +returns the Time Base Register value as an unsigned long, throwing away +the most significant word on 32-bit environments. + +@node Basic PowerPC Built-in Functions Available on ISA 2.05 +@subsubsection Basic PowerPC Built-in Functions Available on ISA 2.05 + +The basic built-in functions described in this section are +available on the PowerPC family of processors starting with ISA 2.05 +or later. Unless specific options are explicitly disabled on the +command line, specifying option @option{-mcpu=power6} has the effect of +enabling the @option{-mpowerpc64}, @option{-mpowerpc-gpopt}, +@option{-mpowerpc-gfxopt}, @option{-mmfcrf}, @option{-mpopcntb}, +@option{-mfprnd}, @option{-mcmpb}, @option{-mhard-dfp}, and +@option{-mrecip-precision} options. Specify the +@option{-maltivec} and @option{-mfpgpr} options explicitly in +combination with the above options if they are desired. + +The following functions require option @option{-mcmpb}. +@smallexample +unsigned long long __builtin_cmpb (unsigned long long int, unsigned long long int); +unsigned int __builtin_cmpb (unsigned int, unsigned int); +@end smallexample + +The @code{__builtin_cmpb} function +performs a byte-wise compare on the contents of its two arguments, +returning the result of the byte-wise comparison as the returned +value. For each byte comparison, the corresponding byte of the return +value holds 0xff if the input bytes are equal and 0 if the input bytes +are not equal. If either of the arguments to this built-in function +is wider than 32 bits, the function call expands into the form that +expects @code{unsigned long long int} arguments +which is only available on 64-bit targets. + +The following built-in functions are available +when hardware decimal floating point +(@option{-mhard-dfp}) is available: +@smallexample +_Decimal64 __builtin_ddedpd (int, _Decimal64); +_Decimal128 __builtin_ddedpdq (int, _Decimal128); +_Decimal64 __builtin_denbcd (int, _Decimal64); +_Decimal128 __builtin_denbcdq (int, _Decimal128); +_Decimal64 __builtin_diex (long long, _Decimal64); +_Decimal128 _builtin_diexq (long long, _Decimal128); +_Decimal64 __builtin_dscli (_Decimal64, int); +_Decimal128 __builtin_dscliq (_Decimal128, int); +_Decimal64 __builtin_dscri (_Decimal64, int); +_Decimal128 __builtin_dscriq (_Decimal128, int); +long long __builtin_dxex (_Decimal64); +long long __builtin_dxexq (_Decimal128); +_Decimal128 __builtin_pack_dec128 (unsigned long long, unsigned long long); +unsigned long long __builtin_unpack_dec128 (_Decimal128, int); +@end smallexample + +The following functions require @option{-mhard-float}, +@option{-mpowerpc-gfxopt}, and @option{-mpopcntb} options. + +@smallexample +double __builtin_recipdiv (double, double); +float __builtin_recipdivf (float, float); +double __builtin_rsqrt (double); +float __builtin_rsqrtf (float); +@end smallexample + The @code{vec_rsqrt}, @code{__builtin_rsqrt}, and @code{__builtin_rsqrtf} functions generate multiple instructions to implement the reciprocal sqrt functionality using reciprocal sqrt @@ -15740,43 +15822,85 @@ functions generate multiple instructions to implement division using the reciprocal estimate instructions. -The @code{__builtin_ppc_get_timebase} and @code{__builtin_ppc_mftb} -functions generate instructions to read the Time Base Register. The -@code{__builtin_ppc_get_timebase} function may generate multiple -instructions and always returns the 64 bits of the Time Base Register. -The @code{__builtin_ppc_mftb} function always generates one instruction and -returns the Time Base Register value as an unsigned long, throwing away -the most significant word on 32-bit environments. +The following functions require @option{-mhard-float} and +@option{-mmultiple} options. -Additional built-in functions are available for the 64-bit PowerPC -family of processors, for efficient use of 128-bit floating point -(@code{__float128}) values. +@smallexample +long double __builtin_pack_longdouble (double, double); +double __builtin_unpack_longdouble (long double, int); +@end smallexample -Previous versions of GCC supported some 'q' builtins for IEEE 128-bit -floating point. These functions are now mapped into the equivalent -'f128' builtin functions. +@node Basic PowerPC Built-in Functions Available on ISA 2.06 +@subsubsection Basic PowerPC Built-in Functions Available on ISA 2.06 +The basic built-in functions described in this section are +available on the PowerPC family of processors starting with ISA 2.05 +or later. Unless specific options are explicitly disabled on the +command line, specifying option @option{-mcpu=power7} has the effect of +enabling all the same options as for @option{-mcpu=power6} in +addition to the @option{-maltivec}, @option{-mpopcntd}, and +@option{-mvsx} options. + +The following basic built-in functions require @option{-mpopcntd}: @smallexample -__builtin_fabsq is mapped into __builtin_fabsf128 -__builtin_copysignq is mapped into __builtin_copysignf128 -__builtin_infq is mapped into __builtin_inff128 -__builtin_huge_valq is mapped into __builtin_huge_valf128 -__builtin_nanq is mapped into __builtin_nanf128 -__builtin_nansq is mapped into __builtin_nansf128 +unsigned int __builtin_addg6s (unsigned int, unsigned int); +long long __builtin_bpermd (long long, long long); +unsigned int __builtin_cbcdtd (unsigned int); +unsigned int __builtin_cdtbcd (unsigned int); +long long __builtin_divde (long long, long long); +unsigned long long __builtin_divdeu (unsigned long long, unsigned long long); +int __builtin_divwe (int, int); +unsigned int __builtin_divweu (unsigned int, unsigned int); +vector __int128_t __builtin_pack_vector_int128 (long long, long long); +void __builtin_rs6000_speculation_barrier (void); +long long __builtin_unpack_vector_int128 (vector __int128_t, signed char); @end smallexample +Of these, the @code{__builtin_divde} and @code{__builtin_divdeu} functions +require a 64-bit environment. + +The following basic built-in functions, which are also supported on +x86 targets, require @option{-mfloat128}. +@smallexample +__float128 __builtin_fabsq (__float128); +__float128 __builtin_copysignq (__float128, __float128); +__float128 __builtin_infq (void); +__float128 __builtin_huge_valq (void); +__float128 __builtin_nanq (void); +__float128 __builtin_nansq (void); + +__float128 __builtin_sqrtf128 (__float128); +__float128 __builtin_fmaf128 (__float128, __float128, __float128); +@end smallexample + +@node Basic PowerPC Built-in Functions Available on ISA 2.07 +@subsubsection Basic PowerPC Built-in Functions Available on ISA 2.07 + +The basic built-in functions described in this section are +available on the PowerPC family of processors starting with ISA 2.07 +or later. Unless specific options are explicitly disabled on the +command line, specifying option @option{-mcpu=power8} has the effect of +enabling all the same options as for @option{-mcpu=power7} in +addition to the @option{-mpower8-fusion}, @option{-mpower8-vector}, +@option{-mcrypto}, @option{-mhtm}, @option{-mquad-memory}, and +@option{-mquad-memory-atomic} options. + +This section intentionally empty. + +@node Basic PowerPC Built-in Functions Available on ISA 3.0 +@subsubsection Basic PowerPC Built-in Functions Available on ISA 3.0 + +The basic built-in functions described in this section are +available on the PowerPC family of processors starting with ISA 3.0 +or later. Unless specific options are explicitly disabled on the +command line, specifying option @option{-mcpu=power9} has the effect of +enabling all the same options as for @option{-mcpu=power8} in +addition to the @option{-misel} option. + The following built-in functions are available on Linux 64-bit systems -that use the ISA 3.0 instruction set. +that use the ISA 3.0 instruction set (@option{-mcpu=power9}): @table @code -@item __float128 __builtin_sqrtf128 (__float128) -Perform a 128-bit IEEE floating point square root operation. -@findex __builtin_sqrtf128 - -@item __float128 __builtin_fmaf128 (__float128, __float128, __float128) -Perform a 128-bit IEEE floating point fused multiply and add operation. -@findex __builtin_fmaf128 - @item __float128 __builtin_addf128_round_to_odd (__float128, __float128) Perform a 128-bit IEEE floating point add using round to odd as the rounding mode. @@ -15802,7 +15926,7 @@ as the rounding mode. @findex __builtin_sqrtf128_round_to_odd -@item __float128 __builtin_fmaf128 (__float128, __float128, __float128) +@item __float128 __builtin_fmaf128_round_to_odd (__float128, __float128, __float128) Perform a 128-bit IEEE floating point fused multiply and add operation using round to odd as the rounding mode. @findex __builtin_fmaf128_round_to_odd @@ -15813,78 +15937,26 @@ @findex __builtin_truncf128_round_to_odd @end table -The following built-in functions are available for the PowerPC family -of processors, starting with ISA 2.05 or later (@option{-mcpu=power6} -or @option{-mcmpb}): +The following additional built-in functions are also available for the +PowerPC family of processors, starting with ISA 3.0 or later: @smallexample -unsigned long long __builtin_cmpb (unsigned long long int, unsigned long long int); -unsigned int __builtin_cmpb (unsigned int, unsigned int); -@end smallexample - -The @code{__builtin_cmpb} function -performs a byte-wise compare on the contents of its two arguments, -returning the result of the byte-wise comparison as the returned -value. For each byte comparison, the corresponding byte of the return -value holds 0xff if the input bytes are equal and 0 if the input bytes -are not equal. If either of the arguments to this built-in function -is wider than 32 bits, the function call expands into the form that -expects @code{unsigned long long int} arguments -which is only available on 64-bit targets. - -The following built-in functions are available for the PowerPC family -of processors, starting with ISA 2.06 or later (@option{-mcpu=power7} -or @option{-mpopcntd}): -@smallexample -long __builtin_bpermd (long, long); -int __builtin_divwe (int, int); -unsigned int __builtin_divweu (unsigned int, unsigned int); -long __builtin_divde (long, long); -unsigned long __builtin_divdeu (unsigned long, unsigned long); -unsigned int cdtbcd (unsigned int); -unsigned int cbcdtd (unsigned int); -unsigned int addg6s (unsigned int, unsigned int); -void __builtin_rs6000_speculation_barrier (void); -@end smallexample - -The @code{__builtin_divde} and @code{__builtin_divdeu} functions -require a 64-bit environment supporting ISA 2.06 or later. - -The following built-in functions are available for the PowerPC family -of processors, starting with ISA 3.0 or later (@option{-mcpu=power9}): -@smallexample long long __builtin_darn (void); long long __builtin_darn_raw (void); int __builtin_darn_32 (void); +@end smallexample -unsigned int scalar_extract_exp (double source); -unsigned long long int scalar_extract_exp (__ieee128 source); +The @code{__builtin_darn} and @code{__builtin_darn_raw} +functions require a +64-bit environment supporting ISA 3.0 or later. +The @code{__builtin_darn} function provides a 64-bit conditioned +random number. The @code{__builtin_darn_raw} function provides a +64-bit raw random number. The @code{__builtin_darn_32} function +provides a 32-bit conditioned random number. -unsigned long long int scalar_extract_sig (double source); -unsigned __int128 scalar_extract_sig (__ieee128 source); +The following additional built-in functions are also available for the +PowerPC family of processors, starting with ISA 3.0 or later: -double -scalar_insert_exp (unsigned long long int significand, unsigned long long int exponent); -double -scalar_insert_exp (double significand, unsigned long long int exponent); - -ieee_128 -scalar_insert_exp (unsigned __int128 significand, unsigned long long int exponent); -ieee_128 -scalar_insert_exp (ieee_128 significand, unsigned long long int exponent); - -int scalar_cmp_exp_gt (double arg1, double arg2); -int scalar_cmp_exp_lt (double arg1, double arg2); -int scalar_cmp_exp_eq (double arg1, double arg2); -int scalar_cmp_exp_unordered (double arg1, double arg2); - -bool scalar_test_data_class (float source, const int condition); -bool scalar_test_data_class (double source, const int condition); -bool scalar_test_data_class (__ieee128 source, const int condition); - -bool scalar_test_neg (float source); -bool scalar_test_neg (double source); -bool scalar_test_neg (__ieee128 source); - +@smallexample int __builtin_byte_in_set (unsigned char u, unsigned long long set); int __builtin_byte_in_range (unsigned char u, unsigned int range); int __builtin_byte_in_either_range (unsigned char u, unsigned int ranges); @@ -15909,81 +15981,6 @@ int __builtin_dfp_dtstsfi_ov_dd (unsigned int comparison, _Decimal64 value); int __builtin_dfp_dtstsfi_ov_td (unsigned int comparison, _Decimal128 value); @end smallexample - -The @code{__builtin_darn} and @code{__builtin_darn_raw} -functions require a -64-bit environment supporting ISA 3.0 or later. -The @code{__builtin_darn} function provides a 64-bit conditioned -random number. The @code{__builtin_darn_raw} function provides a -64-bit raw random number. The @code{__builtin_darn_32} function -provides a 32-bit random number. - -The @code{scalar_extract_exp} and @code{scalar_extract_sig} -functions require a 64-bit environment supporting ISA 3.0 or later. -The @code{scalar_extract_exp} and @code{scalar_extract_sig} built-in -functions return the significand and the biased exponent value -respectively of their @code{source} arguments. -When supplied with a 64-bit @code{source} argument, the -result returned by @code{scalar_extract_sig} has -the @code{0x0010000000000000} bit set if the -function's @code{source} argument is in normalized form. -Otherwise, this bit is set to 0. -When supplied with a 128-bit @code{source} argument, the -@code{0x00010000000000000000000000000000} bit of the result is -treated similarly. -Note that the sign of the significand is not represented in the result -returned from the @code{scalar_extract_sig} function. Use the -@code{scalar_test_neg} function to test the sign of its @code{double} -argument. - -The @code{scalar_insert_exp} -functions require a 64-bit environment supporting ISA 3.0 or later. -When supplied with a 64-bit first argument, the -@code{scalar_insert_exp} built-in function returns a double-precision -floating point value that is constructed by assembling the values of its -@code{significand} and @code{exponent} arguments. The sign of the -result is copied from the most significant bit of the -@code{significand} argument. The significand and exponent components -of the result are composed of the least significant 11 bits of the -@code{exponent} argument and the least significant 52 bits of the -@code{significand} argument respectively. - -When supplied with a 128-bit first argument, the -@code{scalar_insert_exp} built-in function returns a quad-precision -ieee floating point value. The sign bit of the result is copied from -the most significant bit of the @code{significand} argument. -The significand and exponent components of the result are composed of -the least significant 15 bits of the @code{exponent} argument and the -least significant 112 bits of the @code{significand} argument respectively. - -The @code{scalar_cmp_exp_gt}, @code{scalar_cmp_exp_lt}, -@code{scalar_cmp_exp_eq}, and @code{scalar_cmp_exp_unordered} built-in -functions return a non-zero value if @code{arg1} is greater than, less -than, equal to, or not comparable to @code{arg2} respectively. The -arguments are not comparable if one or the other equals NaN (not a -number). - -The @code{scalar_test_data_class} built-in function returns 1 -if any of the condition tests enabled by the value of the -@code{condition} variable are true, and 0 otherwise. The -@code{condition} argument must be a compile-time constant integer with -value not exceeding 127. The -@code{condition} argument is encoded as a bitmask with each bit -enabling the testing of a different condition, as characterized by the -following: -@smallexample -0x40 Test for NaN -0x20 Test for +Infinity -0x10 Test for -Infinity -0x08 Test for +Zero -0x04 Test for -Zero -0x02 Test for +Denormal -0x01 Test for -Denormal -@end smallexample - -The @code{scalar_test_neg} built-in function returns 1 if its -@code{source} argument holds a negative value, 0 otherwise. - The @code{__builtin_byte_in_set} function requires a 64-bit environment supporting ISA 3.0 or later. This function returns a non-zero value if and only if its @code{u} argument exactly equals one of @@ -16034,241 +16031,8 @@ require that the type of the @code{value} argument be @code{__Decimal64} and @code{__Decimal128} respectively. -The following built-in functions are also available for the PowerPC family -of processors, starting with ISA 3.0 or later -(@option{-mcpu=power9}). These string functions are described -separately in order to group the descriptions closer to the function -prototypes: -@smallexample -int vec_all_nez (vector signed char, vector signed char); -int vec_all_nez (vector unsigned char, vector unsigned char); -int vec_all_nez (vector signed short, vector signed short); -int vec_all_nez (vector unsigned short, vector unsigned short); -int vec_all_nez (vector signed int, vector signed int); -int vec_all_nez (vector unsigned int, vector unsigned int); -int vec_any_eqz (vector signed char, vector signed char); -int vec_any_eqz (vector unsigned char, vector unsigned char); -int vec_any_eqz (vector signed short, vector signed short); -int vec_any_eqz (vector unsigned short, vector unsigned short); -int vec_any_eqz (vector signed int, vector signed int); -int vec_any_eqz (vector unsigned int, vector unsigned int); -vector bool char vec_cmpnez (vector signed char arg1, vector signed char arg2); -vector bool char vec_cmpnez (vector unsigned char arg1, vector unsigned char arg2); -vector bool short vec_cmpnez (vector signed short arg1, vector signed short arg2); -vector bool short vec_cmpnez (vector unsigned short arg1, vector unsigned short arg2); -vector bool int vec_cmpnez (vector signed int arg1, vector signed int arg2); -vector bool int vec_cmpnez (vector unsigned int, vector unsigned int); - -vector signed char vec_cnttz (vector signed char); -vector unsigned char vec_cnttz (vector unsigned char); -vector signed short vec_cnttz (vector signed short); -vector unsigned short vec_cnttz (vector unsigned short); -vector signed int vec_cnttz (vector signed int); -vector unsigned int vec_cnttz (vector unsigned int); -vector signed long long vec_cnttz (vector signed long long); -vector unsigned long long vec_cnttz (vector unsigned long long); - -signed int vec_cntlz_lsbb (vector signed char); -signed int vec_cntlz_lsbb (vector unsigned char); - -signed int vec_cnttz_lsbb (vector signed char); -signed int vec_cnttz_lsbb (vector unsigned char); - -unsigned int vec_first_match_index (vector signed char, vector signed char); -unsigned int vec_first_match_index (vector unsigned char, - vector unsigned char); -unsigned int vec_first_match_index (vector signed int, vector signed int); -unsigned int vec_first_match_index (vector unsigned int, vector unsigned int); -unsigned int vec_first_match_index (vector signed short, vector signed short); -unsigned int vec_first_match_index (vector unsigned short, - vector unsigned short); -unsigned int vec_first_match_or_eos_index (vector signed char, - vector signed char); -unsigned int vec_first_match_or_eos_index (vector unsigned char, - vector unsigned char); -unsigned int vec_first_match_or_eos_index (vector signed int, - vector signed int); -unsigned int vec_first_match_or_eos_index (vector unsigned int, - vector unsigned int); -unsigned int vec_first_match_or_eos_index (vector signed short, - vector signed short); -unsigned int vec_first_match_or_eos_index (vector unsigned short, - vector unsigned short); -unsigned int vec_first_mismatch_index (vector signed char, - vector signed char); -unsigned int vec_first_mismatch_index (vector unsigned char, - vector unsigned char); -unsigned int vec_first_mismatch_index (vector signed int, - vector signed int); -unsigned int vec_first_mismatch_index (vector unsigned int, - vector unsigned int); -unsigned int vec_first_mismatch_index (vector signed short, - vector signed short); -unsigned int vec_first_mismatch_index (vector unsigned short, - vector unsigned short); -unsigned int vec_first_mismatch_or_eos_index (vector signed char, - vector signed char); -unsigned int vec_first_mismatch_or_eos_index (vector unsigned char, - vector unsigned char); -unsigned int vec_first_mismatch_or_eos_index (vector signed int, - vector signed int); -unsigned int vec_first_mismatch_or_eos_index (vector unsigned int, - vector unsigned int); -unsigned int vec_first_mismatch_or_eos_index (vector signed short, - vector signed short); -unsigned int vec_first_mismatch_or_eos_index (vector unsigned short, - vector unsigned short); - -vector unsigned short vec_pack_to_short_fp32 (vector float, vector float); - -vector signed char vec_xl_be (signed long long, signed char *); -vector unsigned char vec_xl_be (signed long long, unsigned char *); -vector signed int vec_xl_be (signed long long, signed int *); -vector unsigned int vec_xl_be (signed long long, unsigned int *); -vector signed __int128 vec_xl_be (signed long long, signed __int128 *); -vector unsigned __int128 vec_xl_be (signed long long, unsigned __int128 *); -vector signed long long vec_xl_be (signed long long, signed long long *); -vector unsigned long long vec_xl_be (signed long long, unsigned long long *); -vector signed short vec_xl_be (signed long long, signed short *); -vector unsigned short vec_xl_be (signed long long, unsigned short *); -vector double vec_xl_be (signed long long, double *); -vector float vec_xl_be (signed long long, float *); - -vector signed char vec_xl_len (signed char *addr, size_t len); -vector unsigned char vec_xl_len (unsigned char *addr, size_t len); -vector signed int vec_xl_len (signed int *addr, size_t len); -vector unsigned int vec_xl_len (unsigned int *addr, size_t len); -vector signed __int128 vec_xl_len (signed __int128 *addr, size_t len); -vector unsigned __int128 vec_xl_len (unsigned __int128 *addr, size_t len); -vector signed long long vec_xl_len (signed long long *addr, size_t len); -vector unsigned long long vec_xl_len (unsigned long long *addr, size_t len); -vector signed short vec_xl_len (signed short *addr, size_t len); -vector unsigned short vec_xl_len (unsigned short *addr, size_t len); -vector double vec_xl_len (double *addr, size_t len); -vector float vec_xl_len (float *addr, size_t len); - -vector unsigned char vec_xl_len_r (unsigned char *addr, size_t len); - -void vec_xst_len (vector signed char data, signed char *addr, size_t len); -void vec_xst_len (vector unsigned char data, unsigned char *addr, size_t len); -void vec_xst_len (vector signed int data, signed int *addr, size_t len); -void vec_xst_len (vector unsigned int data, unsigned int *addr, size_t len); -void vec_xst_len (vector unsigned __int128 data, unsigned __int128 *addr, size_t len); -void vec_xst_len (vector signed long long data, signed long long *addr, size_t len); -void vec_xst_len (vector unsigned long long data, unsigned long long *addr, size_t len); -void vec_xst_len (vector signed short data, signed short *addr, size_t len); -void vec_xst_len (vector unsigned short data, unsigned short *addr, size_t len); -void vec_xst_len (vector signed __int128 data, signed __int128 *addr, size_t len); -void vec_xst_len (vector double data, double *addr, size_t len); -void vec_xst_len (vector float data, float *addr, size_t len); - -void vec_xst_len_r (vector unsigned char data, unsigned char *addr, size_t len); - -signed char vec_xlx (unsigned int index, vector signed char data); -unsigned char vec_xlx (unsigned int index, vector unsigned char data); -signed short vec_xlx (unsigned int index, vector signed short data); -unsigned short vec_xlx (unsigned int index, vector unsigned short data); -signed int vec_xlx (unsigned int index, vector signed int data); -unsigned int vec_xlx (unsigned int index, vector unsigned int data); -float vec_xlx (unsigned int index, vector float data); - -signed char vec_xrx (unsigned int index, vector signed char data); -unsigned char vec_xrx (unsigned int index, vector unsigned char data); -signed short vec_xrx (unsigned int index, vector signed short data); -unsigned short vec_xrx (unsigned int index, vector unsigned short data); -signed int vec_xrx (unsigned int index, vector signed int data); -unsigned int vec_xrx (unsigned int index, vector unsigned int data); -float vec_xrx (unsigned int index, vector float data); -@end smallexample - -The @code{vec_all_nez}, @code{vec_any_eqz}, and @code{vec_cmpnez} -perform pairwise comparisons between the elements at the same -positions within their two vector arguments. -The @code{vec_all_nez} function returns a -non-zero value if and only if all pairwise comparisons are not -equal and no element of either vector argument contains a zero. -The @code{vec_any_eqz} function returns a -non-zero value if and only if at least one pairwise comparison is equal -or if at least one element of either vector argument contains a zero. -The @code{vec_cmpnez} function returns a vector of the same type as -its two arguments, within which each element consists of all ones to -denote that either the corresponding elements of the incoming arguments are -not equal or that at least one of the corresponding elements contains -zero. Otherwise, the element of the returned vector contains all zeros. - -The @code{vec_cntlz_lsbb} function returns the count of the number of -consecutive leading byte elements (starting from position 0 within the -supplied vector argument) for which the least-significant bit -equals zero. The @code{vec_cnttz_lsbb} function returns the count of -the number of consecutive trailing byte elements (starting from -position 15 and counting backwards within the supplied vector -argument) for which the least-significant bit equals zero. - -The @code{vec_xl_len} and @code{vec_xst_len} functions require a -64-bit environment supporting ISA 3.0 or later. The @code{vec_xl_len} -function loads a variable length vector from memory. The -@code{vec_xst_len} function stores a variable length vector to memory. -With both the @code{vec_xl_len} and @code{vec_xst_len} functions, the -@code{addr} argument represents the memory address to or from which -data will be transferred, and the -@code{len} argument represents the number of bytes to be -transferred, as computed by the C expression @code{min((len & 0xff), 16)}. -If this expression's value is not a multiple of the vector element's -size, the behavior of this function is undefined. -In the case that the underlying computer is configured to run in -big-endian mode, the data transfer moves bytes 0 to @code{(len - 1)} of -the corresponding vector. In little-endian mode, the data transfer -moves bytes @code{(16 - len)} to @code{15} of the corresponding -vector. For the load function, any bytes of the result vector that -are not loaded from memory are set to zero. -The value of the @code{addr} argument need not be aligned on a -multiple of the vector's element size. - -The @code{vec_xlx} and @code{vec_xrx} functions extract the single -element selected by the @code{index} argument from the vector -represented by the @code{data} argument. The @code{index} argument -always specifies a byte offset, regardless of the size of the vector -element. With @code{vec_xlx}, @code{index} is the offset of the first -byte of the element to be extracted. With @code{vec_xrx}, @code{index} -represents the last byte of the element to be extracted, measured -from the right end of the vector. In other words, the last byte of -the element to be extracted is found at position @code{(15 - index)}. -There is no requirement that @code{index} be a multiple of the vector -element size. However, if the size of the vector element added to -@code{index} is greater than 15, the content of the returned value is -undefined. - -The following built-in functions are available for the PowerPC family -of processors when hardware decimal floating point -(@option{-mhard-dfp}) is available: -@smallexample -long long __builtin_dxex (_Decimal64); -long long __builtin_dxexq (_Decimal128); -_Decimal64 __builtin_ddedpd (int, _Decimal64); -_Decimal128 __builtin_ddedpdq (int, _Decimal128); -_Decimal64 __builtin_denbcd (int, _Decimal64); -_Decimal128 __builtin_denbcdq (int, _Decimal128); -_Decimal64 __builtin_diex (long long, _Decimal64); -_Decimal128 _builtin_diexq (long long, _Decimal128); -_Decimal64 __builtin_dscli (_Decimal64, int); -_Decimal128 __builtin_dscliq (_Decimal128, int); -_Decimal64 __builtin_dscri (_Decimal64, int); -_Decimal128 __builtin_dscriq (_Decimal128, int); -unsigned long long __builtin_unpack_dec128 (_Decimal128, int); -_Decimal128 __builtin_pack_dec128 (unsigned long long, unsigned long long); -@end smallexample - -The following built-in functions are available for the PowerPC family -of processors when the Vector Scalar (vsx) instruction set is -available: -@smallexample -unsigned long long __builtin_unpack_vector_int128 (vector __int128_t, int); -vector __int128_t __builtin_pack_vector_int128 (unsigned long long, - unsigned long long); -@end smallexample - @node PowerPC AltiVec/VSX Built-in Functions @subsection PowerPC AltiVec Built-in Functions @@ -19040,6 +18804,312 @@ int __builtin_bcdsub_ov (vector __int128_t, vector __int128_t); @end smallexample +The following additional built-in functions are also available for the +PowerPC family of processors, starting with ISA 3.0 +(@option{-mcpu=power9}) or later: +@smallexample +unsigned int scalar_extract_exp (double source); +unsigned long long int scalar_extract_exp (__ieee128 source); + +unsigned long long int scalar_extract_sig (double source); +unsigned __int128 scalar_extract_sig (__ieee128 source); + +double +scalar_insert_exp (unsigned long long int significand, unsigned long long int exponent); +double +scalar_insert_exp (double significand, unsigned long long int exponent); + +ieee_128 +scalar_insert_exp (unsigned __int128 significand, unsigned long long int exponent); +ieee_128 +scalar_insert_exp (ieee_128 significand, unsigned long long int exponent); + +int scalar_cmp_exp_gt (double arg1, double arg2); +int scalar_cmp_exp_lt (double arg1, double arg2); +int scalar_cmp_exp_eq (double arg1, double arg2); +int scalar_cmp_exp_unordered (double arg1, double arg2); + +bool scalar_test_data_class (float source, const int condition); +bool scalar_test_data_class (double source, const int condition); +bool scalar_test_data_class (__ieee128 source, const int condition); + +bool scalar_test_neg (float source); +bool scalar_test_neg (double source); +bool scalar_test_neg (__ieee128 source); +@end smallexample + +The @code{scalar_extract_exp} and @code{scalar_extract_sig} +functions require a 64-bit environment supporting ISA 3.0 or later. +The @code{scalar_extract_exp} and @code{scalar_extract_sig} built-in +functions return the significand and the biased exponent value +respectively of their @code{source} arguments. +When supplied with a 64-bit @code{source} argument, the +result returned by @code{scalar_extract_sig} has +the @code{0x0010000000000000} bit set if the +function's @code{source} argument is in normalized form. +Otherwise, this bit is set to 0. +When supplied with a 128-bit @code{source} argument, the +@code{0x00010000000000000000000000000000} bit of the result is +treated similarly. +Note that the sign of the significand is not represented in the result +returned from the @code{scalar_extract_sig} function. Use the +@code{scalar_test_neg} function to test the sign of its @code{double} +argument. + +The @code{scalar_insert_exp} +functions require a 64-bit environment supporting ISA 3.0 or later. +When supplied with a 64-bit first argument, the +@code{scalar_insert_exp} built-in function returns a double-precision +floating point value that is constructed by assembling the values of its +@code{significand} and @code{exponent} arguments. The sign of the +result is copied from the most significant bit of the +@code{significand} argument. The significand and exponent components +of the result are composed of the least significant 11 bits of the +@code{exponent} argument and the least significant 52 bits of the +@code{significand} argument respectively. + +When supplied with a 128-bit first argument, the +@code{scalar_insert_exp} built-in function returns a quad-precision +ieee floating point value. The sign bit of the result is copied from +the most significant bit of the @code{significand} argument. +The significand and exponent components of the result are composed of +the least significant 15 bits of the @code{exponent} argument and the +least significant 112 bits of the @code{significand} argument respectively. + +The @code{scalar_cmp_exp_gt}, @code{scalar_cmp_exp_lt}, +@code{scalar_cmp_exp_eq}, and @code{scalar_cmp_exp_unordered} built-in +functions return a non-zero value if @code{arg1} is greater than, less +than, equal to, or not comparable to @code{arg2} respectively. The +arguments are not comparable if one or the other equals NaN (not a +number). + +The @code{scalar_test_data_class} built-in function returns 1 +if any of the condition tests enabled by the value of the +@code{condition} variable are true, and 0 otherwise. The +@code{condition} argument must be a compile-time constant integer with +value not exceeding 127. The +@code{condition} argument is encoded as a bitmask with each bit +enabling the testing of a different condition, as characterized by the +following: +@smallexample +0x40 Test for NaN +0x20 Test for +Infinity +0x10 Test for -Infinity +0x08 Test for +Zero +0x04 Test for -Zero +0x02 Test for +Denormal +0x01 Test for -Denormal +@end smallexample + +The @code{scalar_test_neg} built-in function returns 1 if its +@code{source} argument holds a negative value, 0 otherwise. + +The following built-in functions are also available for the PowerPC family +of processors, starting with ISA 3.0 or later +(@option{-mcpu=power9}). These string functions are described +separately in order to group the descriptions closer to the function +prototypes: +@smallexample +int vec_all_nez (vector signed char, vector signed char); +int vec_all_nez (vector unsigned char, vector unsigned char); +int vec_all_nez (vector signed short, vector signed short); +int vec_all_nez (vector unsigned short, vector unsigned short); +int vec_all_nez (vector signed int, vector signed int); +int vec_all_nez (vector unsigned int, vector unsigned int); + +int vec_any_eqz (vector signed char, vector signed char); +int vec_any_eqz (vector unsigned char, vector unsigned char); +int vec_any_eqz (vector signed short, vector signed short); +int vec_any_eqz (vector unsigned short, vector unsigned short); +int vec_any_eqz (vector signed int, vector signed int); +int vec_any_eqz (vector unsigned int, vector unsigned int); + +vector bool char vec_cmpnez (vector signed char arg1, vector signed char arg2); +vector bool char vec_cmpnez (vector unsigned char arg1, vector unsigned char arg2); +vector bool short vec_cmpnez (vector signed short arg1, vector signed short arg2); +vector bool short vec_cmpnez (vector unsigned short arg1, vector unsigned short arg2); +vector bool int vec_cmpnez (vector signed int arg1, vector signed int arg2); +vector bool int vec_cmpnez (vector unsigned int, vector unsigned int); + +vector signed char vec_cnttz (vector signed char); +vector unsigned char vec_cnttz (vector unsigned char); +vector signed short vec_cnttz (vector signed short); +vector unsigned short vec_cnttz (vector unsigned short); +vector signed int vec_cnttz (vector signed int); +vector unsigned int vec_cnttz (vector unsigned int); +vector signed long long vec_cnttz (vector signed long long); +vector unsigned long long vec_cnttz (vector unsigned long long); + +signed int vec_cntlz_lsbb (vector signed char); +signed int vec_cntlz_lsbb (vector unsigned char); + +signed int vec_cnttz_lsbb (vector signed char); +signed int vec_cnttz_lsbb (vector unsigned char); + +unsigned int vec_first_match_index (vector signed char, vector signed char); +unsigned int vec_first_match_index (vector unsigned char, + vector unsigned char); +unsigned int vec_first_match_index (vector signed int, vector signed int); +unsigned int vec_first_match_index (vector unsigned int, vector unsigned int); +unsigned int vec_first_match_index (vector signed short, vector signed short); +unsigned int vec_first_match_index (vector unsigned short, + vector unsigned short); +unsigned int vec_first_match_or_eos_index (vector signed char, + vector signed char); +unsigned int vec_first_match_or_eos_index (vector unsigned char, + vector unsigned char); +unsigned int vec_first_match_or_eos_index (vector signed int, + vector signed int); +unsigned int vec_first_match_or_eos_index (vector unsigned int, + vector unsigned int); +unsigned int vec_first_match_or_eos_index (vector signed short, + vector signed short); +unsigned int vec_first_match_or_eos_index (vector unsigned short, + vector unsigned short); +unsigned int vec_first_mismatch_index (vector signed char, + vector signed char); +unsigned int vec_first_mismatch_index (vector unsigned char, + vector unsigned char); +unsigned int vec_first_mismatch_index (vector signed int, + vector signed int); +unsigned int vec_first_mismatch_index (vector unsigned int, + vector unsigned int); +unsigned int vec_first_mismatch_index (vector signed short, + vector signed short); +unsigned int vec_first_mismatch_index (vector unsigned short, + vector unsigned short); +unsigned int vec_first_mismatch_or_eos_index (vector signed char, + vector signed char); +unsigned int vec_first_mismatch_or_eos_index (vector unsigned char, + vector unsigned char); +unsigned int vec_first_mismatch_or_eos_index (vector signed int, + vector signed int); +unsigned int vec_first_mismatch_or_eos_index (vector unsigned int, + vector unsigned int); +unsigned int vec_first_mismatch_or_eos_index (vector signed short, + vector signed short); +unsigned int vec_first_mismatch_or_eos_index (vector unsigned short, + vector unsigned short); + +vector unsigned short vec_pack_to_short_fp32 (vector float, vector float); + +vector signed char vec_xl_be (signed long long, signed char *); +vector unsigned char vec_xl_be (signed long long, unsigned char *); +vector signed int vec_xl_be (signed long long, signed int *); +vector unsigned int vec_xl_be (signed long long, unsigned int *); +vector signed __int128 vec_xl_be (signed long long, signed __int128 *); +vector unsigned __int128 vec_xl_be (signed long long, unsigned __int128 *); +vector signed long long vec_xl_be (signed long long, signed long long *); +vector unsigned long long vec_xl_be (signed long long, unsigned long long *); +vector signed short vec_xl_be (signed long long, signed short *); +vector unsigned short vec_xl_be (signed long long, unsigned short *); +vector double vec_xl_be (signed long long, double *); +vector float vec_xl_be (signed long long, float *); + +vector signed char vec_xl_len (signed char *addr, size_t len); +vector unsigned char vec_xl_len (unsigned char *addr, size_t len); +vector signed int vec_xl_len (signed int *addr, size_t len); +vector unsigned int vec_xl_len (unsigned int *addr, size_t len); +vector signed __int128 vec_xl_len (signed __int128 *addr, size_t len); +vector unsigned __int128 vec_xl_len (unsigned __int128 *addr, size_t len); +vector signed long long vec_xl_len (signed long long *addr, size_t len); +vector unsigned long long vec_xl_len (unsigned long long *addr, size_t len); +vector signed short vec_xl_len (signed short *addr, size_t len); +vector unsigned short vec_xl_len (unsigned short *addr, size_t len); +vector double vec_xl_len (double *addr, size_t len); +vector float vec_xl_len (float *addr, size_t len); + +vector unsigned char vec_xl_len_r (unsigned char *addr, size_t len); + +void vec_xst_len (vector signed char data, signed char *addr, size_t len); +void vec_xst_len (vector unsigned char data, unsigned char *addr, size_t len); +void vec_xst_len (vector signed int data, signed int *addr, size_t len); +void vec_xst_len (vector unsigned int data, unsigned int *addr, size_t len); +void vec_xst_len (vector unsigned __int128 data, unsigned __int128 *addr, size_t len); +void vec_xst_len (vector signed long long data, signed long long *addr, size_t len); +void vec_xst_len (vector unsigned long long data, unsigned long long *addr, size_t len); +void vec_xst_len (vector signed short data, signed short *addr, size_t len); +void vec_xst_len (vector unsigned short data, unsigned short *addr, size_t len); +void vec_xst_len (vector signed __int128 data, signed __int128 *addr, size_t len); +void vec_xst_len (vector double data, double *addr, size_t len); +void vec_xst_len (vector float data, float *addr, size_t len); + +void vec_xst_len_r (vector unsigned char data, unsigned char *addr, size_t len); + +signed char vec_xlx (unsigned int index, vector signed char data); +unsigned char vec_xlx (unsigned int index, vector unsigned char data); +signed short vec_xlx (unsigned int index, vector signed short data); +unsigned short vec_xlx (unsigned int index, vector unsigned short data); +signed int vec_xlx (unsigned int index, vector signed int data); +unsigned int vec_xlx (unsigned int index, vector unsigned int data); +float vec_xlx (unsigned int index, vector float data); + +signed char vec_xrx (unsigned int index, vector signed char data); +unsigned char vec_xrx (unsigned int index, vector unsigned char data); +signed short vec_xrx (unsigned int index, vector signed short data); +unsigned short vec_xrx (unsigned int index, vector unsigned short data); +signed int vec_xrx (unsigned int index, vector signed int data); +unsigned int vec_xrx (unsigned int index, vector unsigned int data); +float vec_xrx (unsigned int index, vector float data); +@end smallexample + +The @code{vec_all_nez}, @code{vec_any_eqz}, and @code{vec_cmpnez} +perform pairwise comparisons between the elements at the same +positions within their two vector arguments. +The @code{vec_all_nez} function returns a +non-zero value if and only if all pairwise comparisons are not +equal and no element of either vector argument contains a zero. +The @code{vec_any_eqz} function returns a +non-zero value if and only if at least one pairwise comparison is equal +or if at least one element of either vector argument contains a zero. +The @code{vec_cmpnez} function returns a vector of the same type as +its two arguments, within which each element consists of all ones to +denote that either the corresponding elements of the incoming arguments are +not equal or that at least one of the corresponding elements contains +zero. Otherwise, the element of the returned vector contains all zeros. + +The @code{vec_cntlz_lsbb} function returns the count of the number of +consecutive leading byte elements (starting from position 0 within the +supplied vector argument) for which the least-significant bit +equals zero. The @code{vec_cnttz_lsbb} function returns the count of +the number of consecutive trailing byte elements (starting from +position 15 and counting backwards within the supplied vector +argument) for which the least-significant bit equals zero. + +The @code{vec_xl_len} and @code{vec_xst_len} functions require a +64-bit environment supporting ISA 3.0 or later. The @code{vec_xl_len} +function loads a variable length vector from memory. The +@code{vec_xst_len} function stores a variable length vector to memory. +With both the @code{vec_xl_len} and @code{vec_xst_len} functions, the +@code{addr} argument represents the memory address to or from which +data will be transferred, and the +@code{len} argument represents the number of bytes to be +transferred, as computed by the C expression @code{min((len & 0xff), 16)}. +If this expression's value is not a multiple of the vector element's +size, the behavior of this function is undefined. +In the case that the underlying computer is configured to run in +big-endian mode, the data transfer moves bytes 0 to @code{(len - 1)} of +the corresponding vector. In little-endian mode, the data transfer +moves bytes @code{(16 - len)} to @code{15} of the corresponding +vector. For the load function, any bytes of the result vector that +are not loaded from memory are set to zero. +The value of the @code{addr} argument need not be aligned on a +multiple of the vector's element size. + +The @code{vec_xlx} and @code{vec_xrx} functions extract the single +element selected by the @code{index} argument from the vector +represented by the @code{data} argument. The @code{index} argument +always specifies a byte offset, regardless of the size of the vector +element. With @code{vec_xlx}, @code{index} is the offset of the first +byte of the element to be extracted. With @code{vec_xrx}, @code{index} +represents the last byte of the element to be extracted, measured +from the right end of the vector. In other words, the last byte of +the element to be extracted is found at position @code{(15 - index)}. +There is no requirement that @code{index} be a multiple of the vector +element size. However, if the size of the vector element added to +@code{index} is greater than 15, the content of the returned value is +undefined. + If the ISA 3.0 instruction set additions (@option{-mcpu=power9}) are available: