This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/52338] shorter abs thumb2 code sequences
- From: "rearnsha at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 22 Feb 2012 11:52:48 +0000
- Subject: [Bug target/52338] shorter abs thumb2 code sequences
- Auto-submitted: auto-generated
- References: <bug-52338-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52338
Richard Earnshaw <rearnsha at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-02-22
Ever Confirmed|0 |1
--- Comment #1 from Richard Earnshaw <rearnsha at gcc dot gnu.org> 2012-02-22 11:52:48 UTC ---
The sequence that doesn't need conditional execution will generally execute in
just two cycles, the version using the conditional execution will take 3
(perhaps more) as on some cores conditional instructions can be quite slow
(though still faster than branching if there is no pattern to that the branch
predictor can lock onto).
The patterns to deal with these sequences were originally written for ARM state
and have been subsequently converted to also handle Thumb2. In ARM state both
sequences need 8 bytes and the non-compare version is clearly preferable.