* Send a `movswl %r16,%r64' instruction. */
| 1201 | * Send a `movswl %r16,%r64' instruction. |
| 1202 | */ |
| 1203 | void sendMovFromR16ToR64(FILE *out, int srcno, int dstno) |
| 1204 | { |
| 1205 | const uint8_t REX_MASK[] = |
| 1206 | {0, 0, 0, 0, 1, 1, 0, |
| 1207 | 0, 1, 1, 0, 0, 1, 1, 1, 1, 0}; |
| 1208 | const uint8_t REX[] = {0x48, 0x4c, 0x49, 0x4d}; |
| 1209 | const uint8_t REG[] = |
| 1210 | {0x07, 0x06, 0x02, 0x01, 0x00, 0x01, 0x00, |
| 1211 | 0x00, 0x02, 0x03, 0x03, 0x05, 0x04, 0x05, 0x06, 0x07, 0x04}; |
| 1212 | |
| 1213 | uint8_t rex = REX[(REX_MASK[srcno] << 1) | REX_MASK[dstno]]; |
| 1214 | uint8_t modrm = (0x03 << 6) | (REG[dstno] << 3) | REG[srcno]; |
| 1215 | fprintf(out, "%u,%u,%u,%u,", rex, 0x0f, 0xbf, modrm); |
| 1216 | } |
| 1217 | |
| 1218 | /* |
| 1219 | * Send a `movsbl %r8,%r32' instruction. |
no test coverage detected