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

Add template for function generateS390CompareAndBranchInstruction #4200

Merged
merged 3 commits into from
Aug 27, 2019

Conversation

simonameng
Copy link
Contributor

Adding template for function generateS390CompareAndBranchInstruction and declaring it to accept int32_t or int64_t type only for parameter second. Also, casting parameters in the use cases which don't fit the declaration.

Closes: #3878

@simonameng
Copy link
Contributor Author

simonameng commented Aug 12, 2019

@r30shah @joransiu Can you help review it?

…nd cast the relevant use cases

Adding template for function `generateS390CompareAndBranchInstruction` and initialize it to pass in int32_t or int64_t type only for the parameter `second`.Also, cast the type of the parameter to either int32_t or int64_t in the use cases if needed.

Adding a new signiture to have it pass in `TR::RealRegister *` type for parameter `second`, and casting it to `TR::Register *` type to use the relevant function.

Signed-off-by: simonameng <simonameng97@gmail.com>
@simonameng
Copy link
Contributor Author

Since we found the use cases which pass in TR::RealRegister type argument, we add the version of generateS390CompareAndBranchInstruction which takes TR::RealRegister as argument. The amount of use cases passing in TR::RealRegister is large, hard to find them out and then cast them to TR::Register type. So we cast it to TR::Register inside the function and use the TR::Register version.

…hInstruction`

Delete the `TR::RealRegister` version of `generateS390CompareAndBranchInstruction` since alreay typecasted the relevant argument to `TR::Register` from `TR::RealRegister`.

Signed-off-by: simonameng <simonameng97@gmail.com>
compiler/z/codegen/ControlFlowEvaluator.cpp Outdated Show resolved Hide resolved
compiler/z/codegen/ControlFlowEvaluator.cpp Outdated Show resolved Hide resolved
For the use cases with op code `TR::InstOpCode::CL`, treat the immediate value as `int32_t` type. And for the use cases with op code `TR::InstOpCode::CLG`, treat the immediate value as `int64_t` type.

Signed-off-by: simonameng <simonameng97@gmail.com>
Copy link
Contributor

@r30shah r30shah left a comment

Choose a reason for hiding this comment

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

All changes looks good to me. Will leave this to @fjeremic to review and launch Sanity tests.

@fjeremic
Copy link
Contributor

@genie-omr build all

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CompilerTest failures on Z in JITS390OpCodesTest.S390AddressTest
4 participants