-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x64: Begin migrating branch instructions to ISLE #4587
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
aeb51b5
Lower the jump instruction in isle
elliottt ac87ef9
Migrate brif, and some cases of brz and brnz
elliottt a584098
Migrate br_icond
elliottt d4e8238
Format
elliottt 97c84b8
Add docs for single_target and two_targets
elliottt 9a7e53c
Format
elliottt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -515,6 +515,16 @@ | |
|
||
(type BoxVecMachLabel extern (enum)) | ||
|
||
(type MachLabelSlice extern (enum)) | ||
|
||
;; Extract a the target from a MachLabelSlice with exactly one target. | ||
(decl single_target (MachLabel) MachLabelSlice) | ||
(extern extractor single_target single_target) | ||
|
||
;; Extract a the targets from a MachLabelSlice with exactly two targets. | ||
(decl two_targets (MachLabel MachLabel) MachLabelSlice) | ||
(extern extractor two_targets two_targets) | ||
Comment on lines
+525
to
+526
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar doc comment here please. |
||
|
||
;; Get the `OperandSize` for a given `Type`, rounding smaller types up to 32 bits. | ||
(decl operand_size_of_type_32_64 (Type) OperandSize) | ||
(extern constructor operand_size_of_type_32_64 operand_size_of_type_32_64) | ||
|
@@ -1057,9 +1067,13 @@ | |
NLE | ||
P | ||
NP)) | ||
|
||
(decl intcc_to_cc (IntCC) CC) | ||
(extern constructor intcc_to_cc intcc_to_cc) | ||
|
||
(decl cc_invert (CC) CC) | ||
(extern constructor cc_invert cc_invert) | ||
|
||
(type AvxOpcode extern | ||
(enum Vfmadd213ps | ||
Vfmadd213pd)) | ||
|
@@ -3039,13 +3053,34 @@ | |
(rule (trap_if_fcmp (FcmpCondResult.OrCondition producer cc1 cc2) tc) | ||
(with_flags_side_effect producer (trap_if_or cc1 cc2 tc))) | ||
|
||
;;;; Jumps ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
;; Unconditional jump. | ||
(decl jmp_known (MachLabel) SideEffectNoResult) | ||
(rule (jmp_known target) | ||
(SideEffectNoResult.Inst (MInst.JmpKnown target))) | ||
|
||
;; Conditional jump based on the condition code. | ||
(decl jmp_cond (CC MachLabel MachLabel) ConsumesFlags) | ||
(rule (jmp_cond cc taken not_taken) | ||
(ConsumesFlags.ConsumesFlagsSideEffect (MInst.JmpCond cc taken not_taken))) | ||
|
||
;; Conditional jump based on the result of an icmp. | ||
(decl jmp_cond_icmp (IcmpCondResult MachLabel MachLabel) SideEffectNoResult) | ||
(rule (jmp_cond_icmp (IcmpCondResult.Condition producer cc) taken not_taken) | ||
(with_flags_side_effect producer (jmp_cond cc taken not_taken))) | ||
|
||
;;;; Comparisons ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | ||
|
||
(type IcmpCondResult (enum (Condition (producer ProducesFlags) (cc CC)))) | ||
|
||
(decl icmp_cond_result (ProducesFlags CC) IcmpCondResult) | ||
(rule (icmp_cond_result producer cc) (IcmpCondResult.Condition producer cc)) | ||
|
||
(decl invert_icmp_cond_result (IcmpCondResult) IcmpCondResult) | ||
(rule (invert_icmp_cond_result (IcmpCondResult.Condition producer cc)) | ||
(icmp_cond_result producer (cc_invert cc))) | ||
|
||
;; Lower an Icmp result into a boolean value in a register. | ||
(decl lower_icmp_bool (IcmpCondResult) ValueRegs) | ||
(rule (lower_icmp_bool (IcmpCondResult.Condition producer cc)) | ||
|
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a little doc comment for this? Something like
;; Match a label slice of length one, extracting the only label in the slice.