GitLab will be partched to the latest stable version on 15 July 2020 at 2.00pm (AEDT) to 2.30pm (AEDT) due to Security Patch Availability. During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

Commit 286db316 authored by John Zhang's avatar John Zhang

fix: construct BigInt with lower bit first

parent 39bb004b
...@@ -24,8 +24,10 @@ object IRBuilderCommInstExecutor { ...@@ -24,8 +24,10 @@ object IRBuilderCommInstExecutor {
def unsignedLongSeqToBigInt(nums: Seq[Long]): BigInt = { def unsignedLongSeqToBigInt(nums: Seq[Long]): BigInt = {
var bigNum = BigInt(0) var bigNum = BigInt(0)
var i = 0
for (num <- nums) { for (num <- nums) {
bigNum = (bigNum << 64) | (BigInt(num) & 0xffffffffffffffffL) bigNum = bigNum | ((BigInt(num) & 0xffffffffffffffffL) << 64 * i)
i += 1
} }
bigNum bigNum
} }
......
...@@ -25,8 +25,10 @@ object NativeMemoryAccessHelper { ...@@ -25,8 +25,10 @@ object NativeMemoryAccessHelper {
def unsignedLongSeqToBigInt(nums: Seq[Long]): BigInt = { def unsignedLongSeqToBigInt(nums: Seq[Long]): BigInt = {
var bigNum = BigInt(0) var bigNum = BigInt(0)
var i = 0
for (num <- nums) { for (num <- nums) {
bigNum = (bigNum << 64) | (BigInt(num) & 0xffffffffffffffffL) bigNum = bigNum | ((BigInt(num) & 0xffffffffffffffffL) << 64 * i)
i += 1
} }
bigNum bigNum
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment