public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "olegendo at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug target/52933] SH Target: Use div0s for integer sign comparisons Date: Wed, 17 Dec 2014 01:52:00 -0000 [thread overview] Message-ID: <bug-52933-4-tyTBIQOCzB@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-52933-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52933 --- Comment #5 from Oleg Endo <olegendo at gcc dot gnu.org> --- Some of the original test cases are still not working. In particular cases where bit positions != 31 are compared/xor'ed: bool cmp_signs_24 (int a, int b) { return (a & 0x8000) ^ (b & 0x8000); } bool cmp_signs_25 (int a, int b) { return (a & 0x8000) != (b & 0x8000); } bool cmp_signs_26 (short a, short b) { return (a < 0) == (b < 0); } bool cmp_signs_27 (short a, short b) { return (a < 0) != (b < 0); } int cmp_signs_28 (short a, short b) { return (a < 0) != (b < 0) ? 40 : -10; } Such cases can be improved by shifting the tested bit into MSB position and using div0s.
next prev parent reply other threads:[~2014-12-17 1:52 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2012-04-11 11:03 [Bug target/52933] New: " olegendo at gcc dot gnu.org 2012-04-11 11:04 ` [Bug target/52933] " olegendo at gcc dot gnu.org 2012-08-14 17:59 ` olegendo at gcc dot gnu.org 2012-08-15 16:05 ` olegendo at gcc dot gnu.org 2013-05-06 20:10 ` olegendo at gcc dot gnu.org 2014-12-17 1:52 ` olegendo at gcc dot gnu.org [this message] 2014-12-22 16:19 ` olegendo at gcc dot gnu.org 2015-01-24 13:05 ` olegendo at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-52933-4-tyTBIQOCzB@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).