Skip to content
  • Artem Pyanykh's avatar
    codegen: fix memset unroll for small bytearrays, add 64-bit sets · af4cea7f
    Artem Pyanykh authored and Marge Bot's avatar Marge Bot committed
    Fixes #16052
    
    When the offset in `setByteArray#` is statically known, we can provide
    better alignment guarantees then just 1 byte.
    
    Also, memset can now do 64-bit wide sets.
    
    The current memset intrinsic is not optimal however and can be
    improved for the case when we know that we deal with
    
    (baseAddress at known alignment) + offset
    
    For instance, on 64-bit
    
    `setByteArray# s 1# 23# 0#`
    
    given that bytearray is 8 bytes aligned could be unrolled into
    `movb, movw, movl, movq, movq`; but currently it is
    `movb x23` since alignment of 1 is all we can embed into MO_Memset op.
    af4cea7f