<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

Don't these have reasonably simple LLVM IR representations? For example:<br>
<br>
define <2 x i32> @addhn(<2 x i64> %lhs, <2 x i64> %rhs) {<br>
  %sum = add <2 x i64> %lhs, %rhs<br>
  %shift = shl <2 x i64> %sum, <i64 32, i64 32><br>
  %trunc = trunc <2 x i64> %shift to <2 x i32><br>
  ret <2 x i32> %trunc<br>
}<br><br></blockquote><div><br></div><div>Do you mean to use lshr instead of shl, because addhn is to get high narrow, so we could have,</div><div><br></div>define <2 x i32> @addhn(<2 x i64> %lhs, <2 x i64> %rhs) {<br>
  %sum = add <2 x i64> %lhs, %rhs<br>  %shift = lshr <2 x i64> %sum, <i64 32, i64 32><br>  %trunc = trunc <2 x i64> %shift to <2 x i32><br>  ret <2 x i32> %trunc<br>}<br><div><br></div>
<div>Thanks,</div><div>-Jiangning</div></div>
</div></div>