testsuite, rs6000: Fix builtins-6-p9-runnable.c for BE [PR114744]
commit6e62ede7aaccc6ebe027c8e00224f65e226072e9
authorKewen Lin <linkw@linux.ibm.com>
Thu, 18 Apr 2024 03:20:07 +0000 (17 22:20 -0500)
committerKewen Lin <linkw@linux.ibm.com>
Thu, 18 Apr 2024 03:20:07 +0000 (17 22:20 -0500)
tree9e10c884c21f76adaabd5739f8e6f62589cb71cd
parent58a0b190a256bd2a184554de0fae0031a614ec67
testsuite, rs6000: Fix builtins-6-p9-runnable.c for BE [PR114744]

Test case builtins-6-p9-runnable.c doesn't work well on BE
due to two problems:
  - When applying vec_xl_len onto data_128 and data_u128
    with length 8, it expects to load 1280000[01] from
    the memory, but unfortunately assigning 1280000[01] to
    a {vector} {u,}int128 type variable, the value isn't
    guaranteed to be at the beginning of storage (in the
    low part of memory), which means the loaded value can
    be unexpected (as shown on BE).  So this patch is to
    introduce getU128 which can ensure the given value
    shows up as expected and also update some dumping code
    for debugging.
  - When applying vec_xl_len_r with length 16, on BE it's
    just like the normal vector load, so the expected data
    should not be reversed from the original.

PR testsuite/114744

gcc/testsuite/ChangeLog:

* gcc.target/powerpc/builtins-6-p9-runnable.c: Adjust for BE by fixing
data_{u,}128, their uses and vec_uc_expected1, also adjust some formats.
gcc/testsuite/gcc.target/powerpc/builtins-6-p9-runnable.c