[Beignet] [PATCH 6/7] replace mad with llvm intrinsic.
Song, Ruiling
ruiling.song at intel.com
Tue Mar 10 18:55:28 PDT 2015
> -----Original Message-----
> From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of
> Matt Turner
> Sent: Wednesday, March 11, 2015 1:49 AM
> To: Luo, Xionghu
> Cc: beignet at lists.freedesktop.org
> Subject: Re: [Beignet] [PATCH 6/7] replace mad with llvm intrinsic.
>
> On Mon, Mar 9, 2015 at 10:59 PM, <xionghu.luo at intel.com> wrote:
> > From: Luo Xionghu <xionghu.luo at intel.com>
> >
> > translate native mad to llvm.fma.
>
> I'm not sure that it matters for this patch, but do we know if Gen's MAD
> instruction is a fused-multiply-add? That is, does it not do an intermediate
> rounding step after the multiply?
I also have such kind of concern, so I did a simple test:
on cpu side, I use "reference = (double)x1*(double)x2 + (double)x3;"
And on gpu side, I use "result = mad(x1, x2, x3);"
Then compare the result and reference, the bits are exactly the same, so I think gen's MAD does not do intermediate rounding after multiply.
We can use Gen's MAD as fma:)
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list