From b21a28797c23fc49a23fd48386f5932f0fb6d874 Mon Sep 17 00:00:00 2001 From: Ilia Mirkin Date: Thu, 17 Jul 2014 22:30:00 -0400 Subject: [PATCH] nv50/ir: keep track of whether the program uses fp64 Signed-off-by: Ilia Mirkin --- src/gallium/drivers/nouveau/codegen/nv50_ir_driver.h | 1 + src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_driver.h b/src/gallium/drivers/nouveau/codegen/nv50_ir_driver.h index dc74cded2bd..dba56bf2716 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_driver.h +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_driver.h @@ -183,6 +183,7 @@ struct nv50_ir_prog_info boolean sampleInterp; /* perform sample interp on all fp inputs */ uint8_t backFaceColor[2]; /* input/output indices of back face colour */ uint8_t globalAccess; /* 1 for read, 2 for wr, 3 for rw */ + boolean fp64; /* program uses fp64 math */ boolean nv50styleSurfaces; /* generate gX[] access for raw buffers */ uint8_t resInfoCBSlot; /* cX[] used for tex handles, surface info */ uint16_t texBindBase; /* base address for tex handles (nve4) */ diff --git a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp index 0397bdcad55..7992f539782 100644 --- a/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp +++ b/src/gallium/drivers/nouveau/codegen/nv50_ir_target.cpp @@ -379,9 +379,13 @@ Program::emitBinary(struct nv50_ir_prog_info *info) assert(emit->getCodeSize() == fn->binPos); - for (int b = 0; b < fn->bbCount; ++b) - for (Instruction *i = fn->bbArray[b]->getEntry(); i; i = i->next) + for (int b = 0; b < fn->bbCount; ++b) { + for (Instruction *i = fn->bbArray[b]->getEntry(); i; i = i->next) { emit->emitInstruction(i); + if (i->sType == TYPE_F64 || i->dType == TYPE_F64) + info->io.fp64 = true; + } + } } info->bin.relocData = emit->getRelocInfo(); -- 2.30.2