mulsi3 is a special name. You can use it for introns only when they are extremely simple.
Indeed, in your case, the mulsi3 template should be define_expand, then you can make it unsuccessful on some branches (with an explicit FAIL expression). The compiler should generate a libgcc call if the custom extension template fails.
But there are two more amendments:
1) Prefer pattern matching with an explicit if-else internal pattern. That is, write separate = r, r, r and = r, r, i command templates, limit them to both predicates and restrictions on the allowable ranges. The compiler must generate a libgcc call, if it cannot find a suitable template, you do not need (and in most cases it is a bad idea) to explicitly write FAIL.
2) Be careful with matching predicates / constraints. "nonememory operand" is an extremely bad predicate for "r, r". Let's say you have a legal constant here, and your program is large, and the reboot cannot find the register ... and everything will explode.
I also recommend that you ask such detailed questions in gcc@gcc.gnu.org maillist.
source share