mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-07 12:28:24 +00:00
Get alpha working with memset/memcpy/memmove
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19878 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -706,11 +706,35 @@ SDOperand SelectionDAGLegalize::LegalizeOp(SDOperand Op) {
|
|||||||
case ISD::MEMSET:
|
case ISD::MEMSET:
|
||||||
case ISD::MEMCPY:
|
case ISD::MEMCPY:
|
||||||
case ISD::MEMMOVE: {
|
case ISD::MEMMOVE: {
|
||||||
Tmp1 = LegalizeOp(Node->getOperand(0));
|
Tmp1 = LegalizeOp(Node->getOperand(0)); // Function
|
||||||
Tmp2 = LegalizeOp(Node->getOperand(1));
|
Tmp2 = LegalizeOp(Node->getOperand(1)); // Pointer
|
||||||
Tmp3 = LegalizeOp(Node->getOperand(2));
|
|
||||||
SDOperand Tmp4 = LegalizeOp(Node->getOperand(3));
|
if (Node->getOpcode() == ISD::MEMSET) { // memset = ubyte
|
||||||
SDOperand Tmp5 = LegalizeOp(Node->getOperand(4));
|
switch (getTypeAction(Node->getOperand(2).getValueType())) {
|
||||||
|
case Expand: assert(0 && "Cannot expand a byte!");
|
||||||
|
case Legal:
|
||||||
|
Tmp3 = LegalizeOp(Node->getOperand(1));
|
||||||
|
break;
|
||||||
|
case Promote:
|
||||||
|
Tmp3 = PromoteOp(Node->getOperand(1));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Tmp3 = LegalizeOp(Node->getOperand(2)); // memcpy/move = pointer,
|
||||||
|
}
|
||||||
|
SDOperand Tmp4, Tmp5;
|
||||||
|
|
||||||
|
switch (getTypeAction(Node->getOperand(3).getValueType())) { // uint
|
||||||
|
case Expand: assert(0 && "Cannot expand this yet!");
|
||||||
|
case Legal:
|
||||||
|
Tmp4 = LegalizeOp(Node->getOperand(3));
|
||||||
|
Tmp5 = LegalizeOp(Node->getOperand(4));
|
||||||
|
break;
|
||||||
|
case Promote:
|
||||||
|
Tmp4 = PromoteOp(Node->getOperand(3));
|
||||||
|
Tmp5 = PromoteOp(Node->getOperand(4));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
switch (TLI.getOperationAction(Node->getOpcode(), MVT::Other)) {
|
switch (TLI.getOperationAction(Node->getOpcode(), MVT::Other)) {
|
||||||
default: assert(0 && "This action not implemented for this operation!");
|
default: assert(0 && "This action not implemented for this operation!");
|
||||||
|
Reference in New Issue
Block a user