* Send a `movslq %r32,%r64' instruction. */
| 1183 | * Send a `movslq %r32,%r64' instruction. |
| 1184 | */ |
| 1185 | void 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. |
no test coverage detected