<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - inefficient floating point register ld/st instructions are generated when -mcpu=power8 is specified"
   href="https://llvm.org/bugs/show_bug.cgi?id=24817">24817</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>inefficient floating point register ld/st instructions are generated when -mcpu=power8 is specified
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Backend: PowerPC
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>carrot@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The simple test case is:

int foo(float *p)
{
  float f1 = p[1];
  float f2 = p[2];
  return f1 > f2;
}

Compiler command line and output

clang -S t8.c --target=powerpc -m64 -mcpu=power8 -O2
    li 4, 4             // A
    li 5, 8             // B
    lxsspx 0, 3, 4      // C
    lxsspx 1, 3, 5      // D
    li 3, 0
    li 4, 1
    fcmpu 0, 0, 1
    isel 3, 4, 3, 1
    blr


If I change -mcpu=power8 to -mcpu=power7, I got

    lfs 0, 4(3)        // E
    lfs 1, 8(3)        // F
    li 3, 0
    li 4, 1
    fcmpu 0, 0, 1
    isel 3, 4, 3, 1
    blr

Instructions AC are replaced by E
Instructions BD are replaced by F</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>