https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63281

--- Comment #17 from Jiu Fu Guo <guojiufu at gcc dot gnu.org> ---
One thing, I'm wondering, is if it is really 'slow' using instructions to build
the const (even with 5 insns). 

For example, there seems no big difference in runtime between the below two
pieces of code on a real machine.
1.

foo:
.LFB0:
        .cfi_startproc
        std %r31,-8(%r1)
        .cfi_offset 31, -8
        li %r12,2
        li %r31,1
        li %r0,3
        li %r11,4
        std %r31,0(%r3)
        std %r12,0(%r4)
        std %r0,0(%r5)
        std %r11,0(%r6)
        std %r31,0(%r7)
        std %r12,0(%r8)
        ld %r31,-8(%r1)
        std %r0,0(%r9)
        std %r11,0(%r10)
        .cfi_restore 31
        blr


2
foo:
.LFB0:
        .cfi_startproc
        std 31,-8(1)
        .cfi_offset 31, -8
        li 11,0
        li 31,0
        li 12,0
        ori 11,11,0x8000
        ori 31,31,0x8000
        ori 12,12,0x8000
        sldi 11,11,32
        sldi 31,31,32
        sldi 12,12,32
        oris 11,11,0x410
        oris 31,31,0x410
        oris 12,12,0x410
        ori 11,11,0x1
        ori 31,31,0x3
        ori 12,12,0x5
        li 0,0
        std 11,0(3)
        std 31,0(4)
        li 3,0
        li 4,0
        std 12,0(5)
        li 5,0
        ori 0,0,0x8000
        ld 31,-8(1)
        ori 3,3,0x8000
        ori 4,4,0x8000
        ori 5,5,0x8000
        sldi 0,0,32
        sldi 3,3,32
        sldi 4,4,32
        sldi 5,5,32
        oris 0,0,0x410
        oris 3,3,0x410
        oris 4,4,0x410
        oris 5,5,0x410
        ori 0,0,0x7
        addi 11,11,5
        ori 3,3,0xa
        ori 4,4,0xe
        ori 5,5,0xc
        std 0,0(6)
        std 11,0(7)
        std 3,0(8)
        std 4,0(9)
        std 5,0(10)
        .cfi_restore 31
       blr

Reply via email to