-
Notifications
You must be signed in to change notification settings - Fork 157
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
Asm generic il codegen #3060
Merged
Merged
Asm generic il codegen #3060
Conversation
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
badumbatish
force-pushed
the
asm_generic_il
branch
from
July 1, 2024 00:08
42e6f7e
to
2855b64
Compare
badumbatish
force-pushed
the
asm_generic_il
branch
from
July 8, 2024 05:06
3096a7d
to
cff9299
Compare
hi @CohenArthur , i'd love to get some reviews :) |
CohenArthur
reviewed
Jul 17, 2024
badumbatish
force-pushed
the
asm_generic_il
branch
from
July 18, 2024 15:09
1e619a5
to
c89d979
Compare
badumbatish
force-pushed
the
asm_generic_il
branch
from
July 26, 2024 06:19
2927798
to
0b086ed
Compare
badumbatish
force-pushed
the
asm_generic_il
branch
2 times, most recently
from
July 30, 2024 05:08
eb10f51
to
1e26148
Compare
badumbatish
force-pushed
the
asm_generic_il
branch
3 times, most recently
from
August 2, 2024 19:36
9b4af8f
to
a8c24ef
Compare
badumbatish
force-pushed
the
asm_generic_il
branch
from
August 13, 2024 18:47
a8c24ef
to
af06c6e
Compare
This was referenced Aug 22, 2024
badumbatish
force-pushed
the
asm_generic_il
branch
from
August 28, 2024 04:05
6414349
to
b7de3c1
Compare
the tests passed for me locally but i'm not sure why it's behaving weird on CI
|
CohenArthur
reviewed
Aug 28, 2024
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.
this is really, really, really good. well done, amazing work @badumbatish
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Fix parsing logic & reassignment logic (parse_reg_operand_in): Fix parsing (parse_reg_operand_out): Fix parsing (parse_reg_operand_inout): Fix parsing (parse_reg_operand_unexpected): Remove rust_unreachable() (parse_asm_arg): Fix parsing logic
gcc/rust/ChangeLog: * backend/rust-compile-block.h: Scaffolding asm codegen * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise. * backend/rust-compile-expr.h: Likewise. * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Likewise. * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Likewise. * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Likewise. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise. * checks/errors/privacy/rust-privacy-reporter.h: Likewise. * hir/tree/rust-hir-expr.h: Likewise. * hir/tree/rust-hir-visitor.h: Likewise. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise. * typecheck/rust-hir-type-check-expr.h: Likewise.
gcc/rust/ChangeLog: * hir/tree/rust-hir.cc (InlineAsm::accept_vis): Make sure CompileExpr::visit is reached * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise gcc/testsuite/ChangeLog: * rust/compile/inline_asm_compile_nop.rs: New test.
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Local testing for build_string and debug()
gcc/rust/ChangeLog: * backend/rust-compile-expr.cc (CompileExpr::visit): Setting up interfaces for codegen * hir/tree/rust-hir-expr.h: Likewise.
gcc/rust/ChangeLog: * Make-lang.in: Scaffolding new compile-asm files * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise * hir/tree/rust-hir-expr.h: Likewise * backend/rust-compile-asm.cc: New file. Likewise * backend/rust-compile-asm.h: New file. Likewise
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::add_stmt): Scaffolding code. (CompileAsm::asm_build_asm_stmt): Likewise. (CompileAsm::asm_build_expr): Likewise. (CompileAsm::asm_construct_string_tree): Likewise. * backend/rust-compile-asm.h: Likewise. * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::add_stmt): Deleted (CompileAsm::CompileAsm): Successfully produce pseudo-nop (CompileAsm::visit): Likewise (CompileAsm::asm_build_asm_stmt): Likewise (CompileAsm::asm_construct_string_tree): Likewise (CompileAsm::asm_is_inline): Likewise * backend/rust-compile-asm.h (class CompileAsm): Likewise * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (strip_double_quotes): Refactor compile-asm for first round review (CompileAsm::asm_build_asm_stmt): Likewise. (CompileAsm::asm_build_expr): Likewise. (CompileAsm::asm_get_locus): Likewise. (CompileAsm::asm_construct_string_tree): Likewise. (CompileAsm::asm_construct_outputs): Likewise. (CompileAsm::asm_construct_inputs): Likewise. (CompileAsm::asm_construct_clobber_tree): Likewise. (CompileAsm::asm_construct_label_tree): Likewise. (CompileAsm::asm_is_simple): Likewise. (CompileAsm::asm_is_inline): Likewise. * backend/rust-compile-asm.h (strip_double_quotes): Likewise. (class CompileAsm): Likewise.
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr): Use expr's is_simple_asm and is_inline_asm (CompileAsm::asm_is_simple): removed (CompileAsm::asm_is_inline): removed * backend/rust-compile-asm.h: Add docs to ASM_TREE_ARRAY_LENGTH * hir/tree/rust-hir-expr.h: Add is_simple_asm, is_inline_asm and remove #include tree
gcc/testsuite/ChangeLog: * rust/compile/inline_asm_parse_output_operand.rs: New test.
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_construct_outputs): Set up counting to check
gcc/rust/ChangeLog: * expand/rust-macro-builtins-asm.cc (parse_reg_operand): Remove warnings (parse_reg_operand_out): Remove warnings (expand_inline_asm): New function for eventual expansion (parse_asm): Use expand_inline_asm gcc/testsuite/ChangeLog: * rust/execute/torture/inline_asm_mov_x_5.rs: New test.
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (strip_double_quotes): Move strip double quotes to parse phase (CompileAsm::asm_construct_string_tree): Likewise * backend/rust-compile-asm.h (strip_double_quotes): Likewise * expand/rust-macro-builtins-asm.cc (strip_double_quotes): Likewise (expand_inline_asm): Renamed to expand_inline_asm_strings (expand_inline_asm_strings): Renamed from expand_inline_asm (parse_asm): Move strip double quotes to parse phase (parse_format_strings): Likewise * expand/rust-macro-builtins-asm.h (strip_double_quotes): Likewise (expand_inline_asm_strings): Inline asm expansion fn (expand_inline_asm_string): Inline asm expansion fn
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_construct_outputs): Lower the HIR to tree with CompileExpr * backend/rust-compile-asm.h: Remove static from method
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Perform type check on InlineAsm's operand (typecheck_inline_asm_operand): Likewise
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr): Add debug comment (CompileAsm::asm_construct_outputs): Perform lowering hir output operand to tree
gcc/rust/ChangeLog: * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Added noreturn checking for nevertype gcc/testsuite/ChangeLog: * rust/compile/inline_asm_typecheck.rs: New test.
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr): Use's array type when constring string tree (CompileAsm::asm_construct_string_tree): Use's array type when constring string tree
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::asm_build_expr): Remove debug * expand/rust-macro-builtins-asm.cc (expand_inline_asm_strings): properly formatted via rust instead of c (parse_asm): formatted comment (parse_format_strings): formatted comment * hir/tree/rust-hir-expr.h: fix is_simple_asm() gcc/testsuite/ChangeLog: * rust/compile/inline_asm_parse_operand.rs: Fix format asm * rust/compile/inline_asm_parse_output_operand.rs: Fix format asm * rust/execute/torture/inline_asm_mov_x_5.rs: Move to... * rust/execute/inline_asm_mov_x_5.rs: ...here.
gcc/testsuite/ChangeLog: * rust/execute/inline_asm_mov_x_5.rs: Move to... * rust/execute/torture/inline_asm_mov_x_5.rs: ...here.
badumbatish
force-pushed
the
asm_generic_il
branch
from
August 29, 2024 17:14
b5fcb2d
to
7edb63a
Compare
gcc/rust/ChangeLog: * backend/rust-compile-asm.cc (CompileAsm::visit): Change API, public/private, comments, formatting from code review (CompileAsm::asm_build_expr): Likewise. (CompileAsm::tree_codegen_asm): Likewise. * backend/rust-compile-asm.h (class CompileAsm): Likewise. * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise. * expand/rust-macro-builtins-asm.cc (strip_double_quotes): Likewise. (parse_options): Likewise. (parse_asm_arg): Likewise. (expand_inline_asm_strings): Likewise. (parse_asm): Likewise. * expand/rust-macro-builtins-asm.h (strip_double_quotes): Likewise. (expand_inline_asm_strings): Likewise. (expand_inline_asm_string): Likewise. * hir/tree/rust-hir-expr.h: Likewise. gcc/testsuite/ChangeLog: * rust/compile/inline_asm_typecheck.rs: Change comments
gcc/testsuite/ChangeLog: * rust/execute/torture/inline_asm_mov_x_5.rs: Move to... * rust/execute/torture/inline_asm_mov_x_5_ARM.rs: ...here. * rust/execute/torture/inline_asm_mov_x_5_x86_64.rs: New test.
badumbatish
force-pushed
the
asm_generic_il
branch
from
September 2, 2024 09:07
361a2dc
to
56eabe0
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Draft PR for IL for my mentor.
I hope to get this merged into master after other misc like tl::expected and safeguard on asm has been merged first. Feels like i'll spend more time debugging without all the safety structure set up by other PRs
Fixes #3061