nvc0/ir: fix emission of cvt when register and type size differ
authorChristoph Bumiller <e0425955@student.tuwien.ac.at>
Thu, 6 Oct 2011 12:32:58 +0000 (14:32 +0200)
committerChristoph Bumiller <e0425955@student.tuwien.ac.at>
Fri, 21 Oct 2011 21:00:38 +0000 (23:00 +0200)
src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp

index bf597538bb3604d908d4d51316f88ca93f77a0c1..6bcbd62560067293afda8dab0d7d9409e3cf825e 100644 (file)
@@ -785,8 +785,9 @@ CodeEmitterNVC0::emitCVT(Instruction *i)
 
       roundMode_C(i);
 
-      code[0] |= util_logbase2(i->def[0].getSize()) << 20;
-      code[0] |= util_logbase2(i->src[0].getSize()) << 23;
+      // cvt u16 f32 sets high bits to 0, so we don't have to use Value::Size()
+      code[0] |= util_logbase2(typeSizeof(i->dType)) << 20;
+      code[0] |= util_logbase2(typeSizeof(i->sType)) << 23;
 
       if (sat)
          code[0] |= 0x20;