When an instruction doesn't have a valid encoding for the target ISA, it needs to be legalized. Different legalization strategies can be expressed as separate XFormGroup objects. Make the choice of XFormGroup configurable per CPU mode, rather than depending on a hard-coded default. Add a CPUMode.legalize_type() method which assigns an XFormGroup to controlling type variables and lets you set a default. Add a `legalize` field to Level1Entry so the first-level hash table lookup gives us the configured default legalization action for the instruction's controlling type variable.
16 lines
319 B
Python
16 lines
319 B
Python
"""
|
|
ARM64 definitions.
|
|
|
|
Commonly used definitions.
|
|
"""
|
|
from __future__ import absolute_import
|
|
from cdsl.isa import TargetISA, CPUMode
|
|
import base.instructions
|
|
from base.legalize import narrow
|
|
|
|
ISA = TargetISA('arm64', [base.instructions.GROUP])
|
|
A64 = CPUMode('A64', ISA)
|
|
|
|
# TODO: Refine these
|
|
A64.legalize_type(narrow)
|