aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2022-01-10 11:19:44 -0800
committerEric Kunze <eric.kunze@arm.com>2022-01-14 14:16:33 -0800
commitdccd71842e307faa0047755ab49751b2e28e2e35 (patch)
tree39a4ba1971f8b4a9472002e705597b726a9b6c05
parent3765888e5b2ca8c826edad0d9c90261573af4fce (diff)
downloadtosa_mlir_translator-dccd71842e307faa0047755ab49751b2e28e2e35.tar.gz
Fix serialization of int48 values
Pull out of DenseElementAttr as APInt and extract uint64 for serializing Change-Id: Ib261c0e306bd4461b7ce9df21f90db966a1d0faf
-rw-r--r--src/TosaSerialize.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/TosaSerialize.cpp b/src/TosaSerialize.cpp
index 3c95c75..ae5e9c6 100644
--- a/src/TosaSerialize.cpp
+++ b/src/TosaSerialize.cpp
@@ -1,5 +1,5 @@
-// Copyright (c) 2020-2021, ARM Limited.
+// Copyright (c) 2020-2022, ARM Limited.
//
// Licensed under the Apache License, Version 2.0 with LLVM Exceptions
// (the "License"); you may not use this file except in compliance with
@@ -520,7 +520,8 @@ TosaSerializationOperatorBuilder::build<mlir::tosa::ConstOp>(
op.getAttr(llvm::StringRef("value")).dyn_cast<mlir::IntegerAttr>();
if (dense_attr) {
- for (auto val : dense_attr.getValues<int64_t>()) {
+ for (auto valueIt : dense_attr.getValues<mlir::APInt>()) {
+ uint64_t val = valueIt.getLimitedValue();
data.push_back(val);
}
} else if (val_attr) {