Date: Thu, 29 Jan 2026 09:53:39 -0500
On Thu, Jan 29, 2026 at 8:00 AM Giuseppe D'Angelo via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Il 29/01/26 13:30, Frederick Virchanza Gotham via Std-Proposals ha scritto:
> >
> > GodBolt:https://godbolt.org/z/xqr6813q7
> >
> > Let's look at how the assembler comes out. Here's CopyA:
> >
> > shl $0x15,%rdx
> > jmp memcpy
> >
> > First instructions shifts the count left 21 places (to convert to bytes).
> > Second instruction jumps to memcpy.
> > No surprises here.
> >
> > Now let's look at CopyB:
> >
> > test %rdx,%rdx
> > je 60 <CopyB(void*, S const*, unsigned long)+0x50>
> > push %r13
> > shl $0x15,%rdx
> > mov %rsi,%r13
> > push %r12
> > mov %rdi,%r12
> > push %rbp
> > mov %rdx,%rbp
> > push %rbx
> > xor %ebx,%ebx
> > sub $0x8,%rsp
> > xchg %ax,%ax
> > lea (%r12,%rbx,1),%rdi
> > lea 0x0(%r13,%rbx,1),%rsi
> > mov $0x200000,%edx
> > add $0x200000,%rbx
> > call 4a <CopyB(void*, S const*, unsigned long)+0x3a>
> > R_X86_64_PLT32 memcpy-0x4
> > cmp %rbx,%rbp
> > jne 30 <CopyB(void*, S const*, unsigned long)+0x20>
> > add $0x8,%rsp
> > pop %rbx
> > pop %rbp
> > pop %r12
> > pop %r13
> > ret
> >
> > The above is more complicated, and we see that memcpy is called
> > several times in a loop.
>
>
> I've stopped reading right here: look up `restrict`.
>
> Can we please *stop* with email threads that *do not contain a concrete
> proposal*?
This thread took nearly 2 days before someone took the bait and tried
to engage with the OP. I'd hoped that maybe people were learning, but
that didn't last as long as I hoped. Maybe next time people will just
ignore him.
<std-proposals_at_[hidden]> wrote:
>
> Il 29/01/26 13:30, Frederick Virchanza Gotham via Std-Proposals ha scritto:
> >
> > GodBolt:https://godbolt.org/z/xqr6813q7
> >
> > Let's look at how the assembler comes out. Here's CopyA:
> >
> > shl $0x15,%rdx
> > jmp memcpy
> >
> > First instructions shifts the count left 21 places (to convert to bytes).
> > Second instruction jumps to memcpy.
> > No surprises here.
> >
> > Now let's look at CopyB:
> >
> > test %rdx,%rdx
> > je 60 <CopyB(void*, S const*, unsigned long)+0x50>
> > push %r13
> > shl $0x15,%rdx
> > mov %rsi,%r13
> > push %r12
> > mov %rdi,%r12
> > push %rbp
> > mov %rdx,%rbp
> > push %rbx
> > xor %ebx,%ebx
> > sub $0x8,%rsp
> > xchg %ax,%ax
> > lea (%r12,%rbx,1),%rdi
> > lea 0x0(%r13,%rbx,1),%rsi
> > mov $0x200000,%edx
> > add $0x200000,%rbx
> > call 4a <CopyB(void*, S const*, unsigned long)+0x3a>
> > R_X86_64_PLT32 memcpy-0x4
> > cmp %rbx,%rbp
> > jne 30 <CopyB(void*, S const*, unsigned long)+0x20>
> > add $0x8,%rsp
> > pop %rbx
> > pop %rbp
> > pop %r12
> > pop %r13
> > ret
> >
> > The above is more complicated, and we see that memcpy is called
> > several times in a loop.
>
>
> I've stopped reading right here: look up `restrict`.
>
> Can we please *stop* with email threads that *do not contain a concrete
> proposal*?
This thread took nearly 2 days before someone took the bait and tried
to engage with the OP. I'd hoped that maybe people were learning, but
that didn't last as long as I hoped. Maybe next time people will just
ignore him.
Received on 2026-01-29 14:53:53
