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

Function sendMovFromR32ToR64

src/e9tool/e9codegen.cpp:1185–1198  ·  view source on GitHub ↗

* Send a `movslq %r32,%r64' instruction. */

Source from the content-addressed store, hash-verified

1183 * Send a `movslq %r32,%r64' instruction.
1184 */
1185void sendMovFromR32ToR64(FILE *out, int srcno, int dstno)
1186{
1187 const uint8_t REX_MASK[] =
1188 {0, 0, 0, 0, 1, 1, 0,
1189 0, 1, 1, 0, 0, 1, 1, 1, 1, 0};
1190 const uint8_t REX[] = {0x48, 0x4c, 0x49, 0x4d};
1191 const uint8_t REG[] =
1192 {0x07, 0x06, 0x02, 0x01, 0x00, 0x01, 0x00,
1193 0x00, 0x02, 0x03, 0x03, 0x05, 0x04, 0x05, 0x06, 0x07, 0x04};
1194
1195 uint8_t rex = REX[(REX_MASK[srcno] << 1) | REX_MASK[dstno]];
1196 uint8_t modrm = (0x03 << 6) | (REG[dstno] << 3) | REG[srcno];
1197 fprintf(out, "%u,%u,%u,", rex, 0x63, modrm);
1198}
1199
1200/*
1201 * Send a `movswl %r16,%r64' instruction.

Callers 2

sendLoadRegToArgFunction · 0.85
sendLoadArgumentMetadataFunction · 0.85

Calls 1

fprintfFunction · 0.50

Tested by

no test coverage detected