aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEduardo Julian2018-05-06 03:30:47 -0400
committerEduardo Julian2018-05-06 03:30:47 -0400
commite65e734e5df3746ffb7df2cc9fa33826e0083fcd (patch)
treec67b1105a4b421d527804ccbfcab4d29ec20e744
parentf5a6fe62a612c0727063fa9e530d53ddda5fcd82 (diff)
- Re-named shift-left -> left-shift, shift-right -> logical-right-shift, signed-shift-right -> arithmetic-right-shift.
-rw-r--r--luxc/src/lux/analyser/proc/common.clj12
-rw-r--r--luxc/src/lux/compiler/js/proc/common.clj12
-rw-r--r--luxc/src/lux/compiler/jvm/proc/common.clj12
-rw-r--r--new-luxc/source/luxc/lang/extension/analysis/common.lux6
-rw-r--r--new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux14
-rw-r--r--new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/js.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/js/eval.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux30
-rw-r--r--new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux14
-rw-r--r--new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux40
-rw-r--r--new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/r/eval.jvm.lux4
-rw-r--r--new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux42
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux14
-rw-r--r--new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux8
-rw-r--r--new-luxc/test/test/luxc/lang/analysis/procedure/common.lux6
-rw-r--r--new-luxc/test/test/luxc/lang/translation/common.lux18
-rw-r--r--new-luxc/test/test/luxc/lang/translation/jvm.lux6
-rw-r--r--stdlib/source/lux/data/bit.lux20
-rw-r--r--stdlib/source/lux/data/coll/dictionary/unordered.lux10
-rw-r--r--stdlib/source/lux/data/coll/sequence.lux18
-rw-r--r--stdlib/source/lux/data/number.lux10
-rw-r--r--stdlib/source/lux/macro/poly/json.lux8
-rw-r--r--stdlib/source/lux/math/random.lux16
-rw-r--r--stdlib/source/lux/world/blob.jvm.lux46
-rw-r--r--stdlib/test/test/lux/data/bit.lux4
-rw-r--r--stdlib/test/test/lux/world/blob.lux6
37 files changed, 232 insertions, 268 deletions
diff --git a/luxc/src/lux/analyser/proc/common.clj b/luxc/src/lux/analyser/proc/common.clj
index 80271f9e7..9a90c219e 100644
--- a/luxc/src/lux/analyser/proc/common.clj
+++ b/luxc/src/lux/analyser/proc/common.clj
@@ -154,9 +154,9 @@
(return (&/|list (&&/|meta exo-type _cursor
(&&/$proc (&/T ["bit" <op>]) (&/|list =input =shift) (&/|list)))))))
- ^:private analyse-bit-shift-left "shift-left" &type/Nat
- ^:private analyse-bit-shift-right "shift-right" &type/Int
- ^:private analyse-bit-unsigned-shift-right "unsigned-shift-right" &type/Nat
+ ^:private analyse-bit-left-shift "left-shift" &type/Nat
+ ^:private analyse-bit-arithmetic-right-shift "arithmetic-right-shift" &type/Int
+ ^:private analyse-bit-logical-right-shift "logical-right-shift" &type/Nat
)
(do-template [<name> <proc> <input-type> <output-type>]
@@ -502,9 +502,9 @@
"lux bit and" (analyse-bit-and analyse exo-type ?values)
"lux bit or" (analyse-bit-or analyse exo-type ?values)
"lux bit xor" (analyse-bit-xor analyse exo-type ?values)
- "lux bit shift-left" (analyse-bit-shift-left analyse exo-type ?values)
- "lux bit shift-right" (analyse-bit-shift-right analyse exo-type ?values)
- "lux bit unsigned-shift-right" (analyse-bit-unsigned-shift-right analyse exo-type ?values)
+ "lux bit left-shift" (analyse-bit-left-shift analyse exo-type ?values)
+ "lux bit arithmetic-right-shift" (analyse-bit-arithmetic-right-shift analyse exo-type ?values)
+ "lux bit logical-right-shift" (analyse-bit-logical-right-shift analyse exo-type ?values)
"lux array new" (analyse-array-new analyse exo-type ?values)
"lux array get" (analyse-array-get analyse exo-type ?values)
diff --git a/luxc/src/lux/compiler/js/proc/common.clj b/luxc/src/lux/compiler/js/proc/common.clj
index 7044f8447..c70ea6f9e 100644
--- a/luxc/src/lux/compiler/js/proc/common.clj
+++ b/luxc/src/lux/compiler/js/proc/common.clj
@@ -33,9 +33,9 @@
=param (compile ?param)]
(return (str "LuxRT$" <op> "(" =input "," =param ".L)"))))
- ^:private compile-bit-shift-left "shlI64"
- ^:private compile-bit-shift-right "shrI64"
- ^:private compile-bit-unsigned-shift-right "ushrI64"
+ ^:private compile-bit-left-shift "shlI64"
+ ^:private compile-bit-arithmetic-right-shift "shrI64"
+ ^:private compile-bit-logical-right-shift "ushrI64"
)
(defn ^:private compile-bit-count [compile ?values special-args]
@@ -445,9 +445,9 @@
"and" (compile-bit-and compile ?values special-args)
"or" (compile-bit-or compile ?values special-args)
"xor" (compile-bit-xor compile ?values special-args)
- "shift-left" (compile-bit-shift-left compile ?values special-args)
- "shift-right" (compile-bit-shift-right compile ?values special-args)
- "unsigned-shift-right" (compile-bit-unsigned-shift-right compile ?values special-args))
+ "left-shift" (compile-bit-left-shift compile ?values special-args)
+ "arithmetic-right-shift" (compile-bit-arithmetic-right-shift compile ?values special-args)
+ "logical-right-shift" (compile-bit-logical-right-shift compile ?values special-args))
"array"
(case proc
diff --git a/luxc/src/lux/compiler/jvm/proc/common.clj b/luxc/src/lux/compiler/jvm/proc/common.clj
index 138a56a26..fdd5f8c8a 100644
--- a/luxc/src/lux/compiler/jvm/proc/common.clj
+++ b/luxc/src/lux/compiler/jvm/proc/common.clj
@@ -156,9 +156,9 @@
&&/wrap-long)]]
(return nil)))
- ^:private compile-bit-shift-left Opcodes/LSHL
- ^:private compile-bit-shift-right Opcodes/LSHR
- ^:private compile-bit-unsigned-shift-right Opcodes/LUSHR
+ ^:private compile-bit-left-shift Opcodes/LSHL
+ ^:private compile-bit-arithmetic-right-shift Opcodes/LSHR
+ ^:private compile-bit-logical-right-shift Opcodes/LUSHR
)
(defn ^:private compile-lux-is [compile ?values special-args]
@@ -836,9 +836,9 @@
"and" (compile-bit-and compile ?values special-args)
"or" (compile-bit-or compile ?values special-args)
"xor" (compile-bit-xor compile ?values special-args)
- "shift-left" (compile-bit-shift-left compile ?values special-args)
- "shift-right" (compile-bit-shift-right compile ?values special-args)
- "unsigned-shift-right" (compile-bit-unsigned-shift-right compile ?values special-args))
+ "left-shift" (compile-bit-left-shift compile ?values special-args)
+ "arithmetic-right-shift" (compile-bit-arithmetic-right-shift compile ?values special-args)
+ "logical-right-shift" (compile-bit-logical-right-shift compile ?values special-args))
"array"
(case proc
diff --git a/new-luxc/source/luxc/lang/extension/analysis/common.lux b/new-luxc/source/luxc/lang/extension/analysis/common.lux
index 220613dbf..c63d063cd 100644
--- a/new-luxc/source/luxc/lang/extension/analysis/common.lux
+++ b/new-luxc/source/luxc/lang/extension/analysis/common.lux
@@ -204,9 +204,9 @@
(install "and" (binary Nat Nat Nat))
(install "or" (binary Nat Nat Nat))
(install "xor" (binary Nat Nat Nat))
- (install "shift-left" (binary Nat Nat Nat))
- (install "unsigned-shift-right" (binary Nat Nat Nat))
- (install "shift-right" (binary Int Nat Int))
+ (install "left-shift" (binary Nat Nat Nat))
+ (install "logical-right-shift" (binary Nat Nat Nat))
+ (install "arithmetic-right-shift" (binary Int Nat Int))
)))
(def: nat-procs
diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
index fe9fe43be..27a92c1cc 100644
--- a/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/common-lisp/procedure/common.jvm.lux
@@ -157,18 +157,18 @@
[bit//xor _.logxor]
)
-(def: (bit//shift-left [subjectO paramO])
+(def: (bit//left-shift [subjectO paramO])
Binary
(_.ash (_.rem (_.int 64) paramO) subjectO))
-(def: (bit//signed-shift-right [subjectO paramO])
+(def: (bit//arithmetic-right-shift [subjectO paramO])
Binary
(_.ash (|> paramO (_.rem (_.int 64)) (_.* (_.int -1)))
subjectO))
-(def: (bit//shift-right [subjectO paramO])
+(def: (bit//logical-right-shift [subjectO paramO])
Binary
- (runtimeT.bit//shift-right (_.rem (_.int 64) paramO) subjectO))
+ (runtimeT.bit//logical-right-shift (_.rem (_.int 64) paramO) subjectO))
(def: bit-procs
Bundle
@@ -177,9 +177,9 @@
(install "and" (binary bit//and))
(install "or" (binary bit//or))
(install "xor" (binary bit//xor))
- (install "shift-left" (binary bit//shift-left))
- (install "unsigned-shift-right" (binary bit//shift-right))
- (install "shift-right" (binary bit//signed-shift-right))
+ (install "left-shift" (binary bit//left-shift))
+ (install "logical-right-shift" (binary bit//logical-right-shift))
+ (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
)))
## [[Arrays]]
diff --git a/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux
index 33f72b995..96393c970 100644
--- a/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/common-lisp/runtime.jvm.lux
@@ -195,7 +195,7 @@
@@product//right
@@sum//get)))
-(runtime: (bit//shift-right shift input)
+(runtime: (bit//logical-right-shift shift input)
(_.if (_.= (_.int 0) (@@ shift))
(@@ input)
(|> (@@ input)
@@ -204,7 +204,7 @@
(def: runtime//bit
Runtime
- (_.progn (list @@bit//shift-right)))
+ (_.progn (list @@bit//logical-right-shift)))
(do-template [<name> <top-cmp>]
[(def: (<name> top value)
diff --git a/new-luxc/source/luxc/lang/translation/js.lux b/new-luxc/source/luxc/lang/translation/js.lux
index b318c7fbc..3e9b1b143 100644
--- a/new-luxc/source/luxc/lang/translation/js.lux
+++ b/new-luxc/source/luxc/lang/translation/js.lux
@@ -222,9 +222,9 @@
(def: low-mask
Nat
- (|> +1 (bit.shift-left +32) n/dec))
+ (|> +1 (bit.left-shift +32) n/dec))
-(def: #export high (-> Nat Nat) (bit.shift-right +32))
+(def: #export high (-> Nat Nat) (bit.logical-right-shift +32))
(def: #export low (-> Nat Nat) (bit.and low-mask))
(interface: IntValue
diff --git a/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux
index 3d4dbc782..5b2499eb0 100644
--- a/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/eval.jvm.lux
@@ -64,9 +64,9 @@
[[(Number::longValue [] (:! Number high))
(Number::longValue [] (:! Number low))]
[high low]])
- (#.Some (nat-to-int (n/+ (|> high (:! Nat) (bit.shift-left +32))
+ (#.Some (nat-to-int (n/+ (|> high (:! Nat) (bit.left-shift +32))
(if (i/< 0 (:! Int low))
- (|> low (:! Nat) (bit.shift-left +32) (bit.shift-right +32))
+ (|> low (:! Nat) (bit.left-shift +32) (bit.logical-right-shift +32))
(|> low (:! Nat))))))
_
diff --git a/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux b/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux
index 2e1bf8389..270fa510d 100644
--- a/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/primitive.jvm.lux
@@ -13,12 +13,12 @@
(-> Bool (Meta Expression))
(|>> %b meta/wrap))
-(def: low-mask Nat (n/dec (bit.shift-left +32 +1)))
+(def: low-mask Nat (n/dec (bit.left-shift +32 +1)))
(def: #export (translate-nat value)
(-> Nat (Meta Expression))
(let [high (|> value
- (bit.shift-right +32)
+ (bit.logical-right-shift +32)
nat-to-int %i)
low (|> value
(bit.and low-mask)
diff --git a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
index 15c48a138..14e37efb8 100644
--- a/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/procedure/common.jvm.lux
@@ -163,9 +163,9 @@
(let [simple-param (format runtimeT.int//to-number "(" paramJS ")")]
(format <op> "(" subjectJS "," simple-param ")")))]
- [bit//shift-left runtimeT.bit//shift-left]
- [bit//shift-right runtimeT.bit//signed-shift-right]
- [bit//unsigned-shift-right runtimeT.bit//shift-right]
+ [bit//left-shift runtimeT.bit//left-shift]
+ [bit//arithmetic-right-shift runtimeT.bit//arithmetic-right-shift]
+ [bit//logical-right-shift runtimeT.bit//logical-right-shift]
)
(def: (bit//count subjectJS)
@@ -474,9 +474,9 @@
(install "and" (binary bit//and))
(install "or" (binary bit//or))
(install "xor" (binary bit//xor))
- (install "shift-left" (binary bit//shift-left))
- (install "unsigned-shift-right" (binary bit//unsigned-shift-right))
- (install "shift-right" (binary bit//shift-right))
+ (install "left-shift" (binary bit//left-shift))
+ (install "logical-right-shift" (binary bit//logical-right-shift))
+ (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
)))
(def: nat-procs
diff --git a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux
index 2adb118f8..afb3cd538 100644
--- a/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/js/runtime.jvm.lux
@@ -310,7 +310,7 @@
"return " cast ";"
"})")))
-(runtime: bit//shift-left "shlI64"
+(runtime: bit//left-shift "shlI64"
(format "(function " @ "(input,shift) {"
"shift &= 63;"
(format "if(shift === 0) {"
@@ -329,7 +329,7 @@
"}")
"})"))
-(runtime: bit//signed-shift-right "shrI64"
+(runtime: bit//arithmetic-right-shift "shrI64"
(format "(function " @ "(input,shift) {"
"shift &= 63;"
(format "if(shift === 0) {"
@@ -349,7 +349,7 @@
"}")
"})"))
-(runtime: bit//shift-right "ushrI64"
+(runtime: bit//logical-right-shift "ushrI64"
(format "(function " @ "(input,shift) {"
"shift &= 63;"
(format "if(shift === 0) {"
@@ -379,9 +379,9 @@
__bit//not
__bit//count32
__bit//count
- __bit//shift-left
- __bit//signed-shift-right
- __bit//shift-right))
+ __bit//left-shift
+ __bit//arithmetic-right-shift
+ __bit//logical-right-shift))
(runtime: int//- "subI64"
(format "(function " @ "(l,r) {"
@@ -494,8 +494,8 @@
[(=I int//min "parameter")
(js.return! int//one)])
(js.block! (list (js.var! "approximation"
- (#.Some (js.apply bit//shift-left
- (list (recur (js.apply bit//signed-shift-right
+ (#.Some (js.apply bit//left-shift
+ (list (recur (js.apply bit//arithmetic-right-shift
(list "subject" (js.number 1.0)))
"parameter")
(js.number 1.0)))))
@@ -628,7 +628,7 @@
[(>N "subject" "parameter")
(js.return! int//zero)]
- [(>N (js.apply bit//shift-right
+ [(>N (js.apply bit//logical-right-shift
(list "subject" (js.number 1.0)))
"parameter")
(js.return! int//one)])
@@ -684,11 +684,11 @@
"var lH = " int//from-number "(l.H);"
"var rH = " int//from-number "(r.H);"
- "var bottom = " bit//shift-right "(" int//* "(lL,rL),32);"
+ "var bottom = " bit//logical-right-shift "(" int//* "(lL,rL),32);"
"var middle = " int//+ "(" int//* "(lH,rL)," int//* "(lL,rH));"
"var top = " int//* "(lH,rH);"
- "var bottomAndMiddle = " bit//shift-right "(" int//+ "(middle,bottom),32);"
+ "var bottomAndMiddle = " bit//logical-right-shift "(" int//+ "(middle,bottom),32);"
"return " int//+ "(top,bottomAndMiddle);"
"})"))
@@ -698,7 +698,7 @@
"var zeroes = 64;"
(format "while(!" int//= "(input," int//zero ")) {"
"zeroes--;"
- "input = " bit//shift-right "(input,1);"
+ "input = " bit//logical-right-shift "(input,1);"
"}")
"return zeroes;"
"})"))
@@ -710,9 +710,9 @@
"}"
"else {"
"var minShift = Math.min(" deg//leading-zeroes "(l), " deg//leading-zeroes "(r));"
- "l = " bit//shift-left "(l,minShift);"
- "r = " bit//shift-left "(r,minShift);"
- "return " bit//shift-left "(" int/// "(l," int//from-number "(r.H)),32);"
+ "l = " bit//left-shift "(l,minShift);"
+ "r = " bit//left-shift "(r,minShift);"
+ "return " bit//left-shift "(" int/// "(l," int//from-number "(r.H)),32);"
"}")
"})"))
diff --git a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
index 8289fdf5a..3a5cc9b70 100644
--- a/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/jvm/procedure/common.jvm.lux
@@ -220,9 +220,9 @@
<op>
($i.wrap #$.Long)))]
- [bit//shift-left $i.LSHL]
- [bit//shift-right $i.LSHR]
- [bit//unsigned-shift-right $i.LUSHR]
+ [bit//left-shift $i.LSHL]
+ [bit//arithmetic-right-shift $i.LSHR]
+ [bit//logical-right-shift $i.LUSHR]
)
## [[Arrays]]
@@ -618,9 +618,9 @@
(install "and" (binary bit//and))
(install "or" (binary bit//or))
(install "xor" (binary bit//xor))
- (install "shift-left" (binary bit//shift-left))
- (install "unsigned-shift-right" (binary bit//unsigned-shift-right))
- (install "shift-right" (binary bit//shift-right))
+ (install "left-shift" (binary bit//left-shift))
+ (install "logical-right-shift" (binary bit//logical-right-shift))
+ (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
)))
(def: nat-procs
diff --git a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
index 2bef7cbcf..bdba05a9d 100644
--- a/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/lua/procedure/common.jvm.lux
@@ -154,9 +154,9 @@
Binary
(<op> paramO subjectO))]
- [bit//shift-left lua.bit-shl]
- [bit//shift-right lua.bit-shr]
- [bit//unsigned-shift-right runtimeT.bit//shift-right]
+ [bit//left-shift lua.bit-shl]
+ [bit//arithmetic-right-shift lua.bit-shr]
+ [bit//logical-right-shift runtimeT.bit//logical-right-shift]
)
(def: bit//count
@@ -461,9 +461,9 @@
(install "and" (binary bit//and))
(install "or" (binary bit//or))
(install "xor" (binary bit//xor))
- (install "shift-left" (binary bit//shift-left))
- (install "unsigned-shift-right" (binary bit//unsigned-shift-right))
- (install "shift-right" (binary bit//shift-right))
+ (install "left-shift" (binary bit//left-shift))
+ (install "logical-right-shift" (binary bit//logical-right-shift))
+ (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
)))
(def: nat-procs
diff --git a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux
index e0b037bf5..64253b1c3 100644
--- a/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/lua/runtime.jvm.lux
@@ -176,7 +176,7 @@
@@product//right
@@sum//get))
-(runtime: (bit//shift-right param subject)
+(runtime: (bit//logical-right-shift param subject)
(let [mask (|> (lua.int 1)
(lua.bit-shl (lua.- param (lua.int 64)))
(lua.- (lua.int 1)))]
@@ -195,7 +195,7 @@
(def: runtime//bit
Runtime
(format @@bit//count
- @@bit//shift-right))
+ @@bit//logical-right-shift))
(runtime: (nat//< param subject)
(lua.return! (lua.apply "math.ult" (list subject param))))
@@ -234,24 +234,24 @@
(runtime: (deg//* param subject)
(lua.block! (list (lua.local! "sL" (#.Some (lua.bit-and deg//low-mask subject)))
- (lua.local! "sH" (#.Some (bit//shift-right (lua.int 32) subject)))
+ (lua.local! "sH" (#.Some (bit//logical-right-shift (lua.int 32) subject)))
(lua.local! "pL" (#.Some (lua.bit-and deg//low-mask param)))
- (lua.local! "pH" (#.Some (bit//shift-right (lua.int 32) param)))
- (lua.local! "bottom" (#.Some (bit//shift-right (lua.int 32)
+ (lua.local! "pH" (#.Some (bit//logical-right-shift (lua.int 32) param)))
+ (lua.local! "bottom" (#.Some (bit//logical-right-shift (lua.int 32)
(lua.* "pL" "sL"))))
(lua.local! "middle" (#.Some (lua.+ (lua.* "pL" "sH")
(lua.* "pH" "sL"))))
(lua.local! "top" (#.Some (lua.* "pH" "sH")))
(lua.return! (|> "bottom"
(lua.+ "middle")
- (bit//shift-right (lua.int 32))
+ (bit//logical-right-shift (lua.int 32))
(lua.+ "top"))))))
(runtime: (deg//leading-zeroes input)
(lua.block! (list (lua.local! "zeroes" (#.Some (lua.int 64)))
(lua.while! (lua.not (lua.= (lua.int 0) input))
(lua.block! (list (lua.set! "zeroes" (lua.- (lua.int 1) "zeroes"))
- (lua.set! input (bit//shift-right (lua.int 1) input)))))
+ (lua.set! input (bit//logical-right-shift (lua.int 1) input)))))
(lua.return! "zeroes"))))
(runtime: (deg/// param subject)
diff --git a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
index 33c7d645e..5850c0098 100644
--- a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
@@ -161,7 +161,7 @@
## [bit//xor _.bit-xor]
## )
-## (def: (bit//shift-left [subjectO paramO])
+## (def: (bit//left-shift [subjectO paramO])
## Binary
## (|> (_.bit-shl paramO subjectO)
## runtimeT.bit//64))
@@ -171,8 +171,8 @@
## Binary
## (<op> paramO subjectO))]
-## [bit//shift-right _.bit-shr]
-## [bit//unsigned-shift-right runtimeT.bit//shift-right]
+## [bit//arithmetic-right-shift _.bit-shr]
+## [bit//logical-right-shift runtimeT.bit//logical-right-shift]
## )
## (def: bit-procs
@@ -183,9 +183,9 @@
## (install "and" (binary bit//and))
## (install "or" (binary bit//or))
## (install "xor" (binary bit//xor))
-## (install "shift-left" (binary bit//shift-left))
-## (install "unsigned-shift-right" (binary bit//unsigned-shift-right))
-## (install "shift-right" (binary bit//shift-right))
+## (install "left-shift" (binary bit//left-shift))
+## (install "logical-right-shift" (binary bit//logical-right-shift))
+## (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
## )))
## ## [[Arrays]]
diff --git a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux
index 66827025e..c7262a291 100644
--- a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux
@@ -216,41 +216,7 @@
(_.then! @@product//right)
(_.then! @@sum//get)))
-## (def: full-32-bits (_.code "0xFFFFFFFF"))
-
-## (runtime: (bit//32 input)
-## (with-vars [capped]
-## (_.cond! (list [(|> input (_.> full-32-bits))
-## (_.return! (|> input (_.bit-and full-32-bits) bit//32))]
-## [(|> input (_.> (_.code "0x7FFFFFFF")))
-## ($_ _.then!
-## (_.set! (list capped)
-## (_.apply (list (|> (_.code "0x100000000")
-## (_.- input)))
-## (_.global "int")))
-## (_.if! (|> (@@ capped) (_.<= (_.int 2147483647)))
-## (_.return! (|> (@@ capped) (_.* (_.int -1))))
-## (_.return! (_.int -2147483648))))])
-## (_.return! input))))
-
-## (def: full-64-bits (_.code "0xFFFFFFFFFFFFFFFF"))
-
-## (runtime: (bit//64 input)
-## (with-vars [capped]
-## (_.cond! (list [(|> input (_.> full-64-bits))
-## (_.return! (|> input (_.bit-and full-64-bits) bit//64))]
-## [(|> input (_.> (_.code "0x7FFFFFFFFFFFFFFF")))
-## ($_ _.then!
-## (_.set! (list capped)
-## (_.apply (list (|> (_.code "0x10000000000000000")
-## (_.- input)))
-## (_.global "int")))
-## (_.if! (|> (@@ capped) (_.<= (_.code "9223372036854775807L")))
-## (_.return! (|> (@@ capped) (_.* (_.int -1))))
-## (_.return! (_.code "-9223372036854775808L"))))])
-## (_.return! input))))
-
-## (runtime: (bit//shift-right param subject)
+## (runtime: (bit//logical-right-shift param subject)
## (let [mask (|> (_.int 1)
## (_.bit-shl (_.- param (_.int 64)))
## (_.- (_.int 1)))]
@@ -261,9 +227,7 @@
## (def: runtime//bit
## Runtime
## ($_ _.then!
-## @@bit//32
-## @@bit//64
-## @@bit//shift-right))
+## @@bit//logical-right-shift))
## (runtime: (text//index subject param start)
## (with-vars [idx]
diff --git a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux
index c9ebd6fd7..c201c417c 100644
--- a/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/procedure/common.jvm.lux
@@ -161,7 +161,7 @@
[bit//xor python.bit-xor]
)
-(def: (bit//shift-left [subjectO paramO])
+(def: (bit//left-shift [subjectO paramO])
Binary
(|> (python.bit-shl paramO subjectO)
runtimeT.bit//64))
@@ -171,8 +171,8 @@
Binary
(<op> paramO subjectO))]
- [bit//shift-right python.bit-shr]
- [bit//unsigned-shift-right runtimeT.bit//shift-right]
+ [bit//arithmetic-right-shift python.bit-shr]
+ [bit//logical-right-shift runtimeT.bit//logical-right-shift]
)
(def: bit-procs
@@ -183,9 +183,9 @@
(install "and" (binary bit//and))
(install "or" (binary bit//or))
(install "xor" (binary bit//xor))
- (install "shift-left" (binary bit//shift-left))
- (install "unsigned-shift-right" (binary bit//unsigned-shift-right))
- (install "shift-right" (binary bit//shift-right))
+ (install "left-shift" (binary bit//left-shift))
+ (install "logical-right-shift" (binary bit//logical-right-shift))
+ (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
)))
## [[Arrays]]
diff --git a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
index 5d0ea9186..65e864d91 100644
--- a/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/python/runtime.jvm.lux
@@ -266,7 +266,7 @@
(python.set! (list remaining) (|> (@@ remaining) (python./ (python.int 2))))))
(python.return! (@@ count)))))
-(runtime: (bit//shift-right param subject)
+(runtime: (bit//logical-right-shift param subject)
(let [mask (|> (python.int 1)
(python.bit-shl (python.- param (python.int 64)))
(python.- (python.int 1)))]
@@ -280,9 +280,9 @@
@@bit//32
@@bit//64
@@bit//count
- @@bit//shift-right))
+ @@bit//logical-right-shift))
-(def: high (-> Expression Expression) (bit//shift-right (python.int 32)))
+(def: high (-> Expression Expression) (bit//logical-right-shift (python.int 32)))
(def: low (-> Expression Expression) (python.bit-and full-32-bits))
(runtime: (nat//< param subject)
@@ -331,8 +331,8 @@
(python.set! (list $sH) (high subject))
(python.set! (list $pL) (..low param))
(python.set! (list $pH) (high param))
- (python.set! (list $bottom) (bit//shift-right (python.int 32)
- (python.* (@@ $pL) (@@ $sL))))
+ (python.set! (list $bottom) (bit//logical-right-shift (python.int 32)
+ (python.* (@@ $pL) (@@ $sL))))
(python.set! (list $middle) (python.+ (python.* (@@ $pL) (@@ $sH))
(python.* (@@ $pH) (@@ $sL))))
(python.set! (list $top) (python.* (@@ $pH) (@@ $sH)))
@@ -349,7 +349,7 @@
(python.while! (python.not (python.= (python.int 0) (@@ remaining)))
($_ python.then!
(python.set! (list zeroes) (python.- (python.int 1) (@@ zeroes)))
- (python.set! (list remaining) (bit//shift-right (python.int 1) (@@ remaining)))))
+ (python.set! (list remaining) (bit//logical-right-shift (python.int 1) (@@ remaining)))))
(python.return! (@@ zeroes)))))
(runtime: (deg/// param subject)
diff --git a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
index 5685ae05e..05d16f871 100644
--- a/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/eval.jvm.lux
@@ -94,9 +94,9 @@
high (get-int-32 (:! IntArrayVector high))
low (get-int-32 (:! IntArrayVector low))]]
(wrap (:! Int
- (n/+ (|> high (bit.shift-left +32))
+ (n/+ (|> high (bit.left-shift +32))
(if (i/< 0 (:! Int low))
- (|> low (bit.shift-left +32) (bit.shift-right +32))
+ (|> low (bit.left-shift +32) (bit.logical-right-shift +32))
low))))))
(def: (lux-object host-object)
diff --git a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
index bd11bca21..a9e661130 100644
--- a/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/procedure/common.jvm.lux
@@ -167,9 +167,9 @@
Binary
(<op> (runtimeT.int64-low paramO) subjectO))]
- [bit//shift-left runtimeT.bit//shift-left]
- [bit//signed-shift-right runtimeT.bit//signed-shift-right]
- [bit//shift-right runtimeT.bit//shift-right]
+ [bit//left-shift runtimeT.bit//left-shift]
+ [bit//arithmetic-right-shift runtimeT.bit//arithmetic-right-shift]
+ [bit//logical-right-shift runtimeT.bit//logical-right-shift]
)
(def: bit-procs
@@ -180,9 +180,9 @@
(install "and" (binary bit//and))
(install "or" (binary bit//or))
(install "xor" (binary bit//xor))
- (install "shift-left" (binary bit//shift-left))
- (install "unsigned-shift-right" (binary bit//shift-right))
- (install "shift-right" (binary bit//signed-shift-right))
+ (install "left-shift" (binary bit//left-shift))
+ (install "logical-right-shift" (binary bit//logical-right-shift))
+ (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
)))
## [[Arrays]]
diff --git a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux
index 7183815c7..88b40bcca 100644
--- a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux
@@ -33,7 +33,7 @@
## else
(nat-to-int input)))
-(def: high-32 (bit.shift-right +32))
+(def: high-32 (bit.logical-right-shift +32))
(def: low-32 (|>> (bit.and (hex "+FFFFFFFF"))))
(def: #export (int value)
@@ -333,7 +333,7 @@
[(|> (@@ shift) (r.= (r.int 0)))
(@@ input)])
-(runtime: (bit//shift-left shift input)
+(runtime: (bit//left-shift shift input)
($_ r.then
(limit-shift! shift)
(r.cond (list (no-shift-clause shift input)
@@ -349,26 +349,26 @@
(r.bit-shl (|> (@@ shift) (r.- (r.int 32)))))]
(int//new high (r.int 0))))))
-(runtime: (bit//signed-shift-right-32 shift input)
+(runtime: (bit//arithmetic-right-shift-32 shift input)
(let [top-bit (|> (@@ input) (r.bit-and (r.int (hex "80000000"))))]
(|> (@@ input)
(r.bit-ushr (@@ shift))
(r.bit-or top-bit))))
-(runtime: (bit//signed-shift-right shift input)
+(runtime: (bit//arithmetic-right-shift shift input)
($_ r.then
(limit-shift! shift)
(r.cond (list (no-shift-clause shift input)
[(|> (@@ shift) (r.< (r.int 32)))
(let [mid (|> (int64-high (@@ input)) (r.bit-shl (|> (r.int 32) (r.- (@@ shift)))))
high (|> (int64-high (@@ input))
- (bit//signed-shift-right-32 (@@ shift)))
+ (bit//arithmetic-right-shift-32 (@@ shift)))
low (|> (int64-low (@@ input))
(r.bit-ushr (@@ shift))
(r.bit-or mid))]
(int//new high low))])
(let [low (|> (int64-high (@@ input))
- (bit//signed-shift-right-32 (|> (@@ shift) (r.- (r.int 32)))))
+ (bit//arithmetic-right-shift-32 (|> (@@ shift) (r.- (r.int 32)))))
high (r.if (|> (int64-high (@@ input)) (r.>= (r.int 0)))
(r.int 0)
(r.int -1))]
@@ -393,9 +393,9 @@
($_ r.then
(r.set! approximation
(|> (@@ subject)
- (bit//signed-shift-right (r.int 1))
+ (bit//arithmetic-right-shift (r.int 1))
(int/// (@@ param))
- (bit//shift-left (r.int 1))))
+ (bit//left-shift (r.int 1))))
(r.if (|> (@@ approximation) (int//= int//zero))
(r.if (negative? (@@ param))
int//one
@@ -627,7 +627,7 @@
(int//from-float (r.+ (bit//count-32 (int64-high (@@ input)))
(bit//count-32 (int64-low (@@ input))))))
-(runtime: (bit//shift-right shift input)
+(runtime: (bit//logical-right-shift shift input)
($_ r.then
(limit-shift! shift)
(r.cond (list (no-shift-clause shift input)
@@ -658,10 +658,10 @@
@@bit//not
@@bit//count-32
@@bit//count
- @@bit//shift-left
- @@bit//signed-shift-right-32
- @@bit//signed-shift-right
- @@bit//shift-right
+ @@bit//left-shift
+ @@bit//arithmetic-right-shift-32
+ @@bit//arithmetic-right-shift
+ @@bit//logical-right-shift
))
(runtime: (nat//< param subject)
@@ -686,7 +686,7 @@
short-circuit-check
[(|> (@@ parameter)
- (nat//< (|> (@@ subject) (bit//shift-right (r.int 1)))))
+ (nat//< (|> (@@ subject) (bit//logical-right-shift (r.int 1)))))
int//one])
(with-vars [result remainder approximate log2 approximate-result approximate-remainder delta]
($_ r.then
@@ -748,14 +748,14 @@
(r.set! sH (int//from-float (int64-high (@@ subject))))
(r.set! pL (int//from-float (int64-low (@@ param))))
(r.set! pH (int//from-float (int64-high (@@ param))))
- (let [bottom (bit//shift-right (r.int 32)
- (int//* (@@ pL) (@@ sL)))
+ (let [bottom (bit//logical-right-shift (r.int 32)
+ (int//* (@@ pL) (@@ sL)))
middle (int//+ (int//* (@@ pL) (@@ sH))
(int//* (@@ pH) (@@ sL)))
top (int//* (@@ pH) (@@ sH))]
(|> bottom
(int//+ middle)
- (bit//shift-right (r.int 32))
+ (bit//logical-right-shift (r.int 32))
(int//+ top))))))
(runtime: (deg//leading-zeroes input)
@@ -766,7 +766,7 @@
(r.while (|> (@@ remaining) (int//= int//zero) r.not)
($_ r.then
(r.set! zeroes (|> (@@ zeroes) (r.- (r.int 1))))
- (r.set! remaining (|> (@@ remaining) (bit//shift-right (r.int 1))))))
+ (r.set! remaining (|> (@@ remaining) (bit//logical-right-shift (r.int 1))))))
(@@ zeroes))))
(runtime: (deg/// param subject)
@@ -778,11 +778,11 @@
(r.apply (list (deg//leading-zeroes (@@ param))
(deg//leading-zeroes (@@ subject)))
(r.global "min")))
- (let [subject' (|> (@@ subject) (bit//shift-left (@@ min-shift)))
- param' (|> (@@ param) (bit//shift-left (@@ min-shift)) int64-high int//from-float)]
+ (let [subject' (|> (@@ subject) (bit//left-shift (@@ min-shift)))
+ param' (|> (@@ param) (bit//left-shift (@@ min-shift)) int64-high int//from-float)]
(|> subject'
(int/// param')
- (bit//shift-left (r.int 32))))))))
+ (bit//left-shift (r.int 32))))))))
(runtime: (deg//from-frac input)
(with-vars [two32 shifted]
diff --git a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
index ccd2699ce..a13dae50b 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/procedure/common.jvm.lux
@@ -160,7 +160,7 @@
[bit//xor ruby.bit-xor]
)
-(def: (bit//shift-left [subjectO paramO])
+(def: (bit//left-shift [subjectO paramO])
Binary
(ruby.bit-and "0xFFFFFFFFFFFFFFFF"
(ruby.bit-shl paramO subjectO)))
@@ -170,8 +170,8 @@
Binary
(<op> paramO subjectO))]
- [bit//shift-right ruby.bit-shr]
- [bit//unsigned-shift-right runtimeT.bit//shift-right]
+ [bit//arithmetic-right-shift ruby.bit-shr]
+ [bit//logical-right-shift runtimeT.bit//logical-right-shift]
)
(def: bit//count
@@ -186,9 +186,9 @@
(install "and" (binary bit//and))
(install "or" (binary bit//or))
(install "xor" (binary bit//xor))
- (install "shift-left" (binary bit//shift-left))
- (install "unsigned-shift-right" (binary bit//unsigned-shift-right))
- (install "shift-right" (binary bit//shift-right))
+ (install "left-shift" (binary bit//left-shift))
+ (install "logical-right-shift" (binary bit//logical-right-shift))
+ (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
)))
## [[Arrays]]
diff --git a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux
index 1e1e4c53a..c3f2981e1 100644
--- a/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/ruby/runtime.jvm.lux
@@ -165,7 +165,7 @@
(ruby.set! (list subject) (ruby./ (ruby.int 2) subject)))))
(ruby.return! "count"))))
-(runtime: (bit//shift-right param subject)
+(runtime: (bit//logical-right-shift param subject)
(let [mask (|> (ruby.int 1)
(ruby.bit-shl (ruby.- param (ruby.int 64)))
(ruby.- (ruby.int 1)))]
@@ -176,9 +176,9 @@
(def: runtime//bit
Runtime
(format @@bit//count
- @@bit//shift-right))
+ @@bit//logical-right-shift))
-(def: high (-> Expression Expression) (bit//shift-right (ruby.int 32)))
+(def: high (-> Expression Expression) (bit//logical-right-shift (ruby.int 32)))
(def: low (-> Expression Expression) (ruby.bit-and "0xFFFFFFFF"))
(runtime: (nat//< param subject)
@@ -220,8 +220,8 @@
(ruby.set! (list "sH") (high subject))
(ruby.set! (list "pL") (low param))
(ruby.set! (list "pH") (high param))
- (ruby.set! (list "bottom") (bit//shift-right (ruby.int 32)
- (ruby.* "pL" "sL")))
+ (ruby.set! (list "bottom") (bit//logical-right-shift (ruby.int 32)
+ (ruby.* "pL" "sL")))
(ruby.set! (list "middle") (ruby.+ (ruby.* "pL" "sH")
(ruby.* "pH" "sL")))
(ruby.set! (list "top") (ruby.* "pH" "sH"))
@@ -234,7 +234,7 @@
(ruby.block! (list (ruby.set! (list "zeroes") (ruby.int 64))
(ruby.while! (ruby.not (ruby.= (ruby.int 0) input))
(ruby.block! (list (ruby.set! (list "zeroes") (ruby.- (ruby.int 1) "zeroes"))
- (ruby.set! (list input) (bit//shift-right (ruby.int 1) input)))))
+ (ruby.set! (list input) (bit//logical-right-shift (ruby.int 1) input)))))
(ruby.return! "zeroes"))))
(runtime: (deg/// param subject)
diff --git a/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux
index 7387b6530..cd828e082 100644
--- a/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/scheme/procedure/common.jvm.lux
@@ -161,18 +161,18 @@
[bit//xor _.bit-xor]
)
-(def: (bit//shift-left [subjectO paramO])
+(def: (bit//left-shift [subjectO paramO])
Binary
(_.arithmetic-shift (_.remainder (_.int 64) paramO) subjectO))
-(def: (bit//signed-shift-right [subjectO paramO])
+(def: (bit//arithmetic-right-shift [subjectO paramO])
Binary
(_.arithmetic-shift (|> paramO (_.remainder (_.int 64)) (_.* (_.int -1)))
subjectO))
-(def: (bit//shift-right [subjectO paramO])
+(def: (bit//logical-right-shift [subjectO paramO])
Binary
- (runtimeT.bit//shift-right (_.remainder (_.int 64) paramO) subjectO))
+ (runtimeT.bit//logical-right-shift (_.remainder (_.int 64) paramO) subjectO))
(def: bit-procs
Bundle
@@ -182,9 +182,9 @@
(install "and" (binary bit//and))
(install "or" (binary bit//or))
(install "xor" (binary bit//xor))
- (install "shift-left" (binary bit//shift-left))
- (install "unsigned-shift-right" (binary bit//shift-right))
- (install "shift-right" (binary bit//signed-shift-right))
+ (install "left-shift" (binary bit//left-shift))
+ (install "logical-right-shift" (binary bit//logical-right-shift))
+ (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
)))
## [[Arrays]]
diff --git a/new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux
index 816f92389..09259c2b9 100644
--- a/new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/scheme/runtime.jvm.lux
@@ -225,7 +225,7 @@
@@product//right
@@sum//get)))
-(runtime: (bit//shift-right shift input)
+(runtime: (bit//logical-right-shift shift input)
(_.if (_.= (_.int 0) (@@ shift))
(@@ input)
(|> (@@ input)
@@ -234,9 +234,9 @@
(def: runtime//bit
Runtime
- (_.begin (list @@bit//shift-right)))
+ (_.begin (list @@bit//logical-right-shift)))
-(def: int-high (bit//shift-right (_.int 32)))
+(def: int-high (bit//logical-right-shift (_.int 32)))
(def: int-low (_.bit-and (_.int (hex "FFFFFFFF"))))
(runtime: (nat//< param subject)
@@ -254,7 +254,7 @@
(_.int 1))
(with-vars [quotient]
(_.let (list [quotient (|> (@@ subject)
- (bit//shift-right (_.int 1))
+ (bit//logical-right-shift (_.int 1))
(_.quotient (@@ param))
(_.arithmetic-shift (_.int 1)))])
(let [remainder (_.- (_.* (@@ param) (@@ quotient))
diff --git a/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux b/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux
index 6d176e0cd..9cd456f5d 100644
--- a/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux
+++ b/new-luxc/test/test/luxc/lang/analysis/procedure/common.lux
@@ -73,11 +73,11 @@
(test "Can perform bit 'xor'."
(check-success+ "lux bit xor" (list subjectC paramC) Nat))
(test "Can shift bit pattern to the left."
- (check-success+ "lux bit shift-left" (list subjectC paramC) Nat))
+ (check-success+ "lux bit left-shift" (list subjectC paramC) Nat))
(test "Can shift bit pattern to the right."
- (check-success+ "lux bit unsigned-shift-right" (list subjectC paramC) Nat))
+ (check-success+ "lux bit logical-right-shift" (list subjectC paramC) Nat))
(test "Can shift signed bit pattern to the right."
- (check-success+ "lux bit shift-right" (list signedC paramC) Int))
+ (check-success+ "lux bit arithmetic-right-shift" (list signedC paramC) Int))
))))
(context: "Nat procedures"
diff --git a/new-luxc/test/test/luxc/lang/translation/common.lux b/new-luxc/test/test/luxc/lang/translation/common.lux
index 964be4af3..2da309f34 100644
--- a/new-luxc/test/test/luxc/lang/translation/common.lux
+++ b/new-luxc/test/test/luxc/lang/translation/common.lux
@@ -37,20 +37,20 @@
false))
(let [param <param-expr>])))]
- ["lux bit and" bit.and param]
- ["lux bit or" bit.or param]
- ["lux bit xor" bit.xor param]
- ["lux bit shift-left" bit.shift-left (n/% +64 param)]
- ["lux bit unsigned-shift-right" bit.shift-right (n/% +64 param)]
+ ["lux bit and" bit.and param]
+ ["lux bit or" bit.or param]
+ ["lux bit xor" bit.xor param]
+ ["lux bit left-shift" bit.left-shift (n/% +64 param)]
+ ["lux bit logical-right-shift" bit.logical-right-shift (n/% +64 param)]
)]
($_ seq
<binary>
- (test "lux bit shift-right"
- (|> (run (` ("lux bit shift-right"
+ (test "lux bit arithmetic-right-shift"
+ (|> (run (` ("lux bit arithmetic-right-shift"
(~ (code.int (nat-to-int subject)))
(~ (code.nat param)))))
(case> (#e.Success valueT)
- (i/= (bit.signed-shift-right param (nat-to-int subject))
+ (i/= (bit.arithmetic-right-shift param (nat-to-int subject))
(:! Int valueT))
(#e.Error error)
@@ -94,7 +94,7 @@
["lux int to-frac" Frac int-to-frac f/= subject]
["lux int char" Text (|>> (:! Nat) text.from-code) text/= (|> subject
(:! Nat)
- (n/% (bit.shift-left +8 +1))
+ (n/% (bit.left-shift +8 +1))
(:! Int))]
))
(~~ (do-template [<name> <reference> <outputT> <comp>]
diff --git a/new-luxc/test/test/luxc/lang/translation/jvm.lux b/new-luxc/test/test/luxc/lang/translation/jvm.lux
index 0ece8db82..54966ae65 100644
--- a/new-luxc/test/test/luxc/lang/translation/jvm.lux
+++ b/new-luxc/test/test/luxc/lang/translation/jvm.lux
@@ -216,9 +216,9 @@
(#e.Error error)
false)))]
- [(format "jvm " <domain> " shl") bit.shift-left Nat n/= id code.nat]
- [(format "jvm " <domain> " shr") bit.signed-shift-right Int i/= nat-to-int (|>> nat-to-int code.int)]
- [(format "jvm " <domain> " ushr") bit.shift-right Nat n/= id code.nat]
+ [(format "jvm " <domain> " shl") bit.left-shift Nat n/= id code.nat]
+ [(format "jvm " <domain> " shr") bit.arithmetic-right-shift Int i/= nat-to-int (|>> nat-to-int code.int)]
+ [(format "jvm " <domain> " ushr") bit.logical-right-shift Nat n/= id code.nat]
))
)))))]
diff --git a/stdlib/source/lux/data/bit.lux b/stdlib/source/lux/data/bit.lux
index 65d1bef84..90f98f245 100644
--- a/stdlib/source/lux/data/bit.lux
+++ b/stdlib/source/lux/data/bit.lux
@@ -12,9 +12,9 @@
[and "lux bit and" "Bitwise and." Nat]
[or "lux bit or" "Bitwise or." Nat]
[xor "lux bit xor" "Bitwise xor." Nat]
- [shift-left "lux bit shift-left" "Bitwise shift-left." Nat]
- [shift-right "lux bit unsigned-shift-right" "Unsigned bitwise shift-right." Nat]
- [signed-shift-right "lux bit shift-right" "Signed bitwise shift-right." Int]
+ [left-shift "lux bit left-shift" "Bitwise left-shift." Nat]
+ [logical-right-shift "lux bit logical-right-shift" "Unsigned bitwise logical-right-shift." Nat]
+ [arithmetic-right-shift "lux bit arithmetic-right-shift" "Signed bitwise arithmetic-right-shift." Int]
)
(def: #export (count subject)
@@ -31,14 +31,14 @@
(def: #export (clear idx input)
{#.doc "Clear bit at given index."}
(-> Nat Nat Nat)
- (..and (..not (shift-left idx +1))
+ (..and (..not (left-shift idx +1))
input))
(do-template [<name> <op> <doc>]
[(def: #export (<name> idx input)
{#.doc <doc>}
(-> Nat Nat Nat)
- (<op> (shift-left idx +1) input))]
+ (<op> (left-shift idx +1) input))]
[set ..or "Set bit at given index."]
[flip ..xor "Flip bit at given index."]
@@ -46,7 +46,7 @@
(def: #export (set? idx input)
(-> Nat Nat Bool)
- (|> input (..and (shift-left idx +1)) (n/= +0) .not))
+ (|> input (..and (left-shift idx +1)) (n/= +0) .not))
(do-template [<name> <main> <comp>]
[(def: #export (<name> distance input)
@@ -56,11 +56,11 @@
width)
input)))]
- [rotate-left shift-left shift-right]
- [rotate-right shift-right shift-left]
+ [rotate-left left-shift logical-right-shift]
+ [rotate-right logical-right-shift left-shift]
)
(def: #export (region-mask size offset)
(-> Nat Nat Nat)
- (let [pattern (|> +1 (shift-left size) n/dec)]
- (shift-left offset pattern)))
+ (let [pattern (|> +1 (left-shift size) n/dec)]
+ (left-shift offset pattern)))
diff --git a/stdlib/source/lux/data/coll/dictionary/unordered.lux b/stdlib/source/lux/data/coll/dictionary/unordered.lux
index 97a119755..e0928e186 100644
--- a/stdlib/source/lux/data/coll/dictionary/unordered.lux
+++ b/stdlib/source/lux/data/coll/dictionary/unordered.lux
@@ -97,18 +97,18 @@
## which is 1/4 of the branching factor (or a left-shift 2).
(def: demotion-threshold
Nat
- (bit.shift-left (n/- +2 branching-exponent) +1))
+ (bit.left-shift (n/- +2 branching-exponent) +1))
## The threshold on which #Base nodes are promoted to #Hierarchy nodes,
## which is 1/2 of the branching factor (or a left-shift 1).
(def: promotion-threshold
Nat
- (bit.shift-left (n/- +1 branching-exponent) +1))
+ (bit.left-shift (n/- +1 branching-exponent) +1))
## The size of hierarchy-nodes, which is 2^(branching-exponent).
(def: hierarchy-nodes-size
Nat
- (bit.shift-left branching-exponent +1))
+ (bit.left-shift branching-exponent +1))
## The cannonical empty node, which is just an empty #Base node.
(def: empty
@@ -161,12 +161,12 @@
(def: (level-index level hash)
(-> Level Hash-Code Index)
(bit.and hierarchy-mask
- (bit.shift-right level hash)))
+ (bit.logical-right-shift level hash)))
## A mechanism to go from indices to bit-positions.
(def: (->bit-position index)
(-> Index BitPosition)
- (bit.shift-left index +1))
+ (bit.left-shift index +1))
## The bit-position within a base that a given hash-code would have.
(def: (bit-position level hash)
diff --git a/stdlib/source/lux/data/coll/sequence.lux b/stdlib/source/lux/data/coll/sequence.lux
index 45a22e73b..a160a9925 100644
--- a/stdlib/source/lux/data/coll/sequence.lux
+++ b/stdlib/source/lux/data/coll/sequence.lux
@@ -48,7 +48,7 @@
(def: full-node-size
Nat
- (bit.shift-left branching-exponent +1))
+ (bit.left-shift branching-exponent +1))
(def: branch-idx-mask
Nat
@@ -67,8 +67,8 @@
(if (n/< full-node-size vec-size)
+0
(|> (n/dec vec-size)
- (bit.shift-right branching-exponent)
- (bit.shift-left branching-exponent))))
+ (bit.logical-right-shift branching-exponent)
+ (bit.left-shift branching-exponent))))
(def: (new-path level tail)
(All [a] (-> Level (Base a) (Node a)))
@@ -85,7 +85,7 @@
(def: (push-tail size level tail parent)
(All [a] (-> Nat Level (Base a) (Hierarchy a) (Hierarchy a)))
- (let [sub-idx (branch-idx (bit.shift-right level (n/dec size)))
+ (let [sub-idx (branch-idx (bit.logical-right-shift level (n/dec size)))
## If we're currently on a bottom node
sub-node (if (n/= branching-exponent level)
## Just add the tail to it
@@ -114,7 +114,7 @@
(def: (put' level idx val hierarchy)
(All [a] (-> Level Index a (Hierarchy a) (Hierarchy a)))
- (let [sub-idx (branch-idx (bit.shift-right level idx))]
+ (let [sub-idx (branch-idx (bit.logical-right-shift level idx))]
(case (array.read sub-idx hierarchy)
(#.Some (#Hierarchy sub-node))
(|> (array.clone hierarchy)
@@ -132,7 +132,7 @@
(def: (pop-tail size level hierarchy)
(All [a] (-> Nat Level (Hierarchy a) (Maybe (Hierarchy a))))
- (let [sub-idx (branch-idx (bit.shift-right level (n/- +2 size)))]
+ (let [sub-idx (branch-idx (bit.logical-right-shift level (n/- +2 size)))]
(cond (n/= +0 sub-idx)
#.None
@@ -199,8 +199,8 @@
## Otherwise, push tail into the tree
## --------------------------------------------------------
## Will the root experience an overflow with this addition?
- (|> (if (n/> (bit.shift-left (get@ #level vec) +1)
- (bit.shift-right branching-exponent vec-size))
+ (|> (if (n/> (bit.left-shift (get@ #level vec) +1)
+ (bit.logical-right-shift branching-exponent vec-size))
## If so, a brand-new root must be established, that is
## 1-level taller.
(|> vec
@@ -230,7 +230,7 @@
(loop [level (get@ #level vec)
hierarchy (get@ #root vec)]
(case [(n/> branching-exponent level)
- (array.read (branch-idx (bit.shift-right level idx)) hierarchy)]
+ (array.read (branch-idx (bit.logical-right-shift level idx)) hierarchy)]
[true (#.Some (#Hierarchy sub))]
(recur (level-down level) sub)
diff --git a/stdlib/source/lux/data/number.lux b/stdlib/source/lux/data/number.lux
index c67ad0e56..c784e81ef 100644
--- a/stdlib/source/lux/data/number.lux
+++ b/stdlib/source/lux/data/number.lux
@@ -937,7 +937,7 @@
(let [sign (:: Number<Frac> signum input)
input (:: Number<Frac> abs input)
exponent ("lux math floor" (log2 input))
- exponent-mask (|> +1 (bit.shift-left exponent-size) n/dec)
+ exponent-mask (|> +1 (bit.left-shift exponent-size) n/dec)
mantissa (|> input
## Normalize
(f// ("lux math pow" 2.0 exponent))
@@ -947,16 +947,16 @@
exponent-bits (|> exponent frac-to-int int-to-nat (n/+ double-bias) (bit.and exponent-mask))
mantissa-bits (|> mantissa frac-to-int int-to-nat)]
($_ bit.or
- (bit.shift-left +63 sign-bit)
- (bit.shift-left mantissa-size exponent-bits)
+ (bit.left-shift +63 sign-bit)
+ (bit.left-shift mantissa-size exponent-bits)
(bit.clear mantissa-size mantissa-bits)))
))
(do-template [<getter> <mask> <size> <offset>]
- [(def: <mask> (|> +1 (bit.shift-left <size>) n/dec (bit.shift-left <offset>)))
+ [(def: <mask> (|> +1 (bit.left-shift <size>) n/dec (bit.left-shift <offset>)))
(def: (<getter> input)
(-> Nat Nat)
- (|> input (bit.and <mask>) (bit.shift-right <offset>)))]
+ (|> input (bit.and <mask>) (bit.logical-right-shift <offset>)))]
[mantissa mantissa-mask mantissa-size +0]
[exponent exponent-mask exponent-size mantissa-size]
diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux
index 971048296..2e288648e 100644
--- a/stdlib/source/lux/macro/poly/json.lux
+++ b/stdlib/source/lux/macro/poly/json.lux
@@ -39,12 +39,12 @@
(function (_ input)
(non-rec (rec-encode non-rec) input)))
-(def: low-mask Nat (|> +1 (bit.shift-left +32) n/dec))
-(def: high-mask Nat (|> low-mask (bit.shift-left +32)))
+(def: low-mask Nat (|> +1 (bit.left-shift +32) n/dec))
+(def: high-mask Nat (|> low-mask (bit.left-shift +32)))
(struct: _ (Codec JSON Nat)
(def: (encode input)
- (let [high (|> input (bit.and high-mask) (bit.shift-right +32))
+ (let [high (|> input (bit.and high-mask) (bit.logical-right-shift +32))
low (bit.and low-mask input)]
(#//.Array (sequence (|> high nat-to-int int-to-frac #//.Number)
(|> low nat-to-int int-to-frac #//.Number)))))
@@ -54,7 +54,7 @@
(do p.Monad<Parser>
[high //.number
low //.number])
- (wrap (n/+ (|> high frac-to-int int-to-nat (bit.shift-left +32))
+ (wrap (n/+ (|> high frac-to-int int-to-nat (bit.left-shift +32))
(|> low frac-to-int int-to-nat))))))
(struct: _ (Codec JSON Int)
diff --git a/stdlib/source/lux/math/random.lux b/stdlib/source/lux/math/random.lux
index 2ae482c34..39d7d880d 100644
--- a/stdlib/source/lux/math/random.lux
+++ b/stdlib/source/lux/math/random.lux
@@ -69,7 +69,7 @@
(function (_ prng)
(let [[prng left] (prng [])
[prng right] (prng [])]
- [prng (n/+ (bit.shift-left +32 left)
+ [prng (n/+ (bit.left-shift +32 left)
right)])))
(def: #export int
@@ -77,7 +77,7 @@
(function (_ prng)
(let [[prng left] (prng [])
[prng right] (prng [])]
- [prng (nat-to-int (n/+ (bit.shift-left +32 left)
+ [prng (nat-to-int (n/+ (bit.left-shift +32 left)
right))])))
(def: #export bool
@@ -90,7 +90,7 @@
(-> Nat (Random Nat))
(function (_ prng)
(let [[prng output] (prng [])]
- [prng (bit.shift-right (n/- n +64) output)])))
+ [prng (bit.logical-right-shift (n/- n +64) output)])))
(def: #export frac
(Random Frac)
@@ -98,10 +98,10 @@
[left (bits +26)
right (bits +27)]
(wrap (|> right
- (n/+ (bit.shift-left +27 left))
+ (n/+ (bit.left-shift +27 left))
nat-to-int
int-to-frac
- (f// (|> +1 (bit.shift-left +53) nat-to-int int-to-frac))))))
+ (f// (|> +1 (bit.left-shift +53) nat-to-int int-to-frac))))))
(def: #export deg
(Random Deg)
@@ -327,8 +327,8 @@
(-> [Nat Nat] PRNG)
(function (_ _)
(let [seed' (|> seed (n/* pcg-32-magic-mult) (n/+ inc))
- xor-shifted (|> seed (bit.shift-right +18) (bit.xor seed) (bit.shift-right +27))
- rot (|> seed (bit.shift-right +59))]
+ xor-shifted (|> seed (bit.logical-right-shift +18) (bit.xor seed) (bit.logical-right-shift +27))
+ rot (|> seed (bit.logical-right-shift +59))]
[(pcg-32 [inc seed']) (bit.rotate-right rot xor-shifted)]
)))
@@ -342,7 +342,7 @@
s01 (bit.xor s0 s1)
s0' (|> (bit.rotate-left +55 s0)
(bit.xor s01)
- (bit.xor (bit.shift-left +14 s01)))
+ (bit.xor (bit.left-shift +14 s01)))
s1' (bit.rotate-left +36 s01)]
[(xoroshiro-128+ [s0' s1']) result])
))
diff --git a/stdlib/source/lux/world/blob.jvm.lux b/stdlib/source/lux/world/blob.jvm.lux
index 0027a4750..077fa3863 100644
--- a/stdlib/source/lux/world/blob.jvm.lux
+++ b/stdlib/source/lux/world/blob.jvm.lux
@@ -23,7 +23,7 @@
(def: byte-mask
Nat
- (|> +1 (bit.shift-left +8) n/dec))
+ (|> +1 (bit.left-shift +8) n/dec))
(def: byte-to-nat
(-> (primitive "java.lang.Byte") Nat)
@@ -43,7 +43,7 @@
(-> Nat Blob (e.Error Nat))
(if (n/< (host.array-length blob) (n/+ +1 idx))
(#e.Success ($_ bit.or
- (bit.shift-left +8 (byte-to-nat (host.array-read idx blob)))
+ (bit.left-shift +8 (byte-to-nat (host.array-read idx blob)))
(byte-to-nat (host.array-read (n/+ +1 idx) blob))))
(ex.throw index-out-of-bounds (%n idx))))
@@ -51,9 +51,9 @@
(-> Nat Blob (e.Error Nat))
(if (n/< (host.array-length blob) (n/+ +3 idx))
(#e.Success ($_ bit.or
- (bit.shift-left +24 (byte-to-nat (host.array-read idx blob)))
- (bit.shift-left +16 (byte-to-nat (host.array-read (n/+ +1 idx) blob)))
- (bit.shift-left +8 (byte-to-nat (host.array-read (n/+ +2 idx) blob)))
+ (bit.left-shift +24 (byte-to-nat (host.array-read idx blob)))
+ (bit.left-shift +16 (byte-to-nat (host.array-read (n/+ +1 idx) blob)))
+ (bit.left-shift +8 (byte-to-nat (host.array-read (n/+ +2 idx) blob)))
(byte-to-nat (host.array-read (n/+ +3 idx) blob))))
(ex.throw index-out-of-bounds (%n idx))))
@@ -61,13 +61,13 @@
(-> Nat Blob (e.Error Nat))
(if (n/< (host.array-length blob) (n/+ +7 idx))
(#e.Success ($_ bit.or
- (bit.shift-left +56 (byte-to-nat (host.array-read idx blob)))
- (bit.shift-left +48 (byte-to-nat (host.array-read (n/+ +1 idx) blob)))
- (bit.shift-left +40 (byte-to-nat (host.array-read (n/+ +2 idx) blob)))
- (bit.shift-left +32 (byte-to-nat (host.array-read (n/+ +3 idx) blob)))
- (bit.shift-left +24 (byte-to-nat (host.array-read (n/+ +4 idx) blob)))
- (bit.shift-left +16 (byte-to-nat (host.array-read (n/+ +5 idx) blob)))
- (bit.shift-left +8 (byte-to-nat (host.array-read (n/+ +6 idx) blob)))
+ (bit.left-shift +56 (byte-to-nat (host.array-read idx blob)))
+ (bit.left-shift +48 (byte-to-nat (host.array-read (n/+ +1 idx) blob)))
+ (bit.left-shift +40 (byte-to-nat (host.array-read (n/+ +2 idx) blob)))
+ (bit.left-shift +32 (byte-to-nat (host.array-read (n/+ +3 idx) blob)))
+ (bit.left-shift +24 (byte-to-nat (host.array-read (n/+ +4 idx) blob)))
+ (bit.left-shift +16 (byte-to-nat (host.array-read (n/+ +5 idx) blob)))
+ (bit.left-shift +8 (byte-to-nat (host.array-read (n/+ +6 idx) blob)))
(byte-to-nat (host.array-read (n/+ +7 idx) blob))))
(ex.throw index-out-of-bounds (%n idx))))
@@ -83,7 +83,7 @@
(-> Nat Nat Blob (e.Error Top))
(if (n/< (host.array-length blob) (n/+ +1 idx))
(exec (|> blob
- (host.array-write idx (host.long-to-byte (:! Int (bit.shift-right +8 value))))
+ (host.array-write idx (host.long-to-byte (:! Int (bit.logical-right-shift +8 value))))
(host.array-write (n/+ +1 idx) (host.long-to-byte (:! Int value))))
(#e.Success []))
(ex.throw index-out-of-bounds (%n idx))))
@@ -92,9 +92,9 @@
(-> Nat Nat Blob (e.Error Top))
(if (n/< (host.array-length blob) (n/+ +3 idx))
(exec (|> blob
- (host.array-write idx (host.long-to-byte (:! Int (bit.shift-right +24 value))))
- (host.array-write (n/+ +1 idx) (host.long-to-byte (:! Int (bit.shift-right +16 value))))
- (host.array-write (n/+ +2 idx) (host.long-to-byte (:! Int (bit.shift-right +8 value))))
+ (host.array-write idx (host.long-to-byte (:! Int (bit.logical-right-shift +24 value))))
+ (host.array-write (n/+ +1 idx) (host.long-to-byte (:! Int (bit.logical-right-shift +16 value))))
+ (host.array-write (n/+ +2 idx) (host.long-to-byte (:! Int (bit.logical-right-shift +8 value))))
(host.array-write (n/+ +3 idx) (host.long-to-byte (:! Int value))))
(#e.Success []))
(ex.throw index-out-of-bounds (%n idx))))
@@ -103,13 +103,13 @@
(-> Nat Nat Blob (e.Error Top))
(if (n/< (host.array-length blob) (n/+ +7 idx))
(exec (|> blob
- (host.array-write idx (host.long-to-byte (:! Int (bit.shift-right +56 value))))
- (host.array-write (n/+ +1 idx) (host.long-to-byte (:! Int (bit.shift-right +48 value))))
- (host.array-write (n/+ +2 idx) (host.long-to-byte (:! Int (bit.shift-right +40 value))))
- (host.array-write (n/+ +3 idx) (host.long-to-byte (:! Int (bit.shift-right +32 value))))
- (host.array-write (n/+ +4 idx) (host.long-to-byte (:! Int (bit.shift-right +24 value))))
- (host.array-write (n/+ +5 idx) (host.long-to-byte (:! Int (bit.shift-right +16 value))))
- (host.array-write (n/+ +6 idx) (host.long-to-byte (:! Int (bit.shift-right +8 value))))
+ (host.array-write idx (host.long-to-byte (:! Int (bit.logical-right-shift +56 value))))
+ (host.array-write (n/+ +1 idx) (host.long-to-byte (:! Int (bit.logical-right-shift +48 value))))
+ (host.array-write (n/+ +2 idx) (host.long-to-byte (:! Int (bit.logical-right-shift +40 value))))
+ (host.array-write (n/+ +3 idx) (host.long-to-byte (:! Int (bit.logical-right-shift +32 value))))
+ (host.array-write (n/+ +4 idx) (host.long-to-byte (:! Int (bit.logical-right-shift +24 value))))
+ (host.array-write (n/+ +5 idx) (host.long-to-byte (:! Int (bit.logical-right-shift +16 value))))
+ (host.array-write (n/+ +6 idx) (host.long-to-byte (:! Int (bit.logical-right-shift +8 value))))
(host.array-write (n/+ +7 idx) (host.long-to-byte (:! Int value))))
(#e.Success []))
(ex.throw index-out-of-bounds (%n idx))))
diff --git a/stdlib/test/test/lux/data/bit.lux b/stdlib/test/test/lux/data/bit.lux
index ca9e21d86..f8c9bc8ef 100644
--- a/stdlib/test/test/lux/data/bit.lux
+++ b/stdlib/test/test/lux/data/bit.lux
@@ -66,6 +66,6 @@
(test "Shift right respect the sign of ints."
(let [value (nat-to-int pattern)]
(if (i/< 0 value)
- (i/< 0 (&.signed-shift-right idx value))
- (i/>= 0 (&.signed-shift-right idx value)))))
+ (i/< 0 (&.arithmetic-right-shift idx value))
+ (i/>= 0 (&.arithmetic-right-shift idx value)))))
))))
diff --git a/stdlib/test/test/lux/world/blob.lux b/stdlib/test/test/lux/world/blob.lux
index bd185d16f..b2cc51d0f 100644
--- a/stdlib/test/test/lux/world/blob.lux
+++ b/stdlib/test/test/lux/world/blob.lux
@@ -49,9 +49,9 @@
_
(undefined)))))
- #let [value-8 (n/% (bit.shift-left +8 +1) value)
- value-16 (n/% (bit.shift-left +16 +1) value)
- value-32 (n/% (bit.shift-left +32 +1) value)
+ #let [value-8 (n/% (bit.left-shift +8 +1) value)
+ value-16 (n/% (bit.left-shift +16 +1) value)
+ value-32 (n/% (bit.left-shift +32 +1) value)
value-64 value
slice-size (|> to (n/- from) n/inc)
random-slice (e.assume (@.slice from to random-blob))]]