Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Instruction Set Micro-Optimizations

Name: Anonymous 2012-11-28 18:01

I've always been interested in these, even if few people have a chance to experiment with them, so, yeah, let's do it.

Some 6502 derivatives feature dedicated store 0 and load 0 instructions, which saves a byte and (possibly, I don't remember) a cycle for a very common operation. Neat.

A lot of RISC architectures, on the other hand, feature a dedicated 0 register for this purpose -- iirc, in MIPS, register 0 is always 0. It seems at first glance that this would be more general and useful than load/store 0 instructions, but I'm having trouble thinking of a use for the register besides loading and storing 0 values. On second thought, maybe it's a waste of a register.

Name: Cudder !MhMRSATORI!fR8duoqGZdD/iE5 2012-11-29 5:05

>>9
The question is whether the code has more instances where an operation produces a value from two existing ones (3-operand has advantage here) that also need preserving, or one of them is never used again (2-operand advantage). The majority of common code is probably the latter, with the former maybe more common in certain scientific computing applications.

Fixed-length RISCs certainly have a sparse (SPARCse?) opcode space, which makes them need more memory bandwidth than CISCs with variable-length instructions; they're quite wasteful of opcode space in that way. They usually compensate with more cache and higher clock frequency, which worked OK until a few years ago.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List