Page MenuHomePhabricator

[Sparc] Added software multiplication/division feature
ClosedPublic

Authored by ekedaigle on Jul 17 2017, 12:34 PM.

Details

Summary

Added a feature to the Sparc back-end that replaces the integer multiply and
divide instructions with calls to .mul/.sdiv/.udiv. This is a step towards
having full v7 support.

Diff Detail

Repository
rL LLVM

Event Timeline

ekedaigle created this revision.Jul 17 2017, 12:34 PM

I assume the .mul/.sdiv/.udiv routines must be provided by linking to libgcc or glibc?

Looks good to me but perhaps wait for @jyknight to confirm also.

jyknight accepted this revision.Jul 18 2017, 7:25 AM

I assume the .mul/.sdiv/.udiv routines must be provided by linking to libgcc or glibc?

Yes, libgcc provides ".umul", ".udiv", ".div", ".urem", and ".rem" functions.

lib/Target/Sparc/SparcSubtarget.h
35 ↗(On Diff #106919)

I'd suggest "UseSoftMulDiv", instead, since it affects both. Here and everywhere.

This revision is now accepted and ready to land.Jul 18 2017, 7:25 AM

@ekedaigle: Looks like this is your first patch; you need me to commit it for you?

Changed SoftMul -> SoftMulDiv

@ekedaigle: Looks like this is your first patch; you need me to commit it for you?

Please, that would be great. I've updated it with the name change, so it should be good to go.

This revision was automatically updated to reflect the committed changes.