]> git.ipfire.org Git - thirdparty/gcc.git/commit
Better const_vector printing
authorRichard Sandiford <richard.sandiford@arm.com>
Wed, 14 Apr 2021 19:06:44 +0000 (20:06 +0100)
committerRichard Sandiford <richard.sandiford@arm.com>
Wed, 14 Apr 2021 19:06:44 +0000 (20:06 +0100)
commit1fce5932a3af575cd02c1d2b786dd1b39b922ebe
tree5e7a09f47f78fcdeb434e466f53f402cad343392
parent00a2774923c1dc5666cd26bb9b8c37b1b7dd689d
Better const_vector printing

Looking at PR99929 showed that we weren't dumping enough information
about variable-length CONST_VECTORs.  Something like:

  (const_vector:VNx4SI [(const_int 1) (const_int 0)])

could be either:

(a) 1, 0, 1, 0, repeating
(b) 1 followed by all zeros

This patch adds more information to the dumps.  There are four cases:

(a) above:

    (const_vector:VNx4SI repeat [
      (const_int 1)
      (const_int 0)
    ])

(b) above:

    (const_vector:VNx4SI [
      (const_int 1)
      repeat [
        (const_int 0)
      ]
    ])

a single stepped sequence:

    (const_vector:VNx4SI [
      (const_int 0)
      stepped [
        (const_int 1)
        (const_int 2)
      ]
    ])

interleaved stepped sequences:

    (const_vector:VNx4SI [
      (const_int 0)
      (const_int 40)
      stepped (interleave 2) [
        (const_int 1)
        (const_int 41)
        (const_int 2)
        (const_int 42)
      ]
    ])

There are probably better syntaxes, but hopefully this is at least
an improvement on the status quo.

gcc/
* print-rtl.c (rtx_writer::print_rtx_operand_codes_E_and_V): Print
more information about variable-length CONST_VECTORs.
gcc/print-rtl.c