MCPcopy Create free account
hub / github.com/GJDuck/e9patch / sendSExtFromI32ToR64

Function sendSExtFromI32ToR64

src/e9tool/e9codegen.cpp:1447–1457  ·  view source on GitHub ↗

* Send a `mov $value,%r32' instruction. */

Source from the content-addressed store, hash-verified

1445 * Send a `mov $value,%r32' instruction.
1446 */
1447void sendSExtFromI32ToR64(FILE *out, const char *value, int regno)
1448{
1449 const uint8_t REX[] =
1450 {0x48, 0x48, 0x48, 0x48, 0x49, 0x49, 0x00,
1451 0x48, 0x49, 0x49, 0x48, 0x48, 0x49, 0x49, 0x49, 0x49, 0x48};
1452 const uint8_t MODRM[] =
1453 {0xc7, 0xc6, 0xc2, 0xc1, 0xc0, 0xc1, 0x00,
1454 0xc0, 0xc2, 0xc3, 0xc3, 0xc5, 0xc4, 0xc5, 0xc6, 0xc7, 0xc4};
1455 fprintf(out, "%u,%u,%u,%s,",
1456 REX[regno], 0xc7, MODRM[regno], value);
1457}
1458
1459/*
1460 * Send a `mov $value,%r32' instruction.

Callers 6

sendLoadValueMetadataFunction · 0.85
sendLoadFromMemOpToR64Function · 0.85
sendLoadRegToArgFunction · 0.85
sendLoadOperandMetadataFunction · 0.85
sendLoadTargetMetadataFunction · 0.85
sendLoadArgumentMetadataFunction · 0.85

Calls 1

fprintfFunction · 0.50

Tested by

no test coverage detected