From 0f417d5c80aeb97982f0430f49cbc3cf4bab633e Mon Sep 17 00:00:00 2001 From: Momchil Velikov Date: Thu, 19 Oct 2023 11:37:58 +0100 Subject: [PATCH] Describe reinterpret intrinsics for vector and vector tuple types --- main/acle.md | 46 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/main/acle.md b/main/acle.md index de433c98..b5a50a61 100644 --- a/main/acle.md +++ b/main/acle.md @@ -359,6 +359,7 @@ Armv8.4-A [[ARMARMv84]](#ARMARMv84). Support is added for the Dot Product intrin * Changed the [SME language extensions](#sme-language-extensions-and-intrinsics) to use keyword attributes instead of GNU-style attributes. * Added missing word to Function Multi Versioning's [Name mangling](#name-mangling). +* Added description of SVE reinterpret intrinsics. ### References @@ -5927,18 +5928,6 @@ definition of `bfloat16_t` (see [Scalar types defined by ``](#scalar-types-defined-by-arm_sve.h)). The other types are available unconditionally. -ACLE provides two sets of intrinsics for converting between vector types: - -* The [`svreinterpret`](https://developer.arm.com/architectures/instruction-sets/intrinsics/#q=svreinterpret) - intrinsics simply reinterpret a vector of one type as a vector of another - type, without changing any of the bits. - -* The [`svcvt`](https://developer.arm.com/architectures/instruction-sets/intrinsics/#q=svcvt_) - intrinsics instead perform numerical conversion from one type to another, - such as converting integers to floating-point values. - -To avoid any ambiguity between the two operations, ACLE does not allow -C-style casting from one vector type to another. [``](#arm_sve.h) also defines tuples of two, three, and four vectors, as follows: @@ -5998,6 +5987,19 @@ vectors using [`svundef`](https://developer.arm.com/architectures/instruction-se [`svundef3`](https://developer.arm.com/architectures/instruction-sets/intrinsics/#q=svundef3) and [`svundef4`](https://developer.arm.com/architectures/instruction-sets/intrinsics/#q=svundef4). +ACLE provides two sets of intrinsics for converting between vector types and vector tuple types: + +* The [`svreinterpret`](#sve-reinterpret-intrinsics) intrinsics simply + reinterpret a vector (or vector tuple) of one type as a vector (or + vector tuple) of another type, without changing any of the bits. + +* The [`svcvt`](https://developer.arm.com/architectures/instruction-sets/intrinsics/#q=svcvt_) + intrinsics instead perform numerical conversion from one type to another, + such as converting integers to floating-point values. + +To avoid any ambiguity between the two operations, ACLE does not allow +C-style casting from one vector type to another. + ### SVE predicate types [``](#arm_sve.h) defines a single sizeless predicate type @@ -7156,6 +7158,26 @@ Assuming `float64_t` data, the C version of the code above would be: p3 = svrdffr(); ``` +### SVE reinterpret intrinsics + +The `svreinterpret` intrinsics for vector types and vector tuple types take the form + +``` c +svreinterpret_type0[_type1][_xN] +``` + +where `N` refers to the number of elements in a tuple type. + +For example: +``` c +svuin16_t svreinterpret_u16_s32(svint32_t op); +svuin16_t svreinterpret_u16(svint32_t op); +svuin16x2_t svreinterpret_u16_s32_x2(svint32x2_t op); +svuin16x2_t svreinterpret_u16(svint32x2_t op); +``` + +A list of SVE reinterpret intrinsics can be found on [developer.arm.com](https://developer.arm.com/architectures/instruction-sets/intrinsics/#q=svreinterpret). + ### List of SVE intrinsics The full list of SVE intrinsics can be found on