use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class Form51l method writeTo.
/** {@inheritDoc} */
@Override
public void writeTo(AnnotatedOutput out, DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
long value = ((CstLiteral64) ((CstInsn) insn).getConstant()).getLongBits();
write(out, opcodeUnit(insn, regs.get(0).getReg()), value);
}
use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class Form51l method insnArgString.
/** {@inheritDoc} */
@Override
public String insnArgString(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
CstLiteralBits value = (CstLiteralBits) ((CstInsn) insn).getConstant();
return regs.get(0).regString() + ", " + literalBitsString(value);
}
use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class HighRegisterPrefix method listingString0.
/** {@inheritDoc} */
@Override
protected String listingString0(boolean noteIndices) {
RegisterSpecList registers = getRegisters();
int sz = registers.size();
StringBuffer sb = new StringBuffer(100);
for (int i = 0, outAt = 0; i < sz; i++) {
RegisterSpec src = registers.get(i);
SimpleInsn insn = moveInsnFor(src, outAt);
if (i != 0) {
sb.append('\n');
}
sb.append(insn.listingString0(noteIndices));
outAt += src.getCategory();
}
return sb.toString();
}
use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class OutputFinisher method align64bits.
private void align64bits(Dop[] opcodes) {
while (true) {
int notAligned64bitRegAccess = 0;
int aligned64bitRegAccess = 0;
int notAligned64bitParamAccess = 0;
int aligned64bitParamAccess = 0;
int lastParameter = unreservedRegCount + reservedCount + reservedParameterCount;
int firstParameter = lastParameter - paramSize;
// Collects the number of time that 64-bit registers are accessed aligned or not.
for (DalvInsn insn : insns) {
RegisterSpecList regs = insn.getRegisters();
for (int usedRegIdx = 0; usedRegIdx < regs.size(); usedRegIdx++) {
RegisterSpec reg = regs.get(usedRegIdx);
if (reg.isCategory2()) {
boolean isParameter = reg.getReg() >= firstParameter;
if (reg.isEvenRegister()) {
if (isParameter) {
aligned64bitParamAccess++;
} else {
aligned64bitRegAccess++;
}
} else {
if (isParameter) {
notAligned64bitParamAccess++;
} else {
notAligned64bitRegAccess++;
}
}
}
}
}
if (notAligned64bitParamAccess > aligned64bitParamAccess && notAligned64bitRegAccess > aligned64bitRegAccess) {
addReservedRegisters(1);
} else if (notAligned64bitParamAccess > aligned64bitParamAccess) {
addReservedParameters(1);
} else if (notAligned64bitRegAccess > aligned64bitRegAccess) {
addReservedRegisters(1);
// so the number of aligned become the number of unaligned.
if (paramSize != 0 && aligned64bitParamAccess > notAligned64bitParamAccess) {
addReservedParameters(1);
}
} else {
break;
}
if (!reserveRegisters(opcodes)) {
break;
}
}
}
use of com.android.dx.rop.code.RegisterSpecList in project buck by facebook.
the class Form11x method compatibleRegs.
/** {@inheritDoc} */
@Override
public BitSet compatibleRegs(DalvInsn insn) {
RegisterSpecList regs = insn.getRegisters();
BitSet bits = new BitSet(1);
bits.set(0, unsignedFitsInByte(regs.get(0).getReg()));
return bits;
}
Aggregations