void ValueDef::replace(const ValueRef &repVal, bool doSet) { assert(mayReplace(repVal)); if (value == repVal.get()) return; while (!value->uses.empty()) { ValueRef *ref = *value->uses.begin(); ref->set(repVal.get()); ref->mod *= repVal.mod; } if (doSet) set(repVal.get()); }
void ValueRef::set(const ValueRef &ref) { this->set(ref.get()); mod = ref.mod; indirect[0] = ref.indirect[0]; indirect[1] = ref.indirect[1]; }
void CodeEmitterNVC0::setAddress16(const ValueRef& src) { Symbol *sym = src.get()->asSym(); assert(sym); code[0] |= (sym->reg.data.offset & 0x003f) << 26; code[1] |= (sym->reg.data.offset & 0xffc0) >> 6; }
void Instruction::setSrc(int s, const ValueRef& ref) { setSrc(s, ref.get()); srcs[s].mod = ref.mod; }
bool CodeEmitterNVC0::isLIMM(const ValueRef& ref, DataType ty) { const ImmediateValue *imm = ref.get()->asImm(); return imm && (imm->reg.data.u32 & ((ty == TYPE_F32) ? 0xfff : 0xfff00000)); }