Hacker Timesnew | past | comments | ask | show | jobs | submitlogin

Right. There are different cases, yes?

Say we are zeroing memory. No advantage there. Coupla cycles right at the start, then a ton of writes.

Say we are forming a bitmask. Could be an advantage there in that having a zero handy in a register means no fetching one. When a lot of dynamically created masks are needed, this can be a nice gain.

I'm sure we can come up with more. It's not always important, and like you mention with the moto designs, may not matter too much due to many other optimizations possible given a good instruction set.

Some people would rather have the register free for general use! I'm one of those, but if there is a zero register, I use it to get the benefit of it when I can. On the devices I've seen, there are generally a lot of registers so the marginal impact of having a zero register isn't significant. There are plenty to work with.

Maybe I should be clear here too. I personally don't care whether there is one. If it's there, I do things in ways that leverage it, and was just pointing out why devices that have one, ahem... have one! Those that don't may or may not have options that make sense. The way moto did it is very good, and there are other pretty great optimizations possible with their ISA, abusing the stack to write memory, etc...

If not, then I do other things. It's assembly language! Work the chip, right?



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: