mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-04 21:30:49 +00:00
Support most cases of vaarg (except double).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18055 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
087f0858ef
commit
b95cbee930
@ -1401,5 +1401,32 @@ void V8ISel::visitVANextInst (VANextInst &I) {
|
||||
}
|
||||
|
||||
void V8ISel::visitVAArgInst (VAArgInst &I) {
|
||||
std::cerr << "Sorry, vaarg instruction still unsupported:\n" << I; abort ();
|
||||
unsigned VAList = getReg (I.getOperand (0));
|
||||
unsigned DestReg = getReg (I);
|
||||
|
||||
switch (I.getType ()->getTypeID ()) {
|
||||
case Type::PointerTyID:
|
||||
case Type::UIntTyID:
|
||||
case Type::IntTyID:
|
||||
BuildMI (BB, V8::LD, 2, DestReg).addReg (VAList).addSImm (0);
|
||||
return;
|
||||
|
||||
case Type::ULongTyID:
|
||||
case Type::LongTyID:
|
||||
BuildMI (BB, V8::LD, 2, DestReg).addReg (VAList).addSImm (0);
|
||||
BuildMI (BB, V8::LD, 2, DestReg+1).addReg (VAList).addSImm (4);
|
||||
return;
|
||||
|
||||
case Type::FloatTyID:
|
||||
BuildMI (BB, V8::LDFri, 2, DestReg).addReg (VAList).addSImm (0);
|
||||
return;
|
||||
|
||||
case Type::DoubleTyID:
|
||||
|
||||
default:
|
||||
std::cerr << "Sorry, vaarg instruction of this type still unsupported:\n"
|
||||
<< I;
|
||||
abort ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -1401,5 +1401,32 @@ void V8ISel::visitVANextInst (VANextInst &I) {
|
||||
}
|
||||
|
||||
void V8ISel::visitVAArgInst (VAArgInst &I) {
|
||||
std::cerr << "Sorry, vaarg instruction still unsupported:\n" << I; abort ();
|
||||
unsigned VAList = getReg (I.getOperand (0));
|
||||
unsigned DestReg = getReg (I);
|
||||
|
||||
switch (I.getType ()->getTypeID ()) {
|
||||
case Type::PointerTyID:
|
||||
case Type::UIntTyID:
|
||||
case Type::IntTyID:
|
||||
BuildMI (BB, V8::LD, 2, DestReg).addReg (VAList).addSImm (0);
|
||||
return;
|
||||
|
||||
case Type::ULongTyID:
|
||||
case Type::LongTyID:
|
||||
BuildMI (BB, V8::LD, 2, DestReg).addReg (VAList).addSImm (0);
|
||||
BuildMI (BB, V8::LD, 2, DestReg+1).addReg (VAList).addSImm (4);
|
||||
return;
|
||||
|
||||
case Type::FloatTyID:
|
||||
BuildMI (BB, V8::LDFri, 2, DestReg).addReg (VAList).addSImm (0);
|
||||
return;
|
||||
|
||||
case Type::DoubleTyID:
|
||||
|
||||
default:
|
||||
std::cerr << "Sorry, vaarg instruction of this type still unsupported:\n"
|
||||
<< I;
|
||||
abort ();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user