Cameron McInally via llvm-dev
2020-Jul-07 14:52 UTC
[llvm-dev] BUILD_VECTOR disambiguation
Hey devs,>From ISDOpcodes.h.../// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector /// with the specified, possibly variable, elements. The number of elements /// is required to be a power of two. The types of the operands must all be /// the same and must match the vector element type, except that integer types /// are allowed to be larger than the element type, in which case the operands /// are implicitly truncated. BUILD_VECTOR, Must the operand types always be the same? Or could we see a BUILD_VECTOR with mixed integer types? E.g.: BUILD_VECTOR(i32, i32, i64, i32) Thanks, Cam
On Tue, Jul 7, 2020 at 5:52 PM Cameron McInally via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > Hey devs, > > From ISDOpcodes.h... > > /// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector > /// with the specified, possibly variable, elements. The number of elements > /// is required to be a power of two. The types of the operands must all be > /// the same and must match the vector element type, except that integer types> /// The types of the operands must all be the same and must match the vector element type,^ ?> /// are allowed to be larger than the element type, in which case the operands > /// are implicitly truncated. > BUILD_VECTOR, > > Must the operand types always be the same? Or could we see a > BUILD_VECTOR with mixed integer types? E.g.: > > BUILD_VECTOR(i32, i32, i64, i32) > > Thanks, > Cam > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Krzysztof Parzyszek via llvm-dev
2020-Jul-07 14:58 UTC
[llvm-dev] BUILD_VECTOR disambiguation
Mixed integer types are ok, but the values will get truncated to the element type of the output value. It's pretty much what the comment says. -- Krzysztof Parzyszek kparzysz at quicinc.com AI tools development> -----Original Message----- > From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Cameron > McInally via llvm-dev > Sent: Tuesday, July 7, 2020 9:53 AM > To: LLVM Developers Mailing List <llvm-dev at lists.llvm.org> > Subject: [EXT] [llvm-dev] BUILD_VECTOR disambiguation > > Hey devs, > > From ISDOpcodes.h... > > /// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector > /// with the specified, possibly variable, elements. The number of elements > /// is required to be a power of two. The types of the operands must all be > /// the same and must match the vector element type, except that integer > types /// are allowed to be larger than the element type, in which case the > operands /// are implicitly truncated. > BUILD_VECTOR, > > Must the operand types always be the same? Or could we see a BUILD_VECTOR > with mixed integer types? E.g.: > > BUILD_VECTOR(i32, i32, i64, i32) > > Thanks, > Cam > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Cameron McInally via llvm-dev
2020-Jul-07 15:10 UTC
[llvm-dev] BUILD_VECTOR disambiguation
Thanks for the clarification. The `except` seemed dangling to me, but it's early here. Just curious... how do we end up with a mixed type BUILD_VECTOR? That's counterintuitive. On Tue, Jul 7, 2020 at 10:58 AM Krzysztof Parzyszek via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > Mixed integer types are ok, but the values will get truncated to the element type of the output value. It's pretty much what the comment says. > > -- > Krzysztof Parzyszek kparzysz at quicinc.com AI tools development > > > -----Original Message----- > > From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of Cameron > > McInally via llvm-dev > > Sent: Tuesday, July 7, 2020 9:53 AM > > To: LLVM Developers Mailing List <llvm-dev at lists.llvm.org> > > Subject: [EXT] [llvm-dev] BUILD_VECTOR disambiguation > > > > Hey devs, > > > > From ISDOpcodes.h... > > > > /// BUILD_VECTOR(ELT0, ELT1, ELT2, ELT3,...) - Return a fixed-width vector > > /// with the specified, possibly variable, elements. The number of elements > > /// is required to be a power of two. The types of the operands must all be > > /// the same and must match the vector element type, except that integer > > types /// are allowed to be larger than the element type, in which case the > > operands /// are implicitly truncated. > > BUILD_VECTOR, > > > > Must the operand types always be the same? Or could we see a BUILD_VECTOR > > with mixed integer types? E.g.: > > > > BUILD_VECTOR(i32, i32, i64, i32) > > > > Thanks, > > Cam