Skip to content

Phil/compilation simple #24

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

Merged
merged 11 commits into from
May 17, 2020
Merged

Phil/compilation simple #24

merged 11 commits into from
May 17, 2020

Conversation

philberty
Copy link
Member

This adds in initial support for type checking:

started name resolution
test1.rs:21:15: error: E0308: expected: i32, found bool
   21 |     mutable = true;
      |               ^
finished name resolution

@philberty philberty added the WIP label May 17, 2020
@philberty philberty requested a review from NalaGinrut May 17, 2020 16:58
@philberty philberty self-assigned this May 17, 2020
This was linked to issues May 17, 2020
@philberty philberty merged commit 6c1c417 into master May 17, 2020
dkm pushed a commit that referenced this pull request Mar 10, 2025
The code in gcc.target/unsigned-extend-1.c really should not need an
unsigned extension operations when the optimizers are used.  For Arm
and thumb2 that is indeed the case, but for thumb1 code it gets more
complicated as there are too many instructions for combine to look at.
For thumb1 we end up with two redundant zero_extend patterns which are
not removed: the first after the subtract instruction and the second of
the final boolean result.

We can partially fix this (for the second case above) by adding a new
split pattern for LEU and GEU patterns which work because the two
instructions for the [LG]EU pattern plus the redundant extension
instruction are combined into a single insn, which we can then split
using the 3->2 method back into the two insns of the [LG]EU sequence.

Because we're missing the optimization for all thumb1 cases (not just
those architectures with UXTB), I've adjust the testcase to detect all
the idioms that we might use for zero-extending a value, namely:

       UXTB
       AND ...#255 (in thumb1 this would require a register to hold 255)
       LSL ... #24; LSR ... #24

but I've also marked this test as XFAIL for thumb1 because we can't yet
eliminate the first of the two extend instructions.

gcc/
	* config/arm/thumb1.md (split patterns for GEU and LEU): New.

gcc/testsuite:
	* gcc.target/arm/unsigned-extend-1.c: Expand check for any
	insn suggesting a zero-extend.  XFAIL for thumb1 code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Name resolution The IR design, type checking, and pre-optimizing
1 participant