hyln9 / ikarus

Optimizing incremental native-code compiler for R6RS scheme. This is a forked repository.
https://launchpad.net/ikarus
Other
5 stars 0 forks source link

Please implement `fxreverse-bit-field' #264

Closed hyln9 closed 10 years ago

hyln9 commented 10 years ago

Attached is a patch that adds a simple (and slow) implementation of `fxreverse-bit-field', using the algorithm from http://graphics.stanford.edu/~seander/bithacks.html#BitReverseObvious. Unfortunatly, my low-level Ikarus hacking skills didn't suffice to implement one of the smarter solutions from that page.

(FWIW, `fxreverse-bit-field' is used by the Huffmann coder in Göran's industria library collection).

Launchpad Details: #LP440155 Andreas Rottmann - 2009-10-01 14:53:50 -0400

hyln9 commented 10 years ago

@rotty: Dont you think UNLESS would work better than those crazy nested IF's ?

Launchpad Details: #LPC leppie - 2009-10-02 12:51:01 -0400

hyln9 commented 10 years ago

On Oct 2, 2009, at 7:51 PM, leppie wrote:

@rotty: Dont you think UNLESS would work better than those crazy
nested IF's ?

I think he's just following the style that's already there. It's all
my fault.

Aziz,,,

Launchpad Details: #LPC Abdulaziz Ghuloum - 2009-10-02 13:44:22 -0400

hyln9 commented 10 years ago

leppie

@rotty: Dont you think UNLESS would work better than those crazy nested IF's ?

I tried to follow the style of the existing code in the patch. I assume Aziz had a reason to write it that way, but I don't know what that reason would be. I agree that a version using `unless' would be more readable.

Launchpad Details: #LPC Andreas Rottmann - 2009-10-02 13:48:56 -0400

hyln9 commented 10 years ago

I've written and attached an fxreverse-bit-field that does not loop if the system uses 61-bit or 30-bit fixnums. You can probably remove the loop for Ikarus (and it's not a very good loop anyway).

Launchpad Details: #LPC Göran Weinholt - 2009-10-08 18:28:03 -0400

hyln9 commented 10 years ago

Matched by Vicare issue 6, implemented using Goran's patch. Goran is it fine for you?

Launchpad Details: #LPC Marco Maggi - 2010-06-07 05:48:14 -0400

hyln9 commented 10 years ago

Marco Maggi

Matched by Vicare issue 6, implemented using Goran's patch. Goran is it fine for you?

Sure.

Göran Weinholt

Launchpad Details: #LPC Göran Weinholt - 2010-06-07 14:58:05 -0400

hyln9 commented 10 years ago

Implemented in commit 6c0804e49adb2cc7d3e2d09d95ae723817881908