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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Stefan Schulze Frielinghaus
<stefa...@gcc.gnu.org>:

https://gcc.gnu.org/g:7051fa5fa4eaa24785a64072490c1e0c65039915

commit r12-10729-g7051fa5fa4eaa24785a64072490c1e0c65039915
Author: Stefan Schulze Frielinghaus <stefa...@gcc.gnu.org>
Date:   Fri Sep 27 12:45:42 2024 +0200

    s390: Fix TF to FPRX2 conversion [PR115860]

    Currently subregs originating from *tf_to_fprx2_0 and *tf_to_fprx2_1
    survive register allocation.  This in turn leads to wrong register
    renaming.  Keeping the current approach would mean we need two insns for
    *tf_to_fprx2_0 and *tf_to_fprx2_1, respectively.  Something along the
    lines

    (define_insn "*tf_to_fprx2_0"
      [(set (subreg:DF (match_operand:FPRX2 0 "nonimmediate_operand" "=f") 0)
            (unspec:DF [(match_operand:TF 1 "general_operand" "v")]
                       UNSPEC_TF_TO_FPRX2_0))]
      "TARGET_VXE"
      "#")

    (define_insn "*tf_to_fprx2_0"
      [(set (match_operand:DF 0 "nonimmediate_operand" "=f")
            (unspec:DF [(match_operand:TF 1 "general_operand" "v")]
                       UNSPEC_TF_TO_FPRX2_0))]
      "TARGET_VXE"
      "vpdi\t%v0,%v1,%v0,1
      [(set_attr "op_type" "VRR")])

    and similar for *tf_to_fprx2_1.  Note, pre register allocation operand 0
    has mode FPRX2 and afterwards DF once subregs have been eliminated.

    Since we always copy a whole vector register into a floating-point
    register pair, another way to fix this is to merge *tf_to_fprx2_0 and
    *tf_to_fprx2_1 into a single insn which means we don't have to use
    subregs at all.  The downside of this is that the assembler template
    contains two instructions, now.  The upside is that we don't have to
    come up with some artificial insn before RA which might be more
    readable/maintainable.  That is implemented by this patch.

    In commit r11-4872-ge627cda5686592, the output operand specifier %V was
    introduced which is used in tf_to_fprx2 only, now.  Instead of coming up
    with its counterpart %F for floating-point registers, which would also
    only be used in tf_to_fprx2, I print the operands directly.  This
    renders %V unused which is why it is removed by this patch.

    gcc/ChangeLog:

            PR target/115860
            * config/s390/s390.cc (print_operand): Remove operand specifier
            %V.
            * config/s390/s390.md (UNSPEC_TF_TO_FPRX2): New.
            * config/s390/vector.md (*tf_to_fprx2_0): Remove.
            (*tf_to_fprx2_1): Remove.
            (tf_to_fprx2): New.

    gcc/testsuite/ChangeLog:

            * gcc.target/s390/vector/long-double-asm-abi.c: Adapt
            scan-assembler directive.
            * gcc.target/s390/vector/long-double-to-i64.c: Adapt
            scan-assembler directive.
            * gcc.target/s390/pr115860-1.c: New test.

    (cherry picked from commit 46c2538435dfc50dd5c67c4e03ce387d1f6ebe9b)

Reply via email to