mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-21 03:32:21 +00:00
Revert the patch that adds Function* for each 64-bit libc div/mul/rem that we
want to do; instead, we can use MachineInstr::addExternalSymbol(char*, bool) and thus we don't have to modify the Module as we are code generating for it git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18025 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
def5745314
commit
1dc555c0d3
@ -36,10 +36,6 @@ namespace {
|
|||||||
MachineBasicBlock *BB; // The current MBB we are compiling
|
MachineBasicBlock *BB; // The current MBB we are compiling
|
||||||
int VarArgsOffset; // Offset from fp for start of varargs area
|
int VarArgsOffset; // Offset from fp for start of varargs area
|
||||||
|
|
||||||
// External functions we may use in compiling the Module
|
|
||||||
Function *__div64Fn, *__mul64Fn, *__rem64Fn,
|
|
||||||
*__udiv64Fn, *__umul64Fn, *__urem64Fn;
|
|
||||||
|
|
||||||
std::map<Value*, unsigned> RegMap; // Mapping between Val's and SSA Regs
|
std::map<Value*, unsigned> RegMap; // Mapping between Val's and SSA Regs
|
||||||
|
|
||||||
// MBBMap - Mapping between LLVM BB -> Machine BB
|
// MBBMap - Mapping between LLVM BB -> Machine BB
|
||||||
@ -47,25 +43,6 @@ namespace {
|
|||||||
|
|
||||||
V8ISel(TargetMachine &tm) : TM(tm), F(0), BB(0) {}
|
V8ISel(TargetMachine &tm) : TM(tm), F(0), BB(0) {}
|
||||||
|
|
||||||
bool doInitialization(Module &M) {
|
|
||||||
// Add external functions that we may call
|
|
||||||
Type *l = Type::LongTy;
|
|
||||||
Type *ul = Type::ULongTy;
|
|
||||||
// long __div64(long, long);
|
|
||||||
__div64Fn = M.getOrInsertFunction("__div64", l, l, l, 0);
|
|
||||||
// long __div64(long, long);
|
|
||||||
__mul64Fn = M.getOrInsertFunction("__mul64", l, l, l, 0);
|
|
||||||
// long __div64(long, long);
|
|
||||||
__rem64Fn = M.getOrInsertFunction("__rem64", l, l, l, 0);
|
|
||||||
// unsigned long __udiv64(unsigned long, unsigned long);
|
|
||||||
__udiv64Fn = M.getOrInsertFunction("__udiv64", ul, ul, ul, 0);
|
|
||||||
// unsigned long __umul64(unsigned long, unsigned long);
|
|
||||||
__umul64Fn = M.getOrInsertFunction("__umul64", ul, ul, ul, 0);
|
|
||||||
// unsigned long __urem64(unsigned long, unsigned long);
|
|
||||||
__urem64Fn = M.getOrInsertFunction("__urem64", ul, ul, ul, 0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// runOnFunction - Top level implementation of instruction selection for
|
/// runOnFunction - Top level implementation of instruction selection for
|
||||||
/// the entire function.
|
/// the entire function.
|
||||||
///
|
///
|
||||||
|
@ -36,10 +36,6 @@ namespace {
|
|||||||
MachineBasicBlock *BB; // The current MBB we are compiling
|
MachineBasicBlock *BB; // The current MBB we are compiling
|
||||||
int VarArgsOffset; // Offset from fp for start of varargs area
|
int VarArgsOffset; // Offset from fp for start of varargs area
|
||||||
|
|
||||||
// External functions we may use in compiling the Module
|
|
||||||
Function *__div64Fn, *__mul64Fn, *__rem64Fn,
|
|
||||||
*__udiv64Fn, *__umul64Fn, *__urem64Fn;
|
|
||||||
|
|
||||||
std::map<Value*, unsigned> RegMap; // Mapping between Val's and SSA Regs
|
std::map<Value*, unsigned> RegMap; // Mapping between Val's and SSA Regs
|
||||||
|
|
||||||
// MBBMap - Mapping between LLVM BB -> Machine BB
|
// MBBMap - Mapping between LLVM BB -> Machine BB
|
||||||
@ -47,25 +43,6 @@ namespace {
|
|||||||
|
|
||||||
V8ISel(TargetMachine &tm) : TM(tm), F(0), BB(0) {}
|
V8ISel(TargetMachine &tm) : TM(tm), F(0), BB(0) {}
|
||||||
|
|
||||||
bool doInitialization(Module &M) {
|
|
||||||
// Add external functions that we may call
|
|
||||||
Type *l = Type::LongTy;
|
|
||||||
Type *ul = Type::ULongTy;
|
|
||||||
// long __div64(long, long);
|
|
||||||
__div64Fn = M.getOrInsertFunction("__div64", l, l, l, 0);
|
|
||||||
// long __div64(long, long);
|
|
||||||
__mul64Fn = M.getOrInsertFunction("__mul64", l, l, l, 0);
|
|
||||||
// long __div64(long, long);
|
|
||||||
__rem64Fn = M.getOrInsertFunction("__rem64", l, l, l, 0);
|
|
||||||
// unsigned long __udiv64(unsigned long, unsigned long);
|
|
||||||
__udiv64Fn = M.getOrInsertFunction("__udiv64", ul, ul, ul, 0);
|
|
||||||
// unsigned long __umul64(unsigned long, unsigned long);
|
|
||||||
__umul64Fn = M.getOrInsertFunction("__umul64", ul, ul, ul, 0);
|
|
||||||
// unsigned long __urem64(unsigned long, unsigned long);
|
|
||||||
__urem64Fn = M.getOrInsertFunction("__urem64", ul, ul, ul, 0);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// runOnFunction - Top level implementation of instruction selection for
|
/// runOnFunction - Top level implementation of instruction selection for
|
||||||
/// the entire function.
|
/// the entire function.
|
||||||
///
|
///
|
||||||
|
Loading…
x
Reference in New Issue
Block a user