** Code commutative operators ('+', '*'). If first operand is a ** numeric constant, change order of operands to try to use an ** immediate or K operator. */
| 1446 | ** immediate or K operator. |
| 1447 | */ |
| 1448 | static void codecommutative (FuncState *fs, BinOpr op, |
| 1449 | expdesc *e1, expdesc *e2, int line) { |
| 1450 | int flip = 0; |
| 1451 | if (tonumeral(e1, NULL)) { /* is first operand a numeric constant? */ |
| 1452 | swapexps(e1, e2); /* change order */ |
| 1453 | flip = 1; |
| 1454 | } |
| 1455 | if (op == OPR_ADD && isSCint(e2)) /* immediate operand? */ |
| 1456 | codebini(fs, cast(OpCode, OP_ADDI), e1, e2, flip, line, TM_ADD); |
| 1457 | else |
| 1458 | codearith(fs, op, e1, e2, flip, line); |
| 1459 | } |
| 1460 | |
| 1461 | |
| 1462 | /* |