Commit Graph

11145 Commits

Author SHA1 Message Date
rep-nop
077f39d8da Fixes error on propagating a Result<()> with the ? operator 2017-02-26 07:50:55 -08:00
rep-nop
9f00a40b52 Ran rustfmt 2017-02-26 07:50:55 -08:00
rep-nop
7edbc90d5e Ran rustfmt 2017-02-26 07:50:55 -08:00
rep-nop
af3f4703b9 Fixes formatting for settings.rs 2017-02-26 07:50:55 -08:00
rep-nop
9f8748ee08 Fixes formatting for settings.rs 2017-02-26 07:50:55 -08:00
rep-nop
b23f1fb347 Converts all try! macros to ? syntax.
Fixes #46
2017-02-26 07:50:55 -08:00
rep-nop
7459fee71a Converts all try! macros to ? syntax.
Fixes #46
2017-02-26 07:50:55 -08:00
Jakob Stoklund Olesen
cf5701b137 Add ABI annotations to function signatures.
Specify the location of arguments as well as the size of stack argument
array needed. The ABI annotations are optional, just like the value
locations.

Remove the Eq implementation for Signature which was only used by a
single parser test.
2017-02-24 13:53:46 -08:00
Jakob Stoklund Olesen
c8be39fa9d Add ABI annotations to function signatures.
Specify the location of arguments as well as the size of stack argument
array needed. The ABI annotations are optional, just like the value
locations.

Remove the Eq implementation for Signature which was only used by a
single parser test.
2017-02-24 13:53:46 -08:00
Jakob Stoklund Olesen
cf7a729dc1 Add an ArgumentLoc data type.
This will be used to amend function signatures with ABI lowering
information.
2017-02-24 12:09:24 -08:00
Jakob Stoklund Olesen
15e0822ac3 Add an ArgumentLoc data type.
This will be used to amend function signatures with ABI lowering
information.
2017-02-24 12:09:24 -08:00
Jakob Stoklund Olesen
aa7e349134 Add a section about implementation limits.
Fix a few other minor issues with the documentation.
2017-02-24 11:08:15 -08:00
Jakob Stoklund Olesen
b51cf57e39 Add a section about implementation limits.
Fix a few other minor issues with the documentation.
2017-02-24 11:08:15 -08:00
Jakob Stoklund Olesen
db9e4ea979 Convert try! to ? in extfunc.rs 2017-02-24 10:33:08 -08:00
Jakob Stoklund Olesen
afd42cf9c2 Convert try! to ? in extfunc.rs 2017-02-24 10:33:08 -08:00
Angus Holder
65efefff38 Shortened comment to pass lint. 2017-02-23 09:22:16 -08:00
Angus Holder
bf26fffc92 Shortened comment to pass lint. 2017-02-23 09:22:16 -08:00
Angus Holder
54a53b7ab7 Added tests, some fixes. 2017-02-23 09:22:16 -08:00
Angus Holder
a35d946bc4 Added tests, some fixes. 2017-02-23 09:22:16 -08:00
Angus Holder
a08e177595 Lexer can now scan names, hex sequences, brackets and minus signs. 2017-02-23 09:22:16 -08:00
Angus Holder
0b310017b7 Lexer can now scan names, hex sequences, brackets and minus signs. 2017-02-23 09:22:16 -08:00
Jakob Stoklund Olesen
04bddd73ba Add a 'regalloc' filetest command.
Run functions through the register allocator, and then filecheck.
2017-02-22 11:53:01 -08:00
Jakob Stoklund Olesen
4ba5cfeed3 Add a 'regalloc' filetest command.
Run functions through the register allocator, and then filecheck.
2017-02-22 11:53:01 -08:00
Jakob Stoklund Olesen
247be57042 Also write out register assignments in write_instruction.
The value locations appear after the encodings:

