Add Intel iconst.i32 encoding.
This commit is contained in:
@@ -22,6 +22,9 @@ for inst, rrr in [
|
||||
I32.enc(inst, *r.rib(0x83, rrr=rrr))
|
||||
I32.enc(inst, *r.rid(0x81, rrr=rrr))
|
||||
|
||||
# Immediate constant.
|
||||
I32.enc(base.iconst.i32, *r.uid(0xb8))
|
||||
|
||||
# 32-bit shifts and rotates.
|
||||
# Note that the dynamic shift amount is only masked by 5 or 6 bits; the 8-bit
|
||||
# and 16-bit shifts would need explicit masking.
|
||||
|
||||
@@ -4,7 +4,7 @@ Intel Encoding recipes.
|
||||
from __future__ import absolute_import
|
||||
from cdsl.isa import EncRecipe
|
||||
from cdsl.predicates import IsSignedInt, IsEqual
|
||||
from base.formats import Binary, BinaryImm, Store, Load
|
||||
from base.formats import UnaryImm, Binary, BinaryImm, Store, Load
|
||||
from .registers import GPR, ABCD
|
||||
|
||||
try:
|
||||
@@ -155,6 +155,11 @@ rid = TailRecipe(
|
||||
'rid', BinaryImm, size=5, ins=GPR, outs=0,
|
||||
instp=IsSignedInt(BinaryImm.imm, 32))
|
||||
|
||||
# XX+rd id unary with 32-bit immediate.
|
||||
uid = TailRecipe(
|
||||
'uid', UnaryImm, size=4, ins=(), outs=GPR,
|
||||
instp=IsSignedInt(UnaryImm.imm, 32))
|
||||
|
||||
#
|
||||
# Store recipes.
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user