mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-07 16:54:48 +00:00
Lower i16/i32 sdiv/udiv/srem/urem using libcalls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72942 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a43a7aefd7
commit
4680077959
@ -46,6 +46,16 @@ static const char *getIntrinsicName(unsigned opcode) {
|
||||
case PIC16ISD::MUL_I8: Basename = "mul.i8"; break;
|
||||
case RTLIB::MUL_I16: Basename = "mul.i16"; break;
|
||||
case RTLIB::MUL_I32: Basename = "mul.i32"; break;
|
||||
|
||||
case RTLIB::SDIV_I16: Basename = "sdiv.i16"; break;
|
||||
case RTLIB::SDIV_I32: Basename = "sdiv.i32"; break;
|
||||
case RTLIB::UDIV_I16: Basename = "udiv.i16"; break;
|
||||
case RTLIB::UDIV_I32: Basename = "udiv.i32"; break;
|
||||
|
||||
case RTLIB::SREM_I16: Basename = "srem.i16"; break;
|
||||
case RTLIB::SREM_I32: Basename = "srem.i32"; break;
|
||||
case RTLIB::UREM_I16: Basename = "urem.i16"; break;
|
||||
case RTLIB::UREM_I32: Basename = "urem.i32"; break;
|
||||
}
|
||||
|
||||
std::string prefix = PAN::getTagName(PAN::PREFIX_SYMBOL);
|
||||
@ -90,6 +100,20 @@ PIC16TargetLowering::PIC16TargetLowering(PIC16TargetMachine &TM)
|
||||
setLibcallName(RTLIB::MUL_I16, getIntrinsicName(RTLIB::MUL_I16));
|
||||
setLibcallName(RTLIB::MUL_I32, getIntrinsicName(RTLIB::MUL_I32));
|
||||
|
||||
// Signed division lib call names
|
||||
setLibcallName(RTLIB::SDIV_I16, getIntrinsicName(RTLIB::SDIV_I16));
|
||||
setLibcallName(RTLIB::SDIV_I32, getIntrinsicName(RTLIB::SDIV_I32));
|
||||
// Unsigned division lib call names
|
||||
setLibcallName(RTLIB::UDIV_I16, getIntrinsicName(RTLIB::UDIV_I16));
|
||||
setLibcallName(RTLIB::UDIV_I32, getIntrinsicName(RTLIB::UDIV_I32));
|
||||
|
||||
// Signed remainder lib call names
|
||||
setLibcallName(RTLIB::SREM_I16, getIntrinsicName(RTLIB::SREM_I16));
|
||||
setLibcallName(RTLIB::SREM_I32, getIntrinsicName(RTLIB::SREM_I32));
|
||||
// Unsigned remainder lib call names
|
||||
setLibcallName(RTLIB::UREM_I16, getIntrinsicName(RTLIB::UREM_I16));
|
||||
setLibcallName(RTLIB::UREM_I32, getIntrinsicName(RTLIB::UREM_I32));
|
||||
|
||||
setOperationAction(ISD::GlobalAddress, MVT::i16, Custom);
|
||||
setOperationAction(ISD::ExternalSymbol, MVT::i16, Custom);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user