faster xor_from_ptr using fixed 16/256 return address
tomhea opened this issue · 1 comments
tomhea commented
remove the double call to ptr_wflip_second_word (~3w@) by jumping to a fixed-address 16/256 that also holds the read-from-ptr-handling.
There are 3 ways of making the (*ptr).jump = 16/256:
- Replacing the ptr_wflip_second_word with a slimmer macro: flip-ptr-2nd-word-4/8th-bit (total: ~w@).
- Flipping a big chunk of memory by
rep(30000, i) fj mem+i*dw+dbit+4/8, $
, or define that memory section in the first place with the 4/8th bit on. - Creating .fjm v4 that supports placing a fixed fj-op multiple times (can also allow other different default-op than 0) on the way. It will also require fj-parser new command:
reserve_op num_of_ops, fixed-flip-address, fixed-jump-address
(e.g.reserve_op 30000, 0, 256
for initializing brainfuck memory)
My preferable choice is (*ptr).jump = 256 (byte-read, which also supports hex/bit reads) + creating .fjm v4 + reserve_op
command. Also, implement a xor_byte_to_ptr + xor_ptr_to_byte.
tomhea commented
I implemented (*ptr).jump = 256 (byte-read, which also supports hex/bit reads), and I didn't create a .fjm v4 as I just flipped the 256 bit.
I also implemented read_byte / write_byte, and same for vectors
I also transformed the push n / pop n to use the read/write_byte n.
merged in #250.