DynamoRIO / DynamoRIO/drmemory

support multi-source non-ALU sub-dword instrs in fastpath

Open
#401 0 comments 0 reactions 0 assignees View on GitHub
Migrated Performance Priority-Low
Dominant language
C
Stars
2.7k
Forks
290
PR merge metrics
No merged PRs in 30d

Description

_From [bruen...@google.com](https://code.google.com/u/109494838902877177630/) on May 15, 2011 12:45:52_

for {div,idiv}b we treat ah+al dest as ax, turning it into an ALU op

2-byte though has multiple sources with non-identical offs:
data16 div 0x42(%ecx) %dx %ax -> %dx %ax

for now doing check_definedness.
to propagate should do two-step: first combine %ax into %dx (simple or),
then combine result into mem/reg src0 by invoking add_dstX2_shadow_write()
pretening that src0 is the dst (have to get into a reg) and telling to
preserve. then do non-alu propagation to 2 dsts.

also:
{OP_mul, 0xf60024, "mul", ax, xx, Eb, al, xx, mrm, fW6, END_LIST},
{OP_imul, 0xf60025, "imul", ax, xx, Eb, al, xx, mrm, fW6, tsb[0xaf]},

these seem to be the only Eb w/ >=2 srcs that aren't either ALU or test/cmp.
> grep 'Ev,' x86/decode_table.c | grep -vE 'Ev._Ev|xx, *xx|Gv._Gv'
{OP_imul, 0x690000, "imul", Gv, xx, Ev, Iz, xx, mrm, fW6, tfb[0x6b]},
{OP_imul, 0x6b0000, "imul", Gv, xx, Ev, Ib, xx, mrm, fW6, END_LIST},
{OP_mul, 0xf70024, "mul", eDX, eAX, Ev, eAX, xx, mrm, fW6, tex[9][4]},
{OP_imul, 0xf70025, "imul", eDX, eAX, Ev, eAX, xx, mrm, fW6, tex[9][5]},
{OP_div, 0xf70026, "div", eDX, eAX, Ev, eDX, eAX, mrm, fW6, tex[9][6]},
{OP_idiv, 0xf70027, "idiv", eDX, eAX, Ev, eDX, eAX, mrm, fW6, tex[9][7]},
> grep 'Eb,' x86/decode_table.c | grep -vE 'Eb._Eb|xx, *xx|Gb._Gb'
{OP_mul, 0xf60024, "mul", ax, xx, Eb, al, xx, mrm, fW6, END_LIST},
{OP_imul, 0xf60025, "imul", ax, xx, Eb, al, xx, mrm, fW6, tsb[0xaf]},
{OP_div, 0xf60026, "div", ah, al, Eb, ax, xx, mrm, fW6, END_LIST},
{OP_idiv, 0xf60027, "idiv", ah, al, Eb, ax, xx, mrm, fW6, END_LIST},
{OP_crc32, 0xf238f018, "crc32", Gv, xx, Eb, Gv, xx, mrm, x, END_LIST},
{OP_pinsrb, 0x663a2018, "pinsrb", Vdq, xx, Eb, Ib, xx, mrm|reqp, x, END_LIST},
{OP_vpinsrb, 0x663a2018, "vpinsrb", Vdq, xx, Hdq, Eb, Ib, mrm|vex|reqp, x, END_LIST},

again, for now doing check_definedness.
to propagate should do two-step like div/idiv: first combine %al into
mem/reg src0 by invoking add_dstX2_shadow_write() pretening that src0 is
the dst (have to get into a reg) and telling to preserve. then do non-alu
propagation to 2 dsts.

_Original issue: http://code.google.com/p/drmemory/issues/detail?id=401_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.