0 | module Data.HashMap.Bits
6 | oneBits = 0xffff_ffff_ffff_ffff
11 | (.|.) : Bits64 -> Bits64 -> Bits64
12 | (.|.) = prim__or_Bits64
17 | (.&.) : Bits64 -> Bits64 -> Bits64
18 | (.&.) = prim__and_Bits64
21 | not : Bits64 -> Bits64
22 | not = prim__xor_Bits64 oneBits
25 | shiftR : Bits64 -> Bits64 -> Bits64
26 | shiftR = prim__shr_Bits64
29 | shiftL : Bits64 -> Bits64 -> Bits64
30 | shiftL = prim__shl_Bits64
33 | bit : Bits32 -> Bits64
34 | bit k = 1 `shiftL` cast k
37 | setBit : Bits64 -> Bits32 -> Bits64
38 | setBit x k = bit k .|. x
41 | clearBit : Bits64 -> Bits32 -> Bits64
42 | clearBit x k = not (bit k) .&. x
45 | testBit : Bits64 -> Bits32 -> Bool
46 | testBit x k = (bit k .&. x) /= 0
49 | popCount : Bits64 -> Bits64
52 | let x1 = (x0 .&. 0x5555555555555555) +
53 | ((x0 `shiftR` 1) .&. 0x5555555555555555)
54 | x2 = (x1 .&. 0x3333333333333333)
55 | + ((x1 `shiftR` 2) .&. 0x3333333333333333)
56 | x3 = ((x2 + (x2 `shiftR` 4)) .&. 0x0F0F0F0F0F0F0F0F)
57 | x4 = (x3 * 0x0101010101010101) `shiftR` 56
62 | isScheme = (codegen == "chez") || (codegen == "racket")
65 | unsafeIncr : Bits32 -> Bits32
66 | unsafeIncr x = if isScheme
67 | then believe_me $
the Nat $
believe_me x + 1
71 | unsafeCast : Cast a b => a -> b
72 | unsafeCast x = if isScheme