[RTEMS Project] #2369: [PowerPC Book E] Invalid mftb instruction in _CPU_Counter_read()

RTEMS trac trac at rtems.org
Tue Jul 14 04:50:23 UTC 2015


#2369: [PowerPC Book E] Invalid mftb instruction in _CPU_Counter_read()
--------------------------+---------------------
 Reporter:  nick.withers  |       Owner:
     Type:  defect        |      Status:  new
 Priority:  normal        |   Milestone:  4.11.1
Component:  General       |     Version:  4.11
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+---------------------

Comment (by nick.withers):

 If I build with "CPU_CFLAGS = -mcpu=8540 -meabi -msdata=sysv -msoft-float
 -mno-spe -fno-common" all seems kosher (or at least as kosher as it did
 with ''-mcpu=powerpc'' before changing the CFLAGS from what's in Git HEAD,
 though I haven't got back to the profiling bit yet and am expecting the
 Alternate Time Base access in ''_CPU_Counter_read()'' to fail).

 GDB reports arch of "powerpc:common", which is what I was seeing with
 ''-mcpu=powerpc''.

 Without ''-msoft-float -mno-spe'' it reports "powerpc:e500" and is an
 unhappy camper, e.g.:
 {{{
 (gdb) target remote bdi:2159
 Remote debugging using bdi:2159
 Remote 'g' packet reply is too long:
 deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e4008a0ac40066d2e01020298deadbeefdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef
 }}}

 If I build with ''-msoft-float'' but not ''mno-spe'' it seems to try to
 link against hard-float multilibs:
 {{{
 /usr/home/nick/rtems/rtems-4.11/bin/../lib/gcc/powerpc-rtems4.11/4.9.3
 /../../../../powerpc-rtems4.11/bin/ld: Warning:
 /usr/home/nick/rtems/rtems-4.11/bin/../lib/gcc/powerpc-rtems4.11/4.9.3
 /../../../../powerpc-rtems4.11/lib/libc.a(lib_a-printf.o) uses hard float,
 hello.exe uses soft float
 }}}

 Going off this in ''score/powerpc.h'':
 {{{
 #if defined(_SOFT_FLOAT) \
   || defined(__NO_FPRS__) /* e500 has unified integer/FP registers */ \
   || defined(__PPC_CPU_E6500__)
 #define PPC_HAS_FPU 0
 #else
 #define PPC_HAS_FPU 1
 #endif
 }}}
 ...the intention's that we should be soft-float on the e500?

--
Ticket URL: <http://devel.rtems.org/ticket/2369#comment:8>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list