318c318,319
< dataSize, addressSize, baseFlags, atCPL0, prefetch, nonSpec):
---
> dataSize, addressSize, baseFlags, atCPL0, prefetch, nonSpec,
> implicitStack):
334,335c335,339
< self.memFlags += " | (machInst.legacy.addr ? " + \
< "(AddrSizeFlagBit << FlagShift) : 0)"
---
> # For implicit stack operations, we should use *not* use the
> # alternative addressing mode for loads/stores if the prefix is set
> if not implicitStack:
> self.memFlags += " | (machInst.legacy.addr ? " + \
> "(AddrSizeFlagBit << FlagShift) : 0)"
354c358,359
< dataSize, addressSize, baseFlags, atCPL0, prefetch, nonSpec):
---
> dataSize, addressSize, baseFlags, atCPL0, prefetch, nonSpec,
> implicitStack):
370,371c375,379
< self.memFlags += " | (machInst.legacy.addr ? " + \
< "(AddrSizeFlagBit << FlagShift) : 0)"
---
> # For implicit stack operations, we should use *not* use the
> # alternative addressing mode for loads/stores if the prefix is set
> if not implicitStack:
> self.memFlags += " | (machInst.legacy.addr ? " + \
> "(AddrSizeFlagBit << FlagShift) : 0)"
398c406,407
< dataSize, addressSize, baseFlags, atCPL0, prefetch, nonSpec):
---
> dataSize, addressSize, baseFlags, atCPL0, prefetch, nonSpec,
> implicitStack):
400c409,410
< dataSize, addressSize, baseFlags, atCPL0, prefetch, nonSpec)
---
> dataSize, addressSize, baseFlags, atCPL0, prefetch, nonSpec,
> implicitStack)
438c448,449
< mem_flags="0", big=True, nonSpec=False):
---
> mem_flags="0", big=True, nonSpec=False,
> implicitStack=False):
462a474,481
> if implicitStack:
> # For instructions that implicitly access the stack, the address
> # size is the same as the stack segment pointer size, not the
> # address size if specified by the instruction prefix
> addressSize = "env.stackSize"
> else:
> addressSize = "env.addressSize"
>
469,470c488,490
< addressSize="env.addressSize",
< atCPL0=False, prefetch=False, nonSpec=nonSpec):
---
> addressSize=addressSize,
> atCPL0=False, prefetch=False, nonSpec=nonSpec,
> implicitStack=implicitStack):
473c493
< atCPL0, prefetch, nonSpec)
---
> atCPL0, prefetch, nonSpec, implicitStack)
480a501,503
> defineMicroLoadOp('Ldis', 'Data = merge(Data, Mem, dataSize);',
> 'Data = Mem & mask(dataSize * 8);',
> implicitStack=True)
547c570,571
< atCPL0=False, prefetch=False, nonSpec=nonSpec):
---
> atCPL0=False, prefetch=False, nonSpec=nonSpec,
> implicitStack=False):
550c574
< atCPL0, prefetch, nonSpec)
---
> atCPL0, prefetch, nonSpec, implicitStack)
577c601,602
< def defineMicroStoreOp(mnemonic, code, completeCode="", mem_flags="0"):
---
> def defineMicroStoreOp(mnemonic, code, completeCode="", mem_flags="0",
> implicitStack=False):
596a622,629
> if implicitStack:
> # For instructions that implicitly access the stack, the address
> # size is the same as the stack segment pointer size, not the
> # address size if specified by the instruction prefix
> addressSize = "env.stackSize"
> else:
> addressSize = "env.addressSize"
>
600,601c633,634
< addressSize="env.addressSize",
< atCPL0=False, nonSpec=False):
---
> addressSize=addressSize,
> atCPL0=False, nonSpec=False, implicitStack=implicitStack):
604c637
< nonSpec)
---
> nonSpec, implicitStack)
610a644,645
> defineMicroStoreOp('Stis', 'Mem = pick(Data, 2, dataSize);',
> implicitStack=True)
658c693
< atCPL0=False, nonSpec=False):
---
> atCPL0=False, nonSpec=False, implicitStack=False):
661c696
< nonSpec)
---
> nonSpec, implicitStack)
697c732
< dataSize, addressSize, "0", False, False, False)
---
> dataSize, addressSize, "0", False, False, False, False)
718c753
< False)
---
> False, False)
730c765
< atCPL0, False, False)
---
> atCPL0, False, False, False)
736d770
<