Hacker News new | ask | show | jobs
by andrewf 1402 days ago
Could you do it with shifts and increments? Constant loads would look just like multiplies, a glorious RISC apotheosis..
1 comments

Yes, you could get 0 by subtracting (or xoring) a register with itself, then -1 by complementing, then 1 by negating, then adding to itself to get any single bit. Then synthesize any constant by adding those. The code would be impractically slow and large, though.