Public bug reported:

We currently build eglibc using  --with-cpu=power7. This gives us
optimised power7 glibc functions, but it also passes -mtune=power7 to
gcc.

Unfortunately this causes gcc to be overly careful about alignment issues. One 
example is this fragment in tcgetattr, where
we zero a struct byte by byte:

  11141c:       2d d7 f9 4b     bl      aeb48 <bcmp+0x1768>
  111420:       00 00 00 60     nop
  111424:       00 00 e3 9b     stb     r31,0(r3)
  111428:       01 00 e3 9b     stb     r31,1(r3)
  11142c:       02 00 e3 9b     stb     r31,2(r3)
  111430:       03 00 e3 9b     stb     r31,3(r3)
  111434:       04 00 e3 9b     stb     r31,4(r3)
  111438:       05 00 e3 9b     stb     r31,5(r3)
  11143c:       06 00 e3 9b     stb     r31,6(r3)
  111440:       07 00 e3 9b     stb     r31,7(r3)
  111444:       08 00 e3 9b     stb     r31,8(r3)
  111448:       09 00 e3 9b     stb     r31,9(r3)
  11144c:       0a 00 e3 9b     stb     r31,10(r3)
  111450:       0b 00 e3 9b     stb     r31,11(r3)
  111454:       0c 00 e3 9b     stb     r31,12(r3)

If we pass -mtune=power8, then things are much better:

  1104bc:       8d eb f9 4b     bl      af048 <bcmp+0x1768>
  1104c0:       00 00 00 60     nop
  1104c4:       00 00 20 39     li      r9,0
  1104c8:       00 00 c3 93     stw     r30,0(r3)
  1104cc:       04 00 c3 93     stw     r30,4(r3)
  1104d0:       08 00 c3 93     stw     r30,8(r3)
  1104d4:       0c 00 23 99     stb     r9,12(r3)

(The reason we aren't going 64bit stores is a gcc bug which has been
fixed upstream recently)

** Affects: eglibc (Ubuntu)
     Importance: Undecided
         Status: Invalid

** Affects: glibc (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: eglibc (Ubuntu Trusty)
     Importance: Undecided
         Status: New

** Affects: glibc (Ubuntu Trusty)
     Importance: Undecided
         Status: Invalid

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1333524

Title:
  ppc64el build tunes for POWER7, produces sub optimal POWER8 code

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1333524/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to