<html>
    <head>
      <base href="http://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 --- - Redundant zeroing of high vector elements for scalar SSE/AVX instructions"
   href="http://llvm.org/bugs/show_bug.cgi?id=22788">22788</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Redundant zeroing of high vector elements for scalar SSE/AVX instructions
          </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>Windows NT
          </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: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>michael.m.kuperstein@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Using scalar x86 intrinsics results in IR similar to this:

define void @foo(double* %p, double* %q, <2 x double>* %r) {
  %v = load double, double* %p, align 16
  %w = load double, double* %q, align 16
  %mul = fmul double %v, %w
  %vec = insertelement <2 x double> <double undef, double 0.000000e+00>, double
%mul, i32 0
  store <2 x double> %vec, <2 x double>* %r, align 16
  ret void
}

This gets lowered into:
movsd   (%rcx), %xmm0           # xmm0 = mem[0],zero
mulsd   (%rdx), %xmm0
movq    %xmm0, %xmm0            # xmm0 = xmm0[0],zero
movdqa  %xmm0, (%r8)

The movq is redundant - movsd from memory zeroes the high element, and mulsd
preserves it.</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>