return cByte;
}
}
+static TypeClass getClassB(const Type *T) {
+ if (T == Type::BoolTy) return cByte;
+ return getClass(T);
+}
+
+
/// copyConstantToRegister - Output the instructions required to put the
/// specified constant into the specified register.
visitInstruction (I);
return;
}
- } else if (I.getNumOperands () != 1) {
- visitInstruction (I);
}
+
// Just emit a 'retl' instruction to return.
BuildMI(BB, V8::RETL, 0);
return;
unsigned Op0Reg = getReg (I.getOperand (0));
unsigned Op1Reg = getReg (I.getOperand (1));
- unsigned ResultReg = makeAnotherReg (I.getType ());
+ unsigned ResultReg = DestReg;
+ if (getClassB(I.getType()) != cInt)
+ ResultReg = makeAnotherReg (I.getType ());
unsigned OpCase = ~0;
// FIXME: support long, ulong, fp.
}
break;
case cInt:
- BuildMI (BB, V8::ORrr, 2, DestReg).addReg (V8::G0).addReg (ResultReg);
+ // Nothing todo here.
break;
default:
visitInstruction (I);
return cByte;
}
}
+static TypeClass getClassB(const Type *T) {
+ if (T == Type::BoolTy) return cByte;
+ return getClass(T);
+}
+
+
/// copyConstantToRegister - Output the instructions required to put the
/// specified constant into the specified register.
visitInstruction (I);
return;
}
- } else if (I.getNumOperands () != 1) {
- visitInstruction (I);
}
+
// Just emit a 'retl' instruction to return.
BuildMI(BB, V8::RETL, 0);
return;
unsigned Op0Reg = getReg (I.getOperand (0));
unsigned Op1Reg = getReg (I.getOperand (1));
- unsigned ResultReg = makeAnotherReg (I.getType ());
+ unsigned ResultReg = DestReg;
+ if (getClassB(I.getType()) != cInt)
+ ResultReg = makeAnotherReg (I.getType ());
unsigned OpCase = ~0;
// FIXME: support long, ulong, fp.
}
break;
case cInt:
- BuildMI (BB, V8::ORrr, 2, DestReg).addReg (V8::G0).addReg (ResultReg);
+ // Nothing todo here.
break;
default:
visitInstruction (I);
return cByte;
}
}
+static TypeClass getClassB(const Type *T) {
+ if (T == Type::BoolTy) return cByte;
+ return getClass(T);
+}
+
+
/// copyConstantToRegister - Output the instructions required to put the
/// specified constant into the specified register.
visitInstruction (I);
return;
}
- } else if (I.getNumOperands () != 1) {
- visitInstruction (I);
}
+
// Just emit a 'retl' instruction to return.
BuildMI(BB, V8::RETL, 0);
return;
unsigned Op0Reg = getReg (I.getOperand (0));
unsigned Op1Reg = getReg (I.getOperand (1));
- unsigned ResultReg = makeAnotherReg (I.getType ());
+ unsigned ResultReg = DestReg;
+ if (getClassB(I.getType()) != cInt)
+ ResultReg = makeAnotherReg (I.getType ());
unsigned OpCase = ~0;
// FIXME: support long, ulong, fp.
}
break;
case cInt:
- BuildMI (BB, V8::ORrr, 2, DestReg).addReg (V8::G0).addReg (ResultReg);
+ // Nothing todo here.
break;
default:
visitInstruction (I);
return cByte;
}
}
+static TypeClass getClassB(const Type *T) {
+ if (T == Type::BoolTy) return cByte;
+ return getClass(T);
+}
+
+
/// copyConstantToRegister - Output the instructions required to put the
/// specified constant into the specified register.
visitInstruction (I);
return;
}
- } else if (I.getNumOperands () != 1) {
- visitInstruction (I);
}
+
// Just emit a 'retl' instruction to return.
BuildMI(BB, V8::RETL, 0);
return;
unsigned Op0Reg = getReg (I.getOperand (0));
unsigned Op1Reg = getReg (I.getOperand (1));
- unsigned ResultReg = makeAnotherReg (I.getType ());
+ unsigned ResultReg = DestReg;
+ if (getClassB(I.getType()) != cInt)
+ ResultReg = makeAnotherReg (I.getType ());
unsigned OpCase = ~0;
// FIXME: support long, ulong, fp.
}
break;
case cInt:
- BuildMI (BB, V8::ORrr, 2, DestReg).addReg (V8::G0).addReg (ResultReg);
+ // Nothing todo here.
break;
default:
visitInstruction (I);