Bug 831467 - bad disassembly of vsplth (PowerPC AltiVec)
bad disassembly of vsplth (PowerPC AltiVec)
Product: Fedora
Classification: Fedora
Component: gdb (Show other bugs)
powerpc Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Jan Kratochvil
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-06-13 00:11 EDT by John Reiser
Modified: 2012-06-13 10:53 EDT (History)
5 users (show)

See Also:
Fixed In Version: gdb-
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-13 10:53:15 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description John Reiser 2012-06-13 00:11:29 EDT
Description of problem: The PowerPC AltiVec instruction
    vsplth v0,v0,0  // 0x1000024c
is incorrectly disassembled by gdb as
    psq_lux f0,r0,r0,0,4

Version-Release number of selected component (if applicable):

How reproducible: always

Steps to Reproduce:
1. Use "gcc -c vsplth.S" to compile the one instruction
     vsplth 0,0,0  // 0x1000024c
2. Disassemble using "gdb vsplth.o":
     (gdb) x/i 0
Actual results:
   0x0:	psq_lux f0,r0,r0,0,4

Expected results:
   0x0:	vsplth v0,v0,0

Additional info: Documentation is on p.245 of
Comment 1 Jan Kratochvil 2012-06-13 07:45:20 EDT
This is the output you get from:
objdump -d -M any 1.o

      /* When debugging E500 binaries and disassembling code containing
         E500-specific (SPE) instructions, one sometimes sees AltiVec
         instructions instead.  The opcode spaces for SPE instructions
         and AltiVec instructions overlap, and specifiying the "any" cpu
         looks for AltiVec instructions first.  If we know we're
         debugging an E500 binary, however, we can specify the "e500x2"
         cpu and get much more sane disassembly output.  */
      if (info->mach == bfd_mach_ppc_e500)
        info->disassembler_options = "e500x2";
        info->disassembler_options = "any";

So vsplth is AltiVec?  It should be preferred according to the text above.

Setting architecture somehow does not work for me:
(gdb) set architecture 
auto              powerpc:604       powerpc:750       powerpc:common    powerpc:e500mc64  powerpc:rs64iii   rs6000:rs1        
powerpc:rs64ii    rs6000:6000       
(gdb) set architecture rs6000:rs1
Architecture `rs6000:rs1' not recognized.
The target architecture is set automatically (currently powerpc:common64)
Comment 2 Jan Kratochvil 2012-06-13 10:53:15 EDT
Upstream apparently fixed it.  I have not bisected the revision.

GNU gdb (GDB) Fedora (
This GDB was configured as "ppc64-redhat-linux-gnu".
(gdb) x/i 0
   0x0:	vsplth  v0,v0,0

It can be backported to F-17 upon request.

Note You need to log in before you can comment on or make changes to this bug.