@@ -32,6 +32,11 @@ template <typename ISelOp> class ByteProvider {
3232 ByteProvider (std::optional<ISelOp> Src, int64_t DestOffset, int64_t SrcOffset)
3333 : Src(Src), DestOffset(DestOffset), SrcOffset(SrcOffset) {}
3434
35+ ByteProvider (std::optional<ISelOp> Src, int64_t DestOffset, int64_t SrcOffset,
36+ std::optional<bool > IsSigned)
37+ : Src(Src), DestOffset(DestOffset), SrcOffset(SrcOffset),
38+ IsSigned (IsSigned) {}
39+
3540 // TODO -- use constraint in c++20
3641 // Does this type correspond with an operation in selection DAG
3742 template <typename T> class is_op {
@@ -61,6 +66,9 @@ template <typename ISelOp> class ByteProvider {
6166 // DestOffset
6267 int64_t SrcOffset = 0 ;
6368
69+ // Whether or not the path to this Src involved signed extensions
70+ std::optional<bool > IsSigned;
71+
6472 ByteProvider () = default;
6573
6674 static ByteProvider getSrc (std::optional<ISelOp> Val, int64_t ByteOffset,
@@ -70,6 +78,14 @@ template <typename ISelOp> class ByteProvider {
7078 return ByteProvider (Val, ByteOffset, VectorOffset);
7179 }
7280
81+ static ByteProvider getSrc (std::optional<ISelOp> Val, int64_t ByteOffset,
82+ int64_t VectorOffset,
83+ std::optional<bool > IsSigned) {
84+ static_assert (is_op<ISelOp>().value ,
85+ " ByteProviders must contain an operation in selection DAG." );
86+ return ByteProvider (Val, ByteOffset, VectorOffset, IsSigned);
87+ }
88+
7389 static ByteProvider getConstantZero () {
7490 return ByteProvider<ISelOp>(std::nullopt , 0 , 0 );
7591 }
0 commit comments