mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
implement MULHU/MULHS for 64-bit multiplies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24797 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -278,6 +278,17 @@ SDOperand SparcV8DAGToDAGISel::Select(SDOperand Op) {
|
|||||||
|
|
||||||
switch (N->getOpcode()) {
|
switch (N->getOpcode()) {
|
||||||
default: break;
|
default: break;
|
||||||
|
case ISD::MULHU:
|
||||||
|
case ISD::MULHS: {
|
||||||
|
SDOperand MulLHS = Select(N->getOperand(0));
|
||||||
|
SDOperand MulRHS = Select(N->getOperand(1));
|
||||||
|
unsigned Opcode = N->getOpcode() == ISD::MULHU ? V8::UMULrr : V8::SMULrr;
|
||||||
|
SDOperand Mul = CurDAG->getTargetNode(Opcode, MVT::i32, MVT::Flag,
|
||||||
|
MulLHS, MulRHS);
|
||||||
|
// The high part is in the Y register.
|
||||||
|
return CurDAG->SelectNodeTo(N, V8::RDY, MVT::i32, Mul.getValue(1));
|
||||||
|
}
|
||||||
|
|
||||||
case ISD::RET: {
|
case ISD::RET: {
|
||||||
if (N->getNumOperands() == 2) {
|
if (N->getNumOperands() == 2) {
|
||||||
SDOperand Chain = Select(N->getOperand(0)); // Token chain.
|
SDOperand Chain = Select(N->getOperand(0)); // Token chain.
|
||||||
|
@ -278,6 +278,17 @@ SDOperand SparcV8DAGToDAGISel::Select(SDOperand Op) {
|
|||||||
|
|
||||||
switch (N->getOpcode()) {
|
switch (N->getOpcode()) {
|
||||||
default: break;
|
default: break;
|
||||||
|
case ISD::MULHU:
|
||||||
|
case ISD::MULHS: {
|
||||||
|
SDOperand MulLHS = Select(N->getOperand(0));
|
||||||
|
SDOperand MulRHS = Select(N->getOperand(1));
|
||||||
|
unsigned Opcode = N->getOpcode() == ISD::MULHU ? V8::UMULrr : V8::SMULrr;
|
||||||
|
SDOperand Mul = CurDAG->getTargetNode(Opcode, MVT::i32, MVT::Flag,
|
||||||
|
MulLHS, MulRHS);
|
||||||
|
// The high part is in the Y register.
|
||||||
|
return CurDAG->SelectNodeTo(N, V8::RDY, MVT::i32, Mul.getValue(1));
|
||||||
|
}
|
||||||
|
|
||||||
case ISD::RET: {
|
case ISD::RET: {
|
||||||
if (N->getNumOperands() == 2) {
|
if (N->getNumOperands() == 2) {
|
||||||
SDOperand Chain = Select(N->getOperand(0)); // Token chain.
|
SDOperand Chain = Select(N->getOperand(0)); // Token chain.
|
||||||
|
Reference in New Issue
Block a user