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

--- Comment #8 from Ilya Leoshkevich <iii at linux dot ibm.com> ---
Yeah, inline asm seems to be problematic:

/home/iii/gcc/build/gcc/xgcc -B/home/iii/gcc/build/gcc/
/home/iii/gcc/gcc/testsuite/gcc.target/s390/vector/long-double-asm-hardreg.c   
-fdiagnostics-plain-output   -O2 -march=z14 -mzarch -S -o
long-double-asm-hardreg.s

with the patch from comment 2 produces:

foo:
.LFB0:
        .cfi_startproc
        larl    %r5,.L4
        vl      %v0,.L5-.L4(%r5),3
#APP
# 10
"/home/iii/gcc/gcc/testsuite/gcc.target/s390/vector/long-double-asm-hardreg.c"
1
        # %v0
# 0 "" 2
#NO_APP
        br      %r14

`vl      %v0,.L5-.L4(%r5),3` loads 1.0L into %v0[0:128]. However, it should be
loaded into %v0[0:64] . %v2[0:64].

With the patch from comment 3 I get:

foo:
.LFB0:
        .cfi_startproc
        larl    %r5,.L4
        ld      %f0,.L5-.L4(%r5)
        ld      %f2,.L5-.L4+8(%r5)
#APP
# 10
"/home/iii/gcc/gcc/testsuite/gcc.target/s390/vector/long-double-asm-hardreg.c"
1
        # %f0
# 0 "" 2
#NO_APP
        br      %r14

which is correct, but in general case the exact reg that the user requested is
not honored.

Reply via email to