This is an archive of the discontinued LLVM Phabricator instance.

[ARM] Lower modulo operation to generate __aeabi_divmod on Android
ClosedPublic

Authored by sgundapa on Jul 30 2015, 1:23 PM.

Details

Summary

For a modulo (reminder) operation,
clang -target armv7-none-linux-gnueabi generates "_ _modsi3"
clang -target armv7-none-eabi generates "_ _aeabi_idivmod"
clang -target armv7-linux-androideabi generates "_ _modsi3"

Android bionic libc doesn't provide a _ _modsi3, instead it provides a
"_ _aeabi_idivmod". This patch fixes the LLVM ARMISelLowering to generate
the correct call when ever there is a modulo operation.

Diff Detail

Repository
rL LLVM

Event Timeline

sgundapa updated this revision to Diff 31068.Jul 30 2015, 1:23 PM
sgundapa retitled this revision from to [ARM] Lower modulo operation to generate __aeabi_divmod on Android.
sgundapa updated this object.
sgundapa added reviewers: rengolin, apazos.
sgundapa added a subscriber: llvm-commits.
sgundapa updated this object.Jul 30 2015, 1:30 PM
t.p.northover accepted this revision.Jul 30 2015, 1:33 PM
t.p.northover added a reviewer: t.p.northover.
t.p.northover added a subscriber: t.p.northover.

This looks reasonable to me.

Tim.

This revision is now accepted and ready to land.Jul 30 2015, 1:33 PM
rengolin accepted this revision.Jul 30 2015, 1:44 PM
rengolin edited edge metadata.

Sumanth, do you have commit rights?

asl added a subscriber: asl.Jul 30 2015, 2:19 PM
asl added inline comments.
lib/Target/ARM/ARMISelLowering.cpp
742 ↗(On Diff #31068)

What are the differences between "EABI" and "androideabi"? Can't we simply assume that "androideabi" is "eabi" ?

Renato, I have commit rights.

What are the differences between "EABI" and "androideabi"? Can't we simply assume that "androideabi" is "eabi" ?

It depends and assumption changes over time.

This revision was automatically updated to reflect the committed changes.

This patch was merged