From 06914fd8253b8d13818a284c0abd9f2a081d856c 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 Change-Id: Iba0e37d8b12debe34edae3bb8350bb1ef80a616a --- main/acle.md | 65 ++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 53 insertions(+), 12 deletions(-) diff --git a/main/acle.md b/main/acle.md index de433c98..b5033fd9 100644 --- a/main/acle.md +++ b/main/acle.md @@ -5927,18 +5927,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 +5986,59 @@ 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: + +* 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. + +The `svreinterpret` intrinsics for vector types take the form + +``` +sv_t svreinterpret__(sv_t op); +``` + +where `` denotes the source type and `` denotes the destination type, +across all pairs choosen from `{s8, u8, s16, u16, s32, u32, s64, u64, bf16, f16, f32, f64}` + +A shorter, overloaded form is also available in which the destintion type is spelled explicitly +and the source type is deduced from the argument: + +``` +sv_t svreinterpret_(sv_t op); +``` + +The `svreinterpret` intrinsics for vector tuple types take the form + +``` +svx_t svreinterpret___x(svx_t op) +``` + +where and is as for above for vector type and `` denotes the number of tuple +element, 2 or 4. + +A shorter, overloaded form is also available in which the destintion type is spelled explicitly +and the source type is deduced from the argument: + +``` +svx_t svreinterpret_(svx_t op) +``` + +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); +``` + ### SVE predicate types [``](#arm_sve.h) defines a single sizeless predicate type