Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
munroesj52 opened this issue Aug 5, 2023 · 0 comments

Comments

@munroesj52
Copy link
Contributor

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.

@munroesj52 munroesj52 changed the title How does one use the quad-precision predicate inatructions add in ISA 3.1 How does one use the quad-precision predicate instructions add in ISA 3.1 Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant