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. --- .../source/luxc/lang/translation/r/runtime.jvm.lux | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux') 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 ced898662..5f073eb17 100644 --- a/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux +++ b/new-luxc/source/luxc/lang/translation/r/runtime.jvm.lux @@ -609,24 +609,6 @@ [bit//xor r.bit-xor] ) -(runtime: (bit//count-32 input) - (with-vars [count] - ($_ r.then - (r.set! count (r.int 0)) - (let [last-input-bit (|> (@@ input) (r.bit-and (r.int 1))) - update-count! (r.set! count (|> (@@ count) (r.+ last-input-bit))) - consume-input! (r.set! input (|> (@@ input) (r.bit-ushr (r.int 1)))) - input-remaining? (|> (@@ input) (r.= (r.int 0)))] - (r.while input-remaining? - ($_ r.then - update-count! - consume-input!))) - (@@ count)))) - -(runtime: (bit//count input) - (int//from-float (r.+ (bit//count-32 (int64-high (@@ input))) - (bit//count-32 (int64-low (@@ input)))))) - (runtime: (bit//logical-right-shift shift input) ($_ r.then (limit-shift! shift) @@ -656,8 +638,6 @@ @@bit//or @@bit//xor @@bit//not - @@bit//count-32 - @@bit//count @@bit//left-shift @@bit//arithmetic-right-shift-32 @@bit//arithmetic-right-shift -- cgit v1.2.3