> Since there is
> 
> /* X86_TUNE_SPLIT_LONG_MOVES: Avoid instructions moving immediates
>    directly to memory.  */
> DEF_TUNE (X86_TUNE_SPLIT_LONG_MOVES, "split_long_moves", m_PPRO)

If I recall correctly, this tune was added for PentiumPro which had
problem decoding moves with long immediate and is a performance
optimization rather than code size one.

As you discuss in the PR, i686 preffers
        xorl    %eax, %eax
        movl    %eax, aligned_heap_area
over
        movl $0, aligned_heap_area
which has too long encoding.
> 
> to avoid long immediate store instructions, like
> 
> c7 02 00 00 00 00    movl   $0x0,(%rdx)
> c7 02 ff ff ff ff    movl   $0xffffffff,(%rdx)
> 
> add TARGET_USE_AND0_ORM1_STORE and enable *mov<mode>_(and|or) for
> TARGET_USE_AND0_ORM1_STORE, which is true for TARGET_SPLIT_LONG_MOVES or
> -Oz, to also generate:
> 
> 83 22 00              andl   $0x0,(%rdx)
> 83 0a ff              orl    $0xffffffff,(%rdx)

I think this will not work well on PPro hardware since it will do it as
read-modify-write, while
        xorl %eax, %eax
        movl %eax, (%rdx)
is executed as store saving the useless load.

Honza

Reply via email to