summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nvc0/codegen
diff options
context:
space:
mode:
authorChristoph Bumiller <[email protected]>2013-02-22 19:10:20 +0100
committerChristoph Bumiller <[email protected]>2013-03-12 12:55:34 +0100
commitefe55075b505e9d96ccde12f789ec8991273aef4 (patch)
tree42148d7fb2bbcfc947bd70465d837d23530a1eae /src/gallium/drivers/nvc0/codegen
parentce7610f7d5473d5084bc0884723ce0ace5f99ed7 (diff)
nvc0/ir/emit: implement move to and logic ops on predicates
Diffstat (limited to 'src/gallium/drivers/nvc0/codegen')
-rw-r--r--src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
index b8e68eb8c18..dc1fe99bde6 100644
--- a/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
+++ b/src/gallium/drivers/nvc0/codegen/nv50_ir_emit_nvc0.cpp
@@ -676,6 +676,32 @@ CodeEmitterNVC0::emitNOT(Instruction *i)
void
CodeEmitterNVC0::emitLogicOp(const Instruction *i, uint8_t subOp)
{
+ if (i->def(0).getFile() == FILE_PREDICATE) {
+ code[0] = 0x00000004 | (subOp << 30);
+ code[1] = 0x0c000000;
+
+ emitPredicate(i);
+
+ defId(i->def(0), 17);
+ srcId(i->src(0), 20);
+ if (i->src(0).mod == Modifier(NV50_IR_MOD_NOT)) code[0] |= 1 << 23;
+ srcId(i->src(1), 26);
+ if (i->src(1).mod == Modifier(NV50_IR_MOD_NOT)) code[0] |= 1 << 29;
+
+ if (i->defExists(1)) {
+ defId(i->def(1), 14);
+ } else {
+ code[0] |= 7 << 14;
+ }
+ // (a OP b) OP c
+ if (i->predSrc != 2 && i->srcExists(2)) {
+ code[1] |= subOp << 21;
+ srcId(i->src(2), 17);
+ if (i->src(2).mod == Modifier(NV50_IR_MOD_NOT)) code[0] |= 1 << 20;
+ } else {
+ code[1] |= 0x000e0000;
+ }
+ } else
if (i->encSize == 8) {
if (isLIMM(i->src(1), TYPE_U32)) {
emitForm_A(i, HEX64(38000000, 00000002));
@@ -1525,6 +1551,25 @@ CodeEmitterNVC0::getSRegEncoding(const ValueRef& ref)
void
CodeEmitterNVC0::emitMOV(const Instruction *i)
{
+ if (i->def(0).getFile() == FILE_PREDICATE) {
+ if (i->src(0).getFile() == FILE_GPR) {
+ code[0] = 0xfc01c003;
+ code[1] = 0x1a8e0000;
+ srcId(i->src(0), 20);
+ } else {
+ code[0] = 0x0001c004;
+ code[1] = 0x0c0e0000;
+ if (i->src(0).getFile() == FILE_IMMEDIATE) {
+ code[0] |= 7 << 20;
+ if (!i->getSrc(0)->reg.data.u32)
+ code[0] |= 1 << 23;
+ } else {
+ srcId(i->src(0), 20);
+ }
+ }
+ defId(i->def(0), 17);
+ emitPredicate(i);
+ } else
if (i->src(0).getFile() == FILE_SYSTEM_VALUE) {
uint8_t sr = getSRegEncoding(i->src(0));