This is an archive of the discontinued LLVM Phabricator instance.

[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.

Hey everyone! Just wanted to share my thoughts on the recent addition to the Sparc backend. The software multiplication/division feature seems like a great step forward, especially in terms of achieving full v7 support. Kudos to the developers for implementing this addition!

Software-based multiplication and division can offer flexibility and potentially improve performance in certain scenarios. By replacing the integer multiply and divide instructions with calls to .mul/.sdiv/.udiv, it allows for more efficient code generation and opens up possibilities for optimizations.

As a software developer, I appreciate updates like this that enhance the capabilities of a platform. It's great to see continuous improvements being made to Sparc. I'm curious to see how this feature performs in practice and if it leads to any noticeable improvements in the overall performance of Sparc-based applications.

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 24 2023, 4:23 AM
barannikov88 removed a subscriber: barannikov88.