What is the point of the half2 datatype?

Some questions regarding the bizarre (to me) half2 datatype:

  • How much faster is arithmetic done on 1x half2 object vs. 2x half objects?
  • Why are the intrinsics for half2 so limited and strange? Just one example (of which there are several):

__hbeq2 - Performs half2 vector if-equal comparison and returns boolean true iff both half results are true, boolean false otherwise.

Why would I want a single boolean result from say, __hbeq2(a, b)? I want to know both results, that is, is

a.x != b.x
AND is
a.y != b.y

Also why is there not an intrinsic for checking if

a.x != a.y


Ultimately, my questions about this type are driven by my assumption that 1x half2 operation is faster than 2x half operation.


Yes, in some cases, a half2 result can be returned in the same time as a half result.

Well, in that case you could use __heq2

You could use __heq() for that.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.