<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 - extractelement on <5 x i3> always returns zeroth element"
   href="https://bugs.llvm.org/show_bug.cgi?id=44915">44915</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>extractelement on <5 x i3> always returns zeroth element
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>9.0
          </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: X86
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>llvm@henning-thielemann.de
          </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>$ cat extract.ll
target triple = "x86_64-pc-linux-gnu"

define i32 @extract3(i15*, i32) {
_L1:
  %2 = load i15, i15* %0
  %3 = bitcast i15 %2 to <5 x i3>
  %4 = extractelement <5 x i3> %3, i32 %1
  %5 = zext i3 %4 to i32
  ret i32 %5
}

$ llc-9 <extract.ll
        .text
        .file   "<stdin>"
        .globl  extract3                # -- Begin function extract3
        .p2align        4, 0x90
        .type   extract3,@function
extract3:                               # @extract3
        .cfi_startproc
# %bb.0:                                # %_L1
                                        # kill: def $esi killed $esi def $rsi
        movzbl  (%rdi), %eax
        movd    %eax, %xmm0
        pinsrw  $1, %eax, %xmm0
        pinsrw  $2, %eax, %xmm0
        pinsrw  $3, %eax, %xmm0
        pinsrw  $4, %eax, %xmm0
        movdqa  %xmm0, -24(%rsp)
        andl    $7, %esi
        movzwl  -24(%rsp,%rsi,2), %eax
        andl    $7, %eax
        retq
.Lfunc_end0:
        .size   extract3, .Lfunc_end0-extract3
        .cfi_endproc
                                        # -- End function

        .section        ".note.GNU-stack","",@progbits



It seems there are some shifts and masks missing.
And if it would shift and mask it do not need to roundtrip through xmm0.</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>