diff options
| author | Mike Pall <mike> | 2011-04-28 12:54:46 +0200 |
|---|---|---|
| committer | Mike Pall <mike> | 2011-04-28 12:54:46 +0200 |
| commit | 7ff84097976f09dfa306e0fb20103292bef9aee3 (patch) | |
| tree | 1901453a6d092543b4ca4d368c7a77a9f19e8e96 | |
| parent | 0b606061dbe38bec18a4fdf37bfd248398ad015c (diff) | |
| download | luajit-7ff84097976f09dfa306e0fb20103292bef9aee3.tar.gz luajit-7ff84097976f09dfa306e0fb20103292bef9aee3.tar.bz2 luajit-7ff84097976f09dfa306e0fb20103292bef9aee3.zip | |
DynASM: x86/x64: Fix vreg in opcode. x64: Fix imm "I" after abs addr.
| -rw-r--r-- | dynasm/dasm_x86.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dynasm/dasm_x86.lua b/dynasm/dasm_x86.lua index 0d4bd4c3..4ade52f0 100644 --- a/dynasm/dasm_x86.lua +++ b/dynasm/dasm_x86.lua | |||
| @@ -525,12 +525,13 @@ local function wputmrmsib(t, imark, s, vsreg) | |||
| 525 | -- Pure 32 bit displacement. | 525 | -- Pure 32 bit displacement. |
| 526 | if x64 and tdisp ~= "table" then | 526 | if x64 and tdisp ~= "table" then |
| 527 | wputmodrm(0, s, 4) -- [disp] -> (0, s, esp) (0, esp, ebp) | 527 | wputmodrm(0, s, 4) -- [disp] -> (0, s, esp) (0, esp, ebp) |
| 528 | if imark == "I" then waction("MARK") end | ||
| 528 | wputmodrm(0, 4, 5) | 529 | wputmodrm(0, 4, 5) |
| 529 | else | 530 | else |
| 530 | riprel = x64 | 531 | riprel = x64 |
| 531 | wputmodrm(0, s, 5) -- [disp|rip-label] -> (0, s, ebp) | 532 | wputmodrm(0, s, 5) -- [disp|rip-label] -> (0, s, ebp) |
| 533 | if imark == "I" then waction("MARK") end | ||
| 532 | end | 534 | end |
| 533 | if imark == "I" then waction("MARK") end | ||
| 534 | if vsreg then waction("VREG", vsreg); wputxb(2) end | 535 | if vsreg then waction("VREG", vsreg); wputxb(2) end |
| 535 | end | 536 | end |
| 536 | if riprel then -- Emit rip-relative displacement. | 537 | if riprel then -- Emit rip-relative displacement. |
| @@ -1521,7 +1522,7 @@ local function dopattern(pat, args, sz, op, needrex) | |||
| 1521 | if szov == "q" and rex == 0 then rex = rex + 8 end | 1522 | if szov == "q" and rex == 0 then rex = rex + 8 end |
| 1522 | if needrex then rex = rex + 16 end | 1523 | if needrex then rex = rex + 16 end |
| 1523 | if addin and addin.reg == -1 then | 1524 | if addin and addin.reg == -1 then |
| 1524 | wputop(szov, opcode + 1, rex) | 1525 | wputop(szov, opcode - 7, rex) |
| 1525 | waction("VREG", addin.vreg); wputxb(0) | 1526 | waction("VREG", addin.vreg); wputxb(0) |
| 1526 | else | 1527 | else |
| 1527 | if addin and addin.reg > 7 then rex = rex + 1 end | 1528 | if addin and addin.reg > 7 then rex = rex + 1 end |
