This works too:
%1 = insertelement <2 x i8> undef, i8 %src0, 0
%2 = insertelement <2 x i8> %1, i8 %src1, 1
%3 = bitcast <2 x i8> %2 to i16
Not sure if one way is better than the other.
On Wed, Jun 6, 2018 at 5:50 AM Krzysztof Parzyszek via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
> Zero-extend both to i16, shift one left by 8, then or. Same for all
> other integer scalar types.
>
> There isn't any operator to do that, except maybe for some
> target-specific intrinsics.
>
> -Krzysztof
>
> On 6/5/2018 6:40 PM, Kenneth Adam Miller via llvm-dev wrote:
> > Is there an easy straightforward way to concatenate to types into a
> > single larger type?
> >
> > Such as from i8 i8 to i16?
> >
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> >
>
> --
> Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
> hosted by The Linux Foundation
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://lists.llvm.org/pipermail/llvm-dev/attachments/20180606/98ea127d/attachment.html>