Hacker News new | ask | show | jobs
by kps 1402 days ago
> the ISA didn't support immediates

I don't know the article, but have a related story. In the '90s I worked for a custom compiler shop, and a company you've heard of (not Intel) came to us with a system they wanted tools for. They had gone all-in on RISC — operations were all register-to-register, and the only memory addressing was register indirect (i.e. through an address in a register). We had to point out that it would be rather difficult to get an address into a register in the first place.

1 comments

Could you do it with shifts and increments? Constant loads would look just like multiplies, a glorious RISC apotheosis..
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.