blob: 3eb9122d156e723e3065875561a36f2a2b5c2048 [file] [log] [blame]
/*
* Copyright 2010-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
* that can be found in the license/LICENSE.txt file.
*/
package kotlin.js
// TODO: Polyfill
internal fun imul(a_local: Int, b_local: Int): Int {
val lhs = jsBitwiseAnd(a_local, js("0xffff0000")).toDouble() * jsBitwiseAnd(b_local, 0xffff).toDouble()
val rhs = jsBitwiseAnd(a_local, 0xffff).toDouble() * b_local.toDouble()
return jsBitwiseOr(lhs + rhs, 0)
}