4 ms·
Ha, this is neat, I haven't seen the permutation table presented this way before, good stuff. permute: ; Rather than permuting the 32-bit words stored
by marktangotango 5y ago
Ha, this is neat, I haven't seen the permutation table presented this way before, good stuff.
permute:
; Rather than permuting the 32-bit words stored in the
; COMPRESS_MSG array, we permute the 8-bit pointers stored
; in the MPTRS array.
;
; The permutation is defined to be:
; 2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8
;
; If we walk those assignments, we get two loops:
; 0<-2<-3<-10<-12<-9<-11<-5<-0
; 1<-6<-4<-7<-13<-14<-15<-8<-1
- oconnor663 5y agoI'm pleased with that part, but I'm ashamed of my ror12 function :p I'd love it if anyone could suggest a better way to do it.
- Someone 5y agohttp://6502.org/source/general/SWN.html http://6502.org/source/general/SWN.html swaps the nybbles in A in 8 bytes/12 cycles. That’s not quite what you need, but may give you ideas.
- oconnor663 5y agoOh that looks perfect. I'll have to try it out today and report back.
- jacquesm 5y agoIf you want to be on the far end of the speed/space trade off you could simply use a lookup table. That should speed things up considerably. You'd index it by byte (split the tables, save one shift left) and then recombine the results.