Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DPWBS-1232] feat(RegisterInfo): add new pseudo CarryReg regclass, St…
…atusRegBank regbank To properly model the carry-bit register of overflow ops we need to have a proper register bank and class. This commit adds the unallocatable pseudo register class CarryReg, and the register bank StatusRegBank. Furthermore, this commit marks the PSW_C register as reserved. This is required since it is a system register and because the super register PSW is also reserved. StatusRegBank is only used by carry arithmetics. For TriCore this mean only add/sub with carry (G_UADDO/UADDE/USUBO/USUBE). The mapping is only supported for 32-bit non-carry and 1-bit carry operands. The non-carry operands are mapped to the DataRegBank while the carry operands are mapped to the StatusRegBank. During instruction selection, carry-bit operands are constrained to the CarryReg class Since PSW_C is marked as a reserved register, a StatusRegBank COPY with it as an operand cannot be emitted, as the register allocator would not have a non-reserved register to allocate. Therefore the virtual carry-out registers must be replaced with $psw_c directly. To do this, this commit adds a check during the selection of carry-out producers if it is safe to replace the virtual carry-out register with the physical $psw_c register. Only if this check succeeds is selection performed and the virtual register replaced with the physical one. update tests for add/sub with carry.
- Loading branch information
1 parent
ebcee19
commit 5a4494a
Showing
13 changed files
with
665 additions
and
138 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.