Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

[RyuJIT/ARM32] Select proper temp register when resolving edges - #12185

Merged
CarolEidt merged 3 commits into
dotnet:masterfrom
hqueue:arm/ryujit/lsra_11851_resolve_edges
Jun 16, 2017
Merged

CarolEidt merged 3 commits into
dotnet:masterfrom
hqueue:arm/ryujit/lsra_11851_resolve_edges

Conversation

@hqueue

@hqueue hqueue commented Jun 9, 2017

Copy link
Copy Markdown
Member

Fix #11851

For ARM32, we need double temporary register in addition to integer
and float temporary register when resolving edges between basic blocks.

@hqueue
hqueue force-pushed the arm/ryujit/lsra_11851_resolve_edges branch from 463ce19 to 25e18c3 Compare June 9, 2017 04:17
For ARM32, we need double temporary register in addition to integer
and float temporary register when resolving edges between basic blocks.

Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
@BruceForstall

Copy link
Copy Markdown

@dotnet/arm32-contrib

@BruceForstall
BruceForstall requested a review from CarolEidt June 13, 2017 17:24
Comment thread src/jit/lsra.cpp Outdated
#endif // !_TARGET_XARCH_
regNumber tempRegFlt = REG_NA;
#ifdef _TARGET_ARM_
// ARM32 requires double temp register in addition to interger and float temp registers.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Typo "Interger" => "integer"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thanks !

Comment thread src/jit/lsra.cpp Outdated

#ifdef _TARGET_ARM_
// ARM32 requires double temp register in addition to interger and float temp registers.
tempRegDbl = getTempRegForResolution(fromBlock, toBlock, TYP_DOUBLE);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The resolution uses only one register at a time, so it would be better to reserve only a TYP_DOUBLE register on arm, and then its lower half can be used when resolving a TYP_FLOAT.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The resolution uses only one register at a time, so it would be better to reserve only a TYP_DOUBLE register on arm, and then its lower half can be used when resolving a TYP_FLOAT.

When considering code structure, I also think the suggested approach is better.
However I'm afraid it may affect code quality sometimes when we need TYP_FLOAT temp but there there is a free TYP_FLOAT register and no free TYP_DOUBLE register. I've looked into getTempRegForResolution() and it does not guarantee reserving a temp register.
What do you think of it?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If you checked for a TYP_DOUBLE first, and it was found, then you could save its lower half as the TYP_FLOAT temp. If not, then you could check for a single register for TYP_FLOAT

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I see. I've updated the PR.

Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
@hqueue
hqueue force-pushed the arm/ryujit/lsra_11851_resolve_edges branch from 0c04922 to a0a4799 Compare June 15, 2017 08:43
…FLOAT

First, try to reserve a double temp register for both TYP_DOUBLE and TYP_FLOAT.
If fails, try to reserve a float temp register for only TYP_FLOAT.

Signed-off-by: Hyung-Kyu Choi <hk0110.choi@samsung.com>
@hqueue

hqueue commented Jun 15, 2017

Copy link
Copy Markdown
Member Author

@CarolEidt Please take a look. Thanks!

@CarolEidt CarolEidt left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM. Thanks for making the changes.

@CarolEidt
CarolEidt merged commit 237cbb5 into dotnet:master Jun 16, 2017
@karelz karelz modified the milestone: 2.1.0 Aug 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants