Add docs and tests for copy_special instruction. Fixes encoding issue that tests revealed.
This commit is contained in:
committed by
Jakob Stoklund Olesen
parent
4eb9a54096
commit
3b1b33e0ac
@@ -539,7 +539,12 @@ regmove = Instruction(
|
||||
|
||||
copy_special = Instruction(
|
||||
'copy_special', r"""
|
||||
Copies a value from one special register to another. e.g. rbp -> rsp.
|
||||
Copies the contents of ''src'' register to ''dst'' register.
|
||||
|
||||
This instructions copies the contents of one register to another
|
||||
register without involving any SSA values. This is used for copying
|
||||
special registers, e.g. copying the stack register to the frame
|
||||
register in a function prologue.
|
||||
""",
|
||||
ins=(src, dst),
|
||||
other_side_effects=True)
|
||||
|
||||
@@ -232,7 +232,7 @@ enc_i32_i64(x86.push, r.pushq, 0x50)
|
||||
enc_i32_i64(x86.pop, r.popq, 0x58)
|
||||
|
||||
# Copy Special
|
||||
enc_i64(base.copy_special, r.copysp, 0x89, w=1)
|
||||
I64.enc(base.copy_special, *r.copysp.rex(0x89, w=1))
|
||||
I32.enc(base.copy_special, *r.copysp(0x89))
|
||||
|
||||
# Adjust SP Imm
|
||||
|
||||
Reference in New Issue
Block a user