[PATCH] PowerPC: Disable test gdb.arch/powerpc-power10.exp on non ISA 3.1 processors.
Carl Love
cel@us.ibm.com
Wed May 11 22:58:58 GMT 2022
Ulrich:
On Fri, 2022-05-06 at 17:03 +0000, Ulrich Weigand wrote:
> will schmidt <will_schmidt@vnet.ibm.com> wrote:
>
> > The test for power10 instructions would otherwise be invalid in
> > that
> > environment. I'm not sure off top of head whether that means the
> test
> > should be marked as invalid (XFAIL) in that case, or if a newer
> > compiler should be added to that (pristinely antique) environment.
>
> I would have expected this guard to catch that case:
>
> if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${objfile}"
> object
> {debug}] != "" } {
>
> untested "PowerPC instructions disassembly"
>
> return -1
>
> }
>
> and mark the test as UNTESTED, which seems right to me ...
The issue is the test, powerpc-power10.s, specifies the Power 10
instructions using .long statements.
.text
.globl func
func:
.long 0x7c200176 /* brd r0,r1 */
.long 0x7c2001b6 /* brh r0,r1 */
.long 0x7c200136 /* brw r0,r1 */
....
.quad 0x8004ffff0500ffff /* xxspltidp vs0,4294967295 */
.quad 0x8006000005000000 /* xxspltiw vs0,0 */
.quad 0x8006000105000000 /* xxspltiw vs0,0 */
.quad 0x8006000305000000 /* xxspltiw vs0,3 */
.quad 0x8006000805000000 /* xxspltiw vs0,8 */
The compilation of the above assembly succeeds on systems that do not
support ISA 3.1 because the assembler does not see any opcodes. It
can't tell what ISA the instructions the .long statements represent.
The disassembler prints out the opcodes for patterns that match a known
opcode and the rest get printed as .long. The issue is the
disassembled output does not match the expected values as given in
powerpc-power10.exp and thus the test generates numerous test failures.
I created a new test, disassembler_supports_isa_3_1, based on the
existing check skip_power_isa_3_1_tests. The new check assembles the
inline pnop opcode and exits if the assembly fails. If it does
assemble, then the check tries to disassemble the function and match
the pnop in the output to verify disassembler recognizes ISA 3.1
instsructions. The use of the skip_power_isa_3_1_tests would probably
sufficient here since the compiler/assembler/diassembler should all be
packaged together and support the same ISA version. But that said, in
the weird case of a system where the assembler and disassembler are for
different ISA versions, the new test is better in that it actually
tests disassembly of ISA 3.1 instructions.
With the new test, the powerpc-power10.exp test is skipped if the
system does not support disassembly of ISA 3.1 instructions.
I will post version 2 of the patch for review.
Carl
More information about the Gdb-patches
mailing list