Revert "Optimize byte-reverse macro in alien.endian -- it was shifting each byte to the 0th bit place, bitand-ing it with HEX: ff, then shifting it to its final destination -- now we immediately shift to the proper location and bitand with the proper bitmask."
This reverts commit c701a39e89.
			
			
				db4
			
			
		
							parent
							
								
									90e1002349
								
							
						
					
					
						commit
						9f4eeb55f9
					
				| 
						 | 
				
			
			@ -18,21 +18,13 @@ ERROR: invalid-signed-conversion n ;
 | 
			
		|||
        [ invalid-signed-conversion ]
 | 
			
		||||
    } case ; inline
 | 
			
		||||
 | 
			
		||||
<PRIVATE
 | 
			
		||||
 | 
			
		||||
: byte-mask ( #bits-shift -- mask )
 | 
			
		||||
    [ HEX: ff ] dip shift ; foldable
 | 
			
		||||
 | 
			
		||||
PRIVATE>
 | 
			
		||||
 | 
			
		||||
MACRO: byte-reverse ( n signed? -- quot )
 | 
			
		||||
    [
 | 
			
		||||
        drop
 | 
			
		||||
        [
 | 
			
		||||
            dup iota [
 | 
			
		||||
                [ 1 + - -8 * ] [ nip 8 * ] 2bi
 | 
			
		||||
                [ + ] [ nip byte-mask ] 2bi
 | 
			
		||||
                '[ _ shift _ bitand ]
 | 
			
		||||
                '[ _ shift HEX: ff bitand _ shift ]
 | 
			
		||||
            ] with map
 | 
			
		||||
        ] [ 1 - [ bitor ] n*quot ] bi
 | 
			
		||||
    ] [
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue