On Fri, Feb 6, 2015 at 3:02 AM, Ian Romanick <i...@freedesktop.org> wrote:
>> +   case ir_unop_pack_double_2x32: {
>> +      /* XXX needs to be checked on big-endian */
>
> I think this should just work.  The spec says that the 32-bit values are
> little-endian:
>
>     "The first vector component specifies the 32 least significant
>     bits; the second component specifies the 32 most significant bits."
>
> On a little-endian system, you have a memcpy, and on big-endian it will
> be a 32-bit word swap... which is correct... I think...
>
>
>> +      uint64_t temp;
>> +      temp = (uint64_t)op[0]->value.u[0] | ((uint64_t)op[0]->value.u[1] << 
>> 32);
>> +      data.d[0] = *(double *)&temp;
>> +
>> +      break;

Yeah. But what endianness are those 32 most/least significant bits?
With a big endian CPU and little endian GPU? I put the XXX's there so
that it's clear that the code is potentially questionable after Matt
suggested it should always just do memcpy (which I think definitely
won't work on BE).
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to