public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "hjl.tools at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/60879] Wrong decision in decide_alg in i386.c
Date: Fri, 18 Apr 2014 15:59:00 -0000	[thread overview]
Message-ID: <bug-60879-4-kafTUblmSb@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-60879-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #2 from H.J. Lu <hjl.tools at gmail dot com> ---
(In reply to Jakub Jelinek from comment #1)
> Does this ever matter though?  I mean, wouldn't we expand it as move by
> pieces or store by pieces for such small constant length anyway and thus
> never reach the target movmem/setmem expansion?

move by pieces or store by pieces are very efficient for
targets with unaligned move/store for integer and vector:

[hjl@gnu-6 partial]$ cat w.i
void
foo5 (const void *src, void *dest, int s)
{
  __builtin_memcpy (dest, src, 23);
}
[hjl@gnu-6 partial]$ gcc -S -O2 w.i
[hjl@gnu-6 partial]$ cat w.s

    .file    "w.i"
    .text
    .p2align 4,,15
    .globl    foo5
    .type    foo5, @function
foo5:
.LFB0:
    .cfi_startproc
    movq    (%rdi), %rax
    movq    %rax, (%rsi)
    movq    8(%rdi), %rax
    movq    %rax, 8(%rsi)
    movl    16(%rdi), %eax
    movl    %eax, 16(%rsi)
    movzwl    20(%rdi), %eax
    movw    %ax, 20(%rsi)
    movzbl    22(%rdi), %eax
    movb    %al, 22(%rsi)
    ret

I am working on a different set/mov memory strategy to generate

    movdqu    (%rdi), %xmm0
    movups    %xmm0, (%rsi)
    movq    15(%rdi), %rax
    movq    %rax, 15(%rsi)
    ret

by setting MOVE_RATIO to 1 and handling most of set/mov memory in
x86 backend.


  parent reply	other threads:[~2014-04-18 15:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18  0:33 [Bug target/60879] New: Wrong decision in decide_alg hjl.tools at gmail dot com
2014-04-18  7:14 ` [Bug target/60879] Wrong decision in decide_alg in i386.c jakub at gcc dot gnu.org
2014-04-18 15:59 ` hjl.tools at gmail dot com [this message]
2021-08-28 19:02 ` pinskia 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-60879-4-kafTUblmSb@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: link
Be 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).