Add tests and documentation for x86_(push|pop). Fix up encoding issues revealed by tests.

This commit is contained in:
Tyler McMullen
2017-12-01 19:15:31 -08:00
committed by Jakob Stoklund Olesen
parent 3b1b33e0ac
commit 1a11c351b5
4 changed files with 38 additions and 5 deletions

View File

@@ -103,11 +103,26 @@ fmax = Instruction(
x = Operand('x', iWord)
push = Instruction(
'x86_push', "Pushes onto the stack.",
'x86_push', r"""
Pushes a value onto the stack.
Decrements the stack pointer and stores the specified value on to the top.
This is polymorphic in i32 and i64. However, it is only implemented for i64
in 64-bit mode, and only for i32 in 32-bit mode.
""",
ins=x, can_store=True, other_side_effects=True)
pop = Instruction(
'x86_pop', "Pops from the stack.",
'x86_pop', r"""
Pops a value from the stack.
Loads a value from the top of the stack and then increments the stack
pointer.
This is polymorphic in i32 and i64. However, it is only implemented for i64
in 64-bit mode, and only for i32 in 32-bit mode.
""",
outs=x, can_load=True, other_side_effects=True)
GROUP.close()