Use this source map method for assigning a location to any entity whose
source number is not exposed. This could be
- Instructions.
- Signatures defined implicitly by function decls.
These entities only appear in the location map, not the entity number
maps.
Give these crates each a more standard directory layout with sources in
a 'src' sub-sirectory and Cargo.toml in the top lib/foo directory.
Add license and description fields to each.
The build script for the cretonne crate now lives in
'lib/cretonne/build.rs' separating it from the normal library sources
under 'lib/cretonne/src'.
The 'lib/cretonne' directory will be the new root of a stand-alone
cretonne crate containg both Python and Rust sources.
This is in preparation for publishing crates on crates.io.
The Builder keeps track of a position in the layout and inserts new
instructions there.
Add insert_ebb() and ebb() methods to Builder.
Use Builder in the cfg tests.
The Builder provides a convenient interface for inserting instructions
into an extended basic block.
The bulk of the builder methods are generated automatically from the
meta language instruction descriptions.
Still TODO: Keep track of an insertion position.
In instruction formats that have multiple results AND boxed storage,
place the second_result field outside the boxed storage. The 16-byte
instruction format has room for opcode, type, second_result in the first
8 bytes, and the boxed pointer in the last 8 bytes.
This provides a simpler implementation of the second_result() and
second_result_mut() InstructionData methods.
The Rust type is usually the camel-cased name of the operand kind, but
there are variations, so allow an explicit rust_type='IntCC' when
defining operand kinds.
These refer to external functions and function signatures declared in
the preamble. Since we're already using the type names 'Signature' and
'Function', these entity references don't folow the usual EntityData /
Entity naming convention.
Entity references in instruction format operands also have member names
in the InstructionData struct. Track them the same way we track immediate operand member names.
Value operands still go in the arg / args members.
Enable syntax: iadd(x, y) which creates an Apply node.
Enable syntax: z << iadd(x, y) which creates a Def node.
Add an XForm class which represents source and destination patterns as
RTL lists.
The isplit_lohi instruction breaks an integer into two halves. This will
typically be used to get the two halves of an `i64` value on 32-bit
CPUs.
The iconcat_lohi is the reverse operation. It reconstructs the `i64`
from the low and high bits.
All instructions with associated encodings are now annotated with
encoding information in a column before the code.
When write_function() is givan a TargetIsa reference, the annotations use
ISA-specific names. Otherwise everything is numeric.
The # is a more conventional prefix for hexadecimal, and when ISA
information is not available, there may be a decimal number in front
which would be confusing.
So prefer [1#10c] for the ISA-less encoding format. Here '1' is decimal
and '#10c' is hexadecimal.
Add a `needs_isa()` method to the SubTest trait, and pass a TargetIsa
trait object to those sub-tests that request it.
When multiple sub-tests and ISAs are specified, test the cross product.
If a sub-test requires an ISA, but none are specified, fail the test. In
the future, it may be a good idea to generate a default set of ISAs and
test against those.
Some tests are only applicable to specific ISAs. This can be indicated
with an ISA specification:
test legalizer
isa riscv
function foo() {
....
}
The ISA specifications have the same format as the test lines: The name
of the ISA following by optional settings until the end of the line.
Also parse `set` commands mixed in with the `isa` commands. These are
used to set ISA-independent settings as defined in
meta/cretonne/settings.py.
When constructing the Flags object from the Builder, don't consume it,
but take a reference instead.
This makes it possible for the parser to accept multiple 'set' lines and
apply them to different ISA specifications.