> [R#0c,%x2]              v0 = iadd vx0, vx1
> [Iret#19]               return_reg v0
2017-02-22 11:53:01 -08:00
Jakob Stoklund Olesen
ccda0a192c Also write out register assignments in write_instruction.
The value locations appear after the encodings:

> [R#0c,%x2]              v0 = iadd vx0, vx1
> [Iret#19]               return_reg v0
2017-02-22 11:53:01 -08:00
Jakob Stoklund Olesen
bf9cf09622 Add a register allocation context module.
Collect the data structures that hang around between function
compilations.

Provide a main entry point to the register allocator passes.
2017-02-22 11:53:01 -08:00
Jakob Stoklund Olesen
83571028d9 Add a register allocation context module.
Collect the data structures that hang around between function
compilations.

Provide a main entry point to the register allocator passes.
2017-02-22 11:53:01 -08:00
Jakob Stoklund Olesen
8e421d666d SSA register coloring pass.
This is a bare-bones outline of the SSA coloring pass. Many features are
missing, including:

- Handling instruction operand constraints beyond simple register
  classes.
- Handling ABI requirements for function arguments and return values.
- Generating shuffle code for EBB arguments.
2017-02-22 11:53:01 -08:00
Jakob Stoklund Olesen
329e51ac4f SSA register coloring pass.
This is a bare-bones outline of the SSA coloring pass. Many features are
missing, including:

- Handling instruction operand constraints beyond simple register
  classes.
- Handling ABI requirements for function arguments and return values.
- Generating shuffle code for EBB arguments.
2017-02-22 11:53:01 -08:00
Angus Holder
1e4096b8b8 Removed unnecessary documentation. 2017-02-22 10:22:08 -08:00
Angus Holder
2ec7412a81 Removed unnecessary documentation. 2017-02-22 10:22:08 -08:00
Angus Holder
b2a3b34022 Add assertion that the NonZero optimization works on Option<Opcode>. 2017-02-22 10:22:08 -08:00
Angus Holder
81a6e343ad Add assertion that the NonZero optimization works on Option<Opcode>. 2017-02-22 10:22:08 -08:00
Angus Holder
41ca00df8d Fix test case that I missed before. 2017-02-22 10:22:08 -08:00
Angus Holder
75a426a812 Fix test case that I missed before. 2017-02-22 10:22:08 -08:00
Angus Holder
e002011602 Removed the Opcode::NotAnOpcode variant, replaced its uses with Option<Opcode>, and used the NonZero optimization to maintain the small 1-byte size of an optional Opcode. 2017-02-22 10:22:08 -08:00
Angus Holder
a4e4776087 Removed the Opcode::NotAnOpcode variant, replaced its uses with Option<Opcode>, and used the NonZero optimization to maintain the small 1-byte size of an optional Opcode. 2017-02-22 10:22:08 -08:00
Angus Holder
855c429d31 Documentation fix for what appears to be a minor copy-paste mistake. 2017-02-22 09:33:17 -08:00
Angus Holder
3d0240d244 Documentation fix for what appears to be a minor copy-paste mistake. 2017-02-22 09:33:17 -08:00
Jakob Stoklund Olesen
377550b835 Add return_reg encodings for RISC-V. 2017-02-21 16:29:23 -08:00
Jakob Stoklund Olesen
62334b26b4 Add return_reg encodings for RISC-V. 2017-02-21 16:29:23 -08:00
Jakob Stoklund Olesen
608d452f0c Compute the controlling type variable accurately.
Some polymorphic instructions don't return the controlling type
variable, so it has to be computed from the designated operand instead.

- Add a requires_typevar_operand() method to the operand constraints
  which indicates that.
- Add a ctrl_typevar(dfg) method to InstructionData which computes the
  controlling type variable correctly, and returns VOID for monomorphic
  instructions.
- Use ctrl_typevar(dfg) to drive the level-1 encoding table lookups.
2017-02-21 16:26:19 -08:00
Jakob Stoklund Olesen
a7d24ab1dc Compute the controlling type variable accurately.
Some polymorphic instructions don't return the controlling type
variable, so it has to be computed from the designated operand instead.

- Add a requires_typevar_operand() method to the operand constraints
  which indicates that.
- Add a ctrl_typevar(dfg) method to InstructionData which computes the
  controlling type variable correctly, and returns VOID for monomorphic
  instructions.
- Use ctrl_typevar(dfg) to drive the level-1 encoding table lookups.
2017-02-21 16:26:19 -08:00
Jakob Stoklund Olesen
b6fa40d6a3 Add a return_reg instruction to the base instruction set.
Register-style return is used by all RISC architectures, so it is
natural to have a shared instruction representation.
2017-02-21 13:05:17 -08:00
Jakob Stoklund Olesen
20ff2f0025 Add a return_reg instruction to the base instruction set.
Register-style return is used by all RISC architectures, so it is
natural to have a shared instruction representation.
2017-02-21 13:05:17 -08:00
Jakob Stoklund Olesen
22bc33fa05 Create live ranges for dead defs.
When the liveness pass implements dead code elimination, missing live
ranges can be used to indicate unused values that it may be possible to
remove. But even then, we may have to keep dead defs around if the
instruction has side effects or other live defs.
2017-02-21 12:24:39 -08:00
Jakob Stoklund Olesen
74eb13c17a Create live ranges for dead defs.
When the liveness pass implements dead code elimination, missing live
ranges can be used to indicate unused values that it may be possible to
remove. But even then, we may have to keep dead defs around if the
instruction has side effects or other live defs.
2017-02-21 12:24:39 -08:00
Jakob Stoklund Olesen
a20afbefe0 Improve assertion text for missing live ranges. 2017-02-21 12:24:37 -08:00
Jakob Stoklund Olesen
706720eba9 Improve assertion text for missing live ranges. 2017-02-21 12:24:37 -08:00
Jakob Stoklund Olesen
85fa68023c Make the DominatorTree reusable.
Add a compute() method which can recompute a dominator tree for
different functions.

Add a dominator tree data to the cretonne::Context.
2017-02-17 13:09:41 -08:00