paul99/v8m-rb — comment on commit b5c84e2eeff28342a555cc62cd2b6e47294c760f
File: src/mips/code-stubs-mips.cc line 1956
By paul99:

OK, this one is an interesting issue. (I would welcome Petar's input here as well, since he has a lot more experience in various compiler platforms than I do.)

So I sure do understand that we cannot leave just 'movz' in the delay slot, cause it will break Loongson. However, I hate to see us make the choice to never use this "nicer" instruction in a place because it is not in the lowest-common-denominator of all our platforms.

I wonder if it is not better in this case to do something like
```c++
if (!result) {
if (arch_variant != loongson) {
__ Ret(USE_DELAY_SLOT, eq, at, Operand(zero_reg));
__ movz_(tos_, zero_reg, at);
} else { // Loongson doesn't have single-instruction movz.
__ Movz(tos_, zero_reg, at);
__ Ret(eq, at, Operand(zero_reg));
}
}
```

or something like that ... the point is, rather than accept lowest common denominator limits, we move arch decisions up to this level, and use the optimal version where we can.

If this is used in just one place everywhere, who cares. But I'd hate to see us trading off too much performance. And the usage of the delay slots can be a nice advantage for mips.

Finally, this also points out the value of Daniel's suggestion on movz() -> movz_(), because then we cannot possibly miss one of these cases, and leave it wrong in the code.