<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Suboptimal codegen for v2sf operations - should use MOVLPS"
   href="https://bugs.llvm.org/show_bug.cgi?id=46966">46966</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Suboptimal codegen for v2sf operations - should use MOVLPS
          </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>enhancement
          </td>
        </tr>

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

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

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

        <tr>
          <th>Reporter</th>
          <td>david.bolvansky@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>craig.topper@gmail.com, llvm-bugs@lists.llvm.org, llvm-dev@redking.me.uk, spatel+llvm@rotateright.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>float r[2], a[2], b[2], c[2];

void test_plus(void) {
  for (int i = 0; i < 2; i++) r[i] = a[i] + b[i];
}


Clang:
test_plus:                              # @test_plus
        movss   xmm0, dword ptr [rip + a]       # xmm0 = mem[0],zero,zero,zero
        addss   xmm0, dword ptr [rip + b]
        movss   dword ptr [rip + r], xmm0
        movss   xmm0, dword ptr [rip + a+4]     # xmm0 = mem[0],zero,zero,zero
        addss   xmm0, dword ptr [rip + b+4]
        movss   dword ptr [rip + r+4], xmm0
        ret

GCC:
test_plus:
        movq    xmm0, QWORD PTR a[rip]
        movq    xmm1, QWORD PTR b[rip]
        addps   xmm0, xmm1
        movlps  QWORD PTR r[rip], xmm0
        ret




Godbolt: <a href="https://godbolt.org/z/fnxGj1">https://godbolt.org/z/fnxGj1</a></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>