mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-15 09:33:39 +00:00
Added bytecode support for the extractelement operation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25178 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
9c62b5630c
commit
fee31b3610
@ -717,6 +717,13 @@ void BytecodeReader::ParseInstruction(std::vector<unsigned> &Oprnds,
|
|||||||
Result = new VAArgInst(foo, getSanitizedType(Oprnds[1]));
|
Result = new VAArgInst(foo, getSanitizedType(Oprnds[1]));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case Instruction::ExtractElement: {
|
||||||
|
if (Oprnds.size() != 2)
|
||||||
|
throw std::string("Invalid extractelement instruction!");
|
||||||
|
Result = new ExtractElementInst(getValue(iType, Oprnds[0]),
|
||||||
|
getValue(Type::UIntTyID, Oprnds[1]));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case Instruction::Cast:
|
case Instruction::Cast:
|
||||||
Result = new CastInst(getValue(iType, Oprnds[0]),
|
Result = new CastInst(getValue(iType, Oprnds[0]),
|
||||||
getSanitizedType(Oprnds[1]));
|
getSanitizedType(Oprnds[1]));
|
||||||
@ -1441,6 +1448,12 @@ Constant *BytecodeReader::ParseConstantValue(unsigned TypeID) {
|
|||||||
ArgVec[2]);
|
ArgVec[2]);
|
||||||
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
|
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
|
||||||
return Result;
|
return Result;
|
||||||
|
} else if (Opcode == Instruction::ExtractElement) {
|
||||||
|
if (ArgVec.size() != 2)
|
||||||
|
error("ExtractElement instruction must have two arguments.");
|
||||||
|
Constant* Result = ConstantExpr::getExtractElement(ArgVec[0], ArgVec[1]);
|
||||||
|
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
|
||||||
|
return Result;
|
||||||
} else { // All other 2-operand expressions
|
} else { // All other 2-operand expressions
|
||||||
Constant* Result = ConstantExpr::get(Opcode, ArgVec[0], ArgVec[1]);
|
Constant* Result = ConstantExpr::get(Opcode, ArgVec[0], ArgVec[1]);
|
||||||
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
|
if (Handler) Handler->handleConstantExpression(Opcode, ArgVec, Result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user