Skip to content
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

Remove IFLAGS/FFLAGS types #5406

Merged
merged 1 commit into from
Dec 9, 2022
Merged

Conversation

uweigand
Copy link
Member

@uweigand uweigand commented Dec 9, 2022

All instructions using the CPU flags types (IFLAGS/FFLAGS) were already removed. This patch completes the cleanup by removing all remaining instructions that define values of CPU flags types, as well as the types themselves.

Specifically, the following features are removed:

  • The IFLAGS and FFLAGS types and the SpecialType category.
  • Special handling of IFLAGS and FFLAGS in machinst/isle.rs and machinst/lower.rs.
  • The ifcmp, ifcmp_imm, ffcmp, iadd_ifcin, iadd_ifcout, iadd_ifcarry, isub_ifbin, isub_ifbout, and isub_ifborrow instructions.
  • The writes_cpu_flags instruction property.
  • The flags verifier pass.
  • Flags handling in the interpreter.

All of these features are currently unused; no functional change intended by this patch.

This addresses #3249.

CC @cfallin @elliottt @jameysharp

@@ -1508,39 +1507,4 @@ mod tests {
assert_eq!(dfg.value_is_attached(arg3), false);
assert_eq!(dfg.block_params(block), &[]);
}

#[test]
fn aliases() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than removing this test, could you change it to avoid iflags?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I see I misinterpreted the purpose of the test. Now changed to use iadd_cout / icmp instead of iadd_ifcout / ifcmp instead.

; check: v20, v21 = iadd_ifcarry v2, v5, v11
v30 = iadd_ifcin v3, v6, v21
; check: v30 = iadd_ifcin v3, v6, v21
return v10, v20, v30
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe test parsing select instead? That is also a ternary instruction.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to iadd_cout and friends as well. Also added a select test for completeness.

Copy link
Member

@cfallin cfallin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a bunch for doing this work! It looks pretty straightforwardly correct -- just a bunch of special cases going away, which is always great to see.

Happy to merge once @bjorn3's suggestions are done!

@uweigand uweigand force-pushed the no-iflags branch 2 times, most recently from c79acc7 to 36ae7b0 Compare December 9, 2022 18:30
@cfallin
Copy link
Member

cfallin commented Dec 9, 2022

CI breakage looks to be because of an Ubuntu upgrade; created #5407, and we'll want to rebase this on that if it works and merges.

@github-actions github-actions bot added cranelift Issues related to the Cranelift code generator cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:x64 Issues related to x64 codegen cranelift:meta Everything related to the meta-language. labels Dec 9, 2022
All instructions using the CPU flags types (IFLAGS/FFLAGS) were already
removed.  This patch completes the cleanup by removing all remaining
instructions that define values of CPU flags types, as well as the
types themselves.

Specifically, the following features are removed:
- The IFLAGS and FFLAGS types and the SpecialType category.
- Special handling of IFLAGS and FFLAGS in machinst/isle.rs and
  machinst/lower.rs.
- The ifcmp, ifcmp_imm, ffcmp, iadd_ifcin, iadd_ifcout, iadd_ifcarry,
  isub_ifbin, isub_ifbout, and isub_ifborrow instructions.
- The writes_cpu_flags instruction property.
- The flags verifier pass.
- Flags handling in the interpreter.

All of these features are currently unused; no functional change
intended by this patch.

This addresses bytecodealliance#3249.
@uweigand
Copy link
Member Author

uweigand commented Dec 9, 2022

CI breakage looks to be because of an Ubuntu upgrade; created #5407, and we'll want to rebase this on that if it works and merges.

Thanks! Tests are passing now.

@cfallin cfallin merged commit e913cf3 into bytecodealliance:main Dec 9, 2022
@uweigand uweigand deleted the no-iflags branch December 9, 2022 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cranelift:area:aarch64 Issues related to AArch64 backend. cranelift:area:machinst Issues related to instruction selection and the new MachInst backend. cranelift:area:x64 Issues related to x64 codegen cranelift:meta Everything related to the meta-language. cranelift Issues related to the Cranelift code generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants