<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 - s390x/systemz: ctpop.v16i8 "has incorrect return type""
   href="https://bugs.llvm.org/show_bug.cgi?id=39730">39730</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>s390x/systemz: ctpop.v16i8 "has incorrect return type"
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>new bugs
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>danielwatson311@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Getting this error when linking to LLVM's ctpop intrinsic on s390x:

Intrinsic has incorrect return type!
void (<16 x i8>*, <16 x i8>*)* @llvm.ctpop.v16i8
LLVM ERROR: Broken function found, compilation aborted!

With the following code (Rust):


    #![feature(repr_simd, link_llvm_intrinsics, simd_ffi)]

    #[repr(simd)]
    pub struct u8x16(u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8, u8,
u8, u8,);

    extern {
        #[link_name = "llvm.ctpop.v16i8"]
        fn ctpop_u8x16(x: u8x16) -> u8x16;
    }

    pub fn ctpop(x: u8x16) -> u8x16 {
        unsafe { ctpop_u8x16(x) }
    }



Full code: <a href="https://github.com/rust-lang-nursery/packed_simd/pull/190">https://github.com/rust-lang-nursery/packed_simd/pull/190</a>

I attempted to find a minimal example but found none:
<a href="https://godbolt.org/z/_nnrkF">https://godbolt.org/z/_nnrkF</a>

LLVM: 8.0.0svn</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>