Move formats, entities, and immediates to the base package.

- base.formats defines instruction formats.
- base.entities defines kinds of entity references.
- base.immediates defines kinds of imediate operands.
This commit is contained in:
Jakob Stoklund Olesen
2016-11-08 11:02:07 -08:00
parent bb28dc6686
commit 6eaa8eb382
7 changed files with 8 additions and 7 deletions

View File

@@ -137,7 +137,7 @@ indicated with an instance of :class:`ImmediateKind`.
.. autoclass:: ImmediateKind .. autoclass:: ImmediateKind
.. automodule:: cretonne.immediates .. automodule:: base.immediates
:members: :members:
Entity references Entity references
@@ -149,7 +149,7 @@ can be extended basic blocks, or entities declared in the function preamble.
.. currentmodule:: cdsl.operands .. currentmodule:: cdsl.operands
.. autoclass:: EntityRefKind .. autoclass:: EntityRefKind
.. automodule:: cretonne.entities .. automodule:: base.entities
:members: :members:
Value types Value types

View File

@@ -7,7 +7,7 @@ in this module.
""" """
from __future__ import absolute_import from __future__ import absolute_import
from cdsl.operands import VALUE, VARIABLE_ARGS from cdsl.operands import VALUE, VARIABLE_ARGS
from . import InstructionFormat from cretonne import InstructionFormat
from .immediates import imm64, uimm8, ieee32, ieee64, immvector, intcc, floatcc from .immediates import imm64, uimm8, ieee32, ieee64, immvector, intcc, floatcc
from .entities import ebb, sig_ref, func_ref, jump_table from .entities import ebb, sig_ref, func_ref, jump_table

View File

@@ -732,4 +732,4 @@ class Encoding(object):
# Import the fixed instruction formats now so they can be added to the # Import the fixed instruction formats now so they can be added to the
# registry. # registry.
importlib.import_module('cretonne.formats') importlib.import_module('base.formats')

View File

@@ -9,8 +9,9 @@ from cdsl.operands import VARIABLE_ARGS
from . import Operand, Instruction, InstructionGroup from . import Operand, Instruction, InstructionGroup
from .typevar import TypeVar from .typevar import TypeVar
from base.types import i8, f32, f64, b1 from base.types import i8, f32, f64, b1
from .immediates import imm64, uimm8, ieee32, ieee64, immvector, intcc, floatcc from base.immediates import imm64, uimm8, ieee32, ieee64, immvector
from . import entities from base.immediates import intcc, floatcc
from base import entities
instructions = InstructionGroup("base", "Shared base instruction set") instructions = InstructionGroup("base", "Shared base instruction set")

View File

@@ -10,8 +10,8 @@ instruction formats described in the reference:
""" """
from __future__ import absolute_import from __future__ import absolute_import
from cretonne import EncRecipe from cretonne import EncRecipe
from cretonne.formats import Binary, BinaryImm
from cdsl.predicates import IsSignedInt from cdsl.predicates import IsSignedInt
from base.formats import Binary, BinaryImm
# The low 7 bits of a RISC-V instruction is the base opcode. All 32-bit # The low 7 bits of a RISC-V instruction is the base opcode. All 32-bit
# instructions have 11 as the two low bits, with bits 6:2 determining the base # instructions have 11 as the two low bits, with bits 6:2 determining the base