[Mesa-dev] [PATCH] nv50,nvc0: Fix invalid constant.

Pierre Moreau pierre.morrow at free.fr
Sat Mar 19 12:44:34 UTC 2016


On 06:34 PM - Mar 18 2016, Vinson Lee wrote:
> Fix clang build error.
> 
>   CXX      codegen/nv50_ir_lowering_nvc0.lo
> codegen/nv50_ir_lowering_nvc0.cpp:1783:42: error: invalid suffix 'd' on floating constant
>       Value *zero = bld.loadImm(NULL, 0.0d);
>                                          ^
> 
> Fixes: c1e4a6bfbf01 ("nv50,nvc0: handle SQRT lowering inside the driver")
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> index d0936d8..01364b3 100644
> --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_lowering_nvc0.cpp
> @@ -1780,7 +1780,7 @@ NVC0LoweringPass::handleSQRT(Instruction *i)
>  {
>     if (i->dType == TYPE_F64) {
>        Value *pred = bld.getSSA(1, FILE_PREDICATE);
> -      Value *zero = bld.loadImm(NULL, 0.0d);
> +      Value *zero = bld.loadImm(NULL, 0);

Shouldn't it rather be: `Value *zero = bld.loadImm(NULL, 0.0);` as you want a
double, not an int?

>        Value *dst = bld.getSSA(8);
>        bld.mkOp1(OP_RSQ, i->dType, dst, i->getSrc(0));
>        bld.mkCmp(OP_SET, CC_LE, i->dType, pred, i->dType, i->getSrc(0), zero);
> -- 
> 2.7.3
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160319/999bc0ba/attachment.sig>


More information about the mesa-dev mailing list