Skip to content

How does one use the quad-precision predicate instructions add in ISA 3.1 #182

Description

@munroesj52

For example:
static inline vb128_t
vec_cmpeqtoqp (__binary128 vfa, __binary128 vfb)
{
vb128_t result;
#if defined (_ARCH_PWR10) && defined (FLOAT128) && (GNUC >= 10)
asm(
"xscmpeqqp %0,%1,%2;\n"
: "=v" (result)
: "v" (vfa), "v" (vfb)
: );
#elif defined (_ARCH_PWR9) && defined (FLOAT128) && (GNUC > 7)
result= (vb128_t) vec_splat_u32 (0);
if (vfa == vfb)
result= (vb128_t) vec_splat_s32 (-1);
#else // defined( _ARCH_PWR8 )
vui128_t vra, vrb;
vra = vec_xfer_bin128_2_vui128t (vfa);
vrb = vec_xfer_bin128_2_vui128t (vfb);
result = vec_cmpequq ( vra, vrb );
#endif
return result;
}

ISA 3.0 add the ordered and unordered QP compare instructions that set CC.
But this requires the awkward:
if (vfa == vfb)
result= (vb128_t) vec_splat_s32 (-1);

ISA 3.1 provided the predicate compares xscmpeqqp, xscmpgeqp, xscmpgtqp that return the 128-bit bool.

But I can not figure out how to get at this from asm!?

vec_cmpeg etc will not accept the scalar _ieee128. Nor is there a scalar built-in for predicate compare?

So how do you issue select logic with QP? Again vec_sel will not accept scalar _ieee128!?

There is no fsel built-in that will take scalar _ieee128!?

This whole vector vs scalar thing is getting weird.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions