public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug rtl-optimization/51954] New: __int128_t negation can be optimized
@ 2012-01-23  1:43 svfuerst at gmail dot com
  2012-01-23  4:00 ` [Bug rtl-optimization/51954] __int128_t (and long long on x86) " pinskia at gcc dot gnu.org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: svfuerst at gmail dot com @ 2012-01-23  1:43 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51954

             Bug #: 51954
           Summary: __int128_t negation can be optimized
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: rtl-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: svfuerst@gmail.com


__int128_t neg(__int128_t x)
{
    return -x;
}

Compiles into with -O3 :

mov    %rdi, %rax
mov    %rsi, %rdx
neg    %rax
adc    $0x0, %rdx
neg    %rdx
retq

Note how the last three instructions before the return are dependent on each
other.  This can be  slightly improved with slightly more inter-instruction
parallelism:

mov    %rdi, %rax
mov    %rsi, %rdx
neg    %rdx
neg    %rax
sbb    $0x0, %rdx
retq


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-04-29 11:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-23  1:43 [Bug rtl-optimization/51954] New: __int128_t negation can be optimized svfuerst at gmail dot com
2012-01-23  4:00 ` [Bug rtl-optimization/51954] __int128_t (and long long on x86) " pinskia at gcc dot gnu.org
2021-12-26 22:34 ` [Bug target/51954] " pinskia at gcc dot gnu.org
2022-02-21  5:57 ` pinskia at gcc dot gnu.org
2022-02-21  6:29 ` crazylht at gmail dot com
2022-02-21  6:49 ` crazylht at gmail dot com
2022-02-21  7:45 ` ubizjak at gmail dot com
2022-02-21  7:52 ` ubizjak at gmail dot com
2022-02-21  7:57 ` ubizjak at gmail dot com
2022-04-29 11:31 ` cvs-commit at gcc dot gnu.org
2022-04-29 11:33 ` ubizjak at gmail dot com

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).