Skip to content

Running loops-all-mid-10k-sp.exe on PPC64 (e6500) causes illegal instruction  #19

@Nairu

Description

@Nairu

When trying to run the benchmark on a reference board with the e6500 CPU, the test loops-all-mid-10k-sp.exe fails to run with an 'illegal instruction' error.

Trying to debug this, I find that the error is on line 333 running this command: gdb -ex=r ./builds/linux64/gcc64/bin/loops-all-mid-10k-sp.exe
Logs:

Reading symbols from ./builds/linux64/gcc64/bin/loops-all-mid-10k-sp.exe...
Starting program: /run/media/mmcblk0p2/coremark-pro/builds/linux64/gcc64/bin/loops-all-mid-10k-sp.exe
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".

Program received signal SIGILL, Illegal instruction.
0x00000000404a7448 in define_params_loops (idx=<optimized out>, name=<optimized out>, dataset=<optimized out>) at /<redacted>/benchmarks/fp/loops/loops.c:333
333			int m2=(int)th_sqrt((e_fp)(params->N*4));

Taking a closer look at this line after decompiling the frame, I can see a number of instructions:
gdb -batch -ex "disassemble/rs define_params_loops" ./builds/linux64/gcc64/bin/loops-all-mid-10k-sp.exe | less
logs:

333                     int m2=(int)th_sqrt((e_fp)(params->N*4));
   0x000000000000b420 <+688>:   80 fe 00 14     lwz     r7,20(r30)
   0x000000000000b424 <+692>:   3d 22 ff fd     addis   r9,r2,-3
   0x000000000000b428 <+696>:   c0 09 ec 08     lfs     f0,-5112(r9)
   0x000000000000b42c <+700>:   78 e9 10 28     rldic   r9,r7,2,32
   0x000000000000b430 <+704>:   f9 21 00 88     std     r9,136(r1)
   0x000000000000b434 <+708>:   60 42 00 00     ori     r2,r2,0
   0x000000000000b438 <+712>:   c8 21 00 88     lfd     f1,136(r1)
   0x000000000000b43c <+716>:   fd 80 0e 9c     fcfid   f12,f1
   0x000000000000b440 <+720>:   fc 20 60 18     frsp    f1,f12
   0x000000000000b444 <+724>:   fc 01 00 00     fcmpu   cr0,f1,f0
   0x000000000000b448 <+728>:   ef e0 08 2c     fsqrts  f31,f1
   0x000000000000b44c <+732>:   41 80 03 44     blt     0xb790 <define_params_loops+1568>
   0x000000000000b450 <+736>:   ff e0 f8 1e     fctiwz  f31,f31
   0x000000000000b454 <+740>:   39 01 00 80     addi    r8,r1,128
   0x000000000000b458 <+744>:   38 c0 00 20     li      r6,32
   0x000000000000b45c <+748>:   7c c9 03 a6     mtctr   r6
   0x000000000000b460 <+752>:   7c ea 07 b4     extsw   r10,r7
   0x000000000000b464 <+756>:   39 3e 00 18     addi    r9,r30,24
   0x000000000000b468 <+760>:   7f e0 47 ae     stfiwx  f31,0,r8
   0x000000000000b46c <+764>:   e9 1e 01 1e     lwa     r8,284(r30)
   0x000000000000b470 <+768>:   80 a1 00 80     lwz     r5,128(r1)

I have a feeling the issue might be the blt call, but I'm not 100% certain. Any thoughts or help would be useful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions