aboutsummaryrefslogtreecommitdiff
path: root/luxc
diff options
context:
space:
mode:
authorEduardo Julian2018-05-07 21:43:19 -0400
committerEduardo Julian2018-05-07 21:43:19 -0400
commit07c70ad15ba4a8c9b00773a0a14eade28fe06569 (patch)
tree18d6e938cb0a79ecffddd64da1958de47d75ee0f /luxc
parentfebfa99c2823219c2e76d2c73b1fd8db8f6c9918 (diff)
- Implemented bit-count in pure Lux.
Diffstat (limited to '')
-rw-r--r--luxc/src/lux/analyser/proc/common.clj9
-rw-r--r--luxc/src/lux/compiler/jvm/proc/common.clj12
2 files changed, 0 insertions, 21 deletions
diff --git a/luxc/src/lux/analyser/proc/common.clj b/luxc/src/lux/analyser/proc/common.clj
index 93e83c2a2..44095998c 100644
--- a/luxc/src/lux/analyser/proc/common.clj
+++ b/luxc/src/lux/analyser/proc/common.clj
@@ -136,14 +136,6 @@
^:private analyse-bit-xor "xor"
)
-(defn ^:private analyse-bit-count [analyse exo-type ?values]
- (|do [:let [(&/$Cons input (&/$Nil)) ?values]
- =input (&&/analyse-1 analyse &type/Nat input)
- _ (&type/check exo-type &type/Nat)
- _cursor &/cursor]
- (return (&/|list (&&/|meta exo-type _cursor
- (&&/$proc (&/T ["bit" "count"]) (&/|list =input) (&/|list)))))))
-
(do-template [<name> <op> <type>]
(defn <name> [analyse exo-type ?values]
(|do [:let [(&/$Cons input (&/$Cons shift (&/$Nil))) ?values]
@@ -456,7 +448,6 @@
"lux text char" (analyse-text-char analyse exo-type ?values)
"lux text contains?" (analyse-text-contains? analyse exo-type ?values)
- "lux bit count" (analyse-bit-count analyse exo-type ?values)
"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)
diff --git a/luxc/src/lux/compiler/jvm/proc/common.clj b/luxc/src/lux/compiler/jvm/proc/common.clj
index 018ccf55d..4bf2e8dbf 100644
--- a/luxc/src/lux/compiler/jvm/proc/common.clj
+++ b/luxc/src/lux/compiler/jvm/proc/common.clj
@@ -130,17 +130,6 @@
^:private compile-bit-xor Opcodes/LXOR
)
-(defn ^:private compile-bit-count [compile ?values special-args]
- (|do [:let [(&/$Cons ?input (&/$Nil)) ?values]
- ^MethodVisitor *writer* &/get-writer
- _ (compile ?input)
- :let [_ (&&/unwrap-long *writer*)]
- :let [_ (doto *writer*
- (.visitMethodInsn Opcodes/INVOKESTATIC "java/lang/Long" "bitCount" "(J)I")
- (.visitInsn Opcodes/I2L)
- &&/wrap-long)]]
- (return nil)))
-
(do-template [<name> <op>]
(defn <name> [compile ?values special-args]
(|do [:let [(&/$Cons ?input (&/$Cons ?shift (&/$Nil))) ?values]
@@ -700,7 +689,6 @@
"bit"
(case proc
- "count" (compile-bit-count compile ?values special-args)
"and" (compile-bit-and compile ?values special-args)
"or" (compile-bit-or compile ?values special-args)
"xor" (compile-bit-xor compile ?values special-args)