[llvm-dev] array fill idioms

Stephen Canon via llvm-dev llvm-dev at lists.llvm.org
Thu Nov 10 14:23:34 PST 2016


> On Nov 10, 2016, at 5:15 PM, Robinson, Paul via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> 
> Back in the day, we called this a BLT (block transfer, pronouced 'blit') for the PDP-10 instruction of that name.

On x86, there is REP MOVS.

> You can do this by assigning the first value, then do an overlapping memcpy to fill in the rest.

This is undefined behavior, and really doesn’t work with most modern memcpy( ) implementations (the most common thing these days is to simply implement memmove( ) semantics for memcpy, which will very much not do what you want).

– Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161110/88bc8765/attachment.html>


More information about the llvm-dev mailing list