Page MenuHomeFreeBSD

param: Refactor rounddown
AbandonedPublic

Authored by aokblast on Fri, Feb 27, 7:17 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Feb 28, 1:52 AM
Unknown Object (File)
Sat, Feb 28, 1:37 AM
Unknown Object (File)
Fri, Feb 27, 11:38 AM
Subscribers

Details

Reviewers
imp
markj
jhb
Summary

Obviously, a minus + reminder is faster than divide and multiply in most of the platform.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 71063
Build 67946: arc lint + arc unit

Event Timeline

aokblast added reviewers: imp, markj, jhb.

Does it actually make a difference in generated code? I would expect a compiler to be able to do this transformation.

I did some experiment and you are right, the compiler optimize it above O1.
Also, my assumption is wrong since reminder in aarch64 actually convert into udiv + msub, which is not faster than what we previous have.
Thanks!