From 07c70ad15ba4a8c9b00773a0a14eade28fe06569 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 7 May 2018 21:43:19 -0400 Subject: - Implemented bit-count in pure Lux. --- luxc/src/lux/analyser/proc/common.clj | 9 --------- luxc/src/lux/compiler/jvm/proc/common.clj | 12 ------------ 2 files changed, 21 deletions(-) (limited to 'luxc/src') 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 [ ] (defn [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 [ ] (defn [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) -- cgit v1.2.3