From a87ff8bd02a7aee3e6c87fc7b4fb1e53cc61bb4d Mon Sep 17 00:00:00 2001 From: "Paul A. Clarke" Date: Mon, 11 May 2020 12:06:25 -0500 Subject: [PATCH] Add example initializer for vector __int128 Since there isn't a straightforward way of initializing `__int128` type variables, provide an example for initializing `vector __int128` here. Fixes #10. Signed-off-by: Paul A. Clarke --- Intrinsics_Reference/ch_biendian.xml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Intrinsics_Reference/ch_biendian.xml b/Intrinsics_Reference/ch_biendian.xml index b18f13f..ac088a9 100644 --- a/Intrinsics_Reference/ch_biendian.xml +++ b/Intrinsics_Reference/ch_biendian.xml @@ -122,11 +122,12 @@ xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="VIPR.biendian"> vector double g = (vector double) { 3.5, -24.6 }; Current C compilers do not support literals for - __int128 types. When constructing a vector - __int128 constant from smaller literals such as - int or long long, you must test for - endianness and reverse the order of the smaller literals for - little-endian mode. + __int128 types. A vector __int128 + constant can be constructed from smaller literals + with appropriate cast-shift-or logic. For example, + +vector unsigned __int128 x = { (((unsigned __int128)0x1020304050607080) << 64) | 0x90A0B0C0D0E0F000 }; +