From dccd71842e307faa0047755ab49751b2e28e2e35 Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Mon, 10 Jan 2022 11:19:44 -0800 Subject: Fix serialization of int48 values Pull out of DenseElementAttr as APInt and extract uint64 for serializing Change-Id: Ib261c0e306bd4461b7ce9df21f90db966a1d0faf --- src/TosaSerialize.cpp | 5 +++-- 1 file 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( op.getAttr(llvm::StringRef("value")).dyn_cast(); if (dense_attr) { - for (auto val : dense_attr.getValues()) { + for (auto valueIt : dense_attr.getValues()) { + uint64_t val = valueIt.getLimitedValue(); data.push_back(val); } } else if (val_attr) { -- cgit v1.2.1