mirror of
https://github.com/status-im/constantine.git
synced 2025-02-23 09:28:07 +00:00
Properly handle 32 bits
This commit is contained in:
parent
3fdd457b52
commit
c8e482f6d2
@ -75,9 +75,10 @@ func unsafeFMA2_hi*(hi: var Ct[uint32], a1, b1, a2, b2, c1: Ct[uint32]) {.inline
|
|||||||
#
|
#
|
||||||
# ############################################################
|
# ############################################################
|
||||||
|
|
||||||
|
when sizeof(int) == 8:
|
||||||
const GccCompatible = defined(gcc) or defined(clang) or defined(llvm_gcc)
|
const GccCompatible = defined(gcc) or defined(clang) or defined(llvm_gcc)
|
||||||
|
|
||||||
when sizeof(int) == 8 and GccCompatible:
|
when GccCompatible:
|
||||||
type
|
type
|
||||||
uint128*{.importc: "unsigned __int128".} = object
|
uint128*{.importc: "unsigned __int128".} = object
|
||||||
|
|
||||||
@ -159,7 +160,7 @@ when sizeof(int) == 8 and GccCompatible:
|
|||||||
# Don't forget to dereference the var param
|
# Don't forget to dereference the var param
|
||||||
{.emit:["*",hi, " = (NU64)(", dblPrec," >> ", 63'u64, ");"].}
|
{.emit:["*",hi, " = (NU64)(", dblPrec," >> ", 63'u64, ");"].}
|
||||||
|
|
||||||
elif sizeof(int) == 8 and defined(vcc):
|
elif defined(vcc):
|
||||||
func udiv128(highDividend, lowDividend, divisor: uint64, remainder: var uint64): uint64 {.importc:"_udiv128", header: "<immintrin.h>", nodecl.}
|
func udiv128(highDividend, lowDividend, divisor: uint64, remainder: var uint64): uint64 {.importc:"_udiv128", header: "<immintrin.h>", nodecl.}
|
||||||
## Division 128 by 64, Microsoft only, 64-bit only,
|
## Division 128 by 64, Microsoft only, 64-bit only,
|
||||||
## returns quotient as return value remainder as var parameter
|
## returns quotient as return value remainder as var parameter
|
||||||
|
Loading…
x
Reference in New Issue
Block a user