On Mon, Mar 28, 2016 at 11:31 AM, Ian Romanick <i...@freedesktop.org> wrote:
> On 03/23/2016 08:09 PM, Jason Ekstrand wrote: > > Is there a 64-bit pow in GLSL? If so, this is the right implementation. > > There isn't. But there also aren't double versions of sin or cos, and > 9076c4e2 added those. However, it didn't add double versions of fexp2 > or flog2 (both of which are not supported in GLSL). > > Ugh... it also did not add double versions of frsq or fsqrt... which are > supported in GLSL. > > So, there are some extra functions and some missing functions. My gut > tells me we should just do all of them so that people don't have to > think about which ones should / shouldn't be implemented. > That seems reasonable. Either that or flag those opcodes as only supporting 32-bit types for now. I think I'd rather just implement them if it's not too much work. You know someone's going to write a an fp64_pow extension some day... > Looking more closely... I think fabs, fnot, fsign, and fsat should have > explicit double support as well... it seems the existing implementations > of both of these will cause some small values to be incorrectly > "flushed" to zero. What are the rules in C when you compare a double > variable with a single constant? > > void foo(double d) > { > /* Does d get converted to single, or does 0.0f get converted to > * double? > */ > if (d == 0.0f) > printf("zero\n"); > } > > > Reviewed-by: Jason Ekstrand <ja...@jlekstrand.net > > <mailto:ja...@jlekstrand.net>> > > > > On Mar 23, 2016 7:42 PM, "Ian Romanick" <i...@freedesktop.org > > <mailto:i...@freedesktop.org>> wrote: > > > > From: Ian Romanick <ian.d.roman...@intel.com > > <mailto:ian.d.roman...@intel.com>> > > > > Found (randomly) by inspection. Looking at the rest of the changes > in > > this file in commit 9076c4e2, I'm certain this is what was intended. > > > > Signed-off-by: Ian Romanick <ian.d.roman...@intel.com > > <mailto:ian.d.roman...@intel.com>> > > Cc: Connor Abbott <cwabbo...@gmail.com <mailto:cwabbo...@gmail.com>> > > Cc: mesa-sta...@lists.freedesktop.org > > <mailto:mesa-sta...@lists.freedesktop.org> > > --- > > src/compiler/nir/nir_opcodes.py | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/src/compiler/nir/nir_opcodes.py > > b/src/compiler/nir/nir_opcodes.py > > index 553f924..ac59130 100644 > > --- a/src/compiler/nir/nir_opcodes.py > > +++ b/src/compiler/nir/nir_opcodes.py > > @@ -520,7 +520,7 @@ for (int i = 0; i < 32; i += 8) { > > } > > """) > > > > -binop("fpow", tfloat, "", "bit_size == 64 ? powf(src0, src1) : > > pow(src0, src1)") > > +binop("fpow", tfloat, "", "bit_size == 64 ? pow(src0, src1) : > > powf(src0, src1)") > > > > binop_horiz("pack_half_2x16_split", 1, tuint32, 1, tfloat32, 1, > > tfloat32, > > "pack_half_1x16(src0.x) | (pack_half_1x16(src1.x) << > 16)") > > -- > > 2.5.5 > > > > _______________________________________________ > > mesa-dev mailing list > > mesa-dev@lists.freedesktop.org <mailto: > mesa-dev@lists.freedesktop.org> > > https://lists.freedesktop.org/mailman/listinfo/mesa-dev > >
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev