32 bit fixes (#10608)
This commit is contained in:
parent
304b1dd34b
commit
28394153ab
26 changed files with 165 additions and 135 deletions
|
|
@ -40,6 +40,11 @@ static:
|
|||
let a2 = arcsin 0.3
|
||||
doAssert a1 == a2
|
||||
|
||||
block bitxor:
|
||||
let x = -1'i32
|
||||
let y = 1'i32
|
||||
doAssert (x xor y) == -2
|
||||
|
||||
block:
|
||||
# Check against bugs like #9176
|
||||
doAssert getCurrentCompilerExe() == forceConst(getCurrentCompilerExe())
|
||||
|
|
|
|||
|
|
@ -13,14 +13,14 @@ proc get_values(): (seq[int8], seq[int16], seq[int32]) =
|
|||
result[0] = @[]; result[1] = @[]; result[2] = @[]
|
||||
|
||||
for offset in RANGE:
|
||||
let i8 = -(1 shl 9) + offset
|
||||
let i16 = -(1 shl 17) + offset
|
||||
let i32 = -(1 shl 33) + offset
|
||||
let i8 = -(1'i64 shl 9) + offset
|
||||
let i16 = -(1'i64 shl 17) + offset
|
||||
let i32 = -(1'i64 shl 33) + offset
|
||||
|
||||
# higher bits are masked. these should be exactly equal to offset.
|
||||
result[0].add i8.toU8
|
||||
result[1].add i16.toU16
|
||||
result[2].add i32.toU32
|
||||
result[0].add cast[int8 ](uint8 cast[uint64](i8 ))
|
||||
result[1].add cast[int16](uint16 cast[uint64](i16))
|
||||
result[2].add cast[int32](uint32 cast[uint64](i32))
|
||||
|
||||
|
||||
# these values this computed by VM
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue