[compiler-rt] r215295 - builtins: correct __umodsi3, __udivsi3 on ARM

Anton Korobeynikov anton at korobeynikov.info
Tue Aug 19 14:55:57 PDT 2014


Did some git / svn archaeology: support for cores with division
instructions was added in r182665 / a09d09d29e

And the code there (see e.g.
http://llvm.org/klaus/compiler-rt/commit/a09d09d29e250e905bdfaf819979b9c3e9adc047/)
is precisely the same as in Saleem's latest commit.

Looks like in r200001 umodsi3.S was completely replaced (!) by
udivmodsi4.S making it broken.

CC'ing Joerg as he was the author of that commit.

On Wed, Aug 20, 2014 at 1:36 AM, Anton Korobeynikov
<anton at korobeynikov.info> wrote:
>> I agree that __umodsi3 was completely wrong, and I believe this is a
>> left-over from an old divmod implementation, as is the __udivsi3.
>> Anton would know better, as I believe he wrote the original code.
>>
>> I'm worried about the bogus write to [r2] as it could really lead to
>> memory corruption, but not so much for the udiv.
> I do not recall all the details, but I believe the original code (ARM
> stuff in compiler-rt) was something written for Darwin. At that time I
> reviewed everything and add EABI compatibility bits to ones which
> looked suitable...
>
> --
> With best regards, Anton Korobeynikov
> Faculty of Mathematics and Mechanics, Saint Petersburg State University



-- 
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-commits mailing list