* Send a `mov $value,%r64' instruction. */
| 1475 | * Send a `mov $value,%r64' instruction. |
| 1476 | */ |
| 1477 | void sendZExtFromI32ToR64(FILE *out, const char *value, int regno) |
| 1478 | { |
| 1479 | const uint8_t REX[] = |
| 1480 | {0x00, 0x00, 0x00, 0x00, 0x41, 0x41, 0x00, |
| 1481 | 0x00, 0x41, 0x41, 0x00, 0x00, 0x41, 0x41, 0x41, 0x41, 0x00}; |
| 1482 | const uint8_t OPCODE[] = |
| 1483 | {0xbf, 0xbe, 0xba, 0xb9, 0xb8, 0xb9, 0x00, |
| 1484 | 0xb8, 0xba, 0xbb, 0xbb, 0xbd, 0xbc, 0xbd, 0xbe, 0xbf, 0xbc}; |
| 1485 | if (REX[regno] != 0x00) |
| 1486 | fprintf(out, "%u,", REX[regno]); |
| 1487 | fprintf(out, "%u,%s,", OPCODE[regno], value); |
| 1488 | } |
| 1489 | |
| 1490 | /* |
| 1491 | * Send a `mov $value,%r64' instruction. |
no test coverage detected