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 <pc@us.ibm.com>
pull/69/head
Paul Clarke 4 years ago committed by Bill Schmidt
parent 8ca90e8fd6
commit a87ff8bd02

@ -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 };</programlisting> vector double g = (vector double) { 3.5, -24.6 };</programlisting>
<para> <para>
Current C compilers do not support literals for Current C compilers do not support literals for
<code>__int128</code> types. When constructing a <code>vector <code>__int128</code> types. A <code>vector __int128</code>
__int128</code> constant from smaller literals such as constant can be constructed from smaller literals
<code>int</code> or <code>long long</code>, you must test for with appropriate cast-shift-or logic. For example,
endianness and reverse the order of the smaller literals for <programlisting>
little-endian mode. vector unsigned __int128 x = { (((unsigned __int128)0x1020304050607080) &lt;&lt; 64) | 0x90A0B0C0D0E0F000 };
</programlisting>
</para> </para>
</section> </section>



Loading…
Cancel
Save