Skip to content

Commit 9972860

Browse files
make vscale symbolic
1 parent 2dd6111 commit 9972860

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

ir/type.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,11 @@ void ArrayType::print(ostream &os) const {
10901090
}
10911091

10921092

1093+
expr VectorType::vscale() const {
1094+
return defined ? expr::mkUInt(vscale_value, var_vector_elements) :
1095+
var("vscale", var_vector_elements);
1096+
}
1097+
10931098
VectorType::VectorType(string &&name, unsigned elems, Type &elTy, bool scal)
10941099
: AggregateType(std::move(name), false), scalable(scal), min_elements(elems) {
10951100
assert(elems != 0);

ir/type.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,9 +338,10 @@ class ArrayType final : public AggregateType {
338338
class VectorType final : public AggregateType {
339339
private:
340340
bool scalable = false;
341-
unsigned min_elements;
341+
unsigned min_elements, vscale_value;
342342

343343
public:
344+
smt::expr vscale() const;
344345
VectorType(std::string &&name) : AggregateType(std::move(name)) {}
345346
VectorType(std::string &&name, unsigned elems, Type &elemTy, bool scalable);
346347

0 commit comments

Comments
 (0)