[llvm-dev] LLVM IR question

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[llvm-dev] LLVM IR question

Bruce Hoult via llvm-dev
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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLVM IR question

Bruce Hoult via llvm-dev
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
> [hidden email]
> 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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Reply | Threaded
Open this post in threaded view
|

Re: [llvm-dev] LLVM IR question

Bruce Hoult via llvm-dev
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 <[hidden email]> 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
> [hidden email]
> 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
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

_______________________________________________
LLVM Developers mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev