@@ -32,6 +32,11 @@ template <typename ISelOp> class ByteProvider {
32
32
ByteProvider (std::optional<ISelOp> Src, int64_t DestOffset, int64_t SrcOffset)
33
33
: Src(Src), DestOffset(DestOffset), SrcOffset(SrcOffset) {}
34
34
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
+
35
40
// TODO -- use constraint in c++20
36
41
// Does this type correspond with an operation in selection DAG
37
42
template <typename T> class is_op {
@@ -61,6 +66,9 @@ template <typename ISelOp> class ByteProvider {
61
66
// DestOffset
62
67
int64_t SrcOffset = 0 ;
63
68
69
+ // Whether or not the path to this Src involved signed extensions
70
+ std::optional<bool > IsSigned;
71
+
64
72
ByteProvider () = default;
65
73
66
74
static ByteProvider getSrc (std::optional<ISelOp> Val, int64_t ByteOffset ,
@@ -70,6 +78,14 @@ template <typename ISelOp> class ByteProvider {
70
78
return ByteProvider (Val, ByteOffset , VectorOffset);
71
79
}
72
80
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
+
73
89
static ByteProvider getConstantZero () {
74
90
return ByteProvider<ISelOp>(std::nullopt, 0 , 0 );
75
91
}
0 commit comments