gpulib: Add proper support for big-endian