Skip to content

[test] Add s390x support for test/IRGen/pic.swift #22068

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 2 commits into from
Jan 30, 2019

Conversation

levivic
Copy link
Contributor

@levivic levivic commented Jan 23, 2019

This is adding s390x support for test/IRGen/pic.swift.

@compnerd
Copy link
Member

Hmm, I don't know s390 assembly to properly review this. Why does $s4main6globalSivp not need any modifiers for the PIC access?

@jrose-apple jrose-apple requested a review from rjmccall January 24, 2019 01:50
@rjmccall
Copy link
Contributor

Looks like lgrl takes a 32-bit relative offset.

It looks like this is hard-coding a specific frame layout. Are you okay with potentially changing this test whenever you change the backend?

@levivic
Copy link
Contributor Author

levivic commented Jan 24, 2019

Hmm, I don't know s390 assembly to properly review this. Why does $s4main6globalSivp not need any modifiers for the PIC access?

By reading the check label for other cpu (e.g., x86_64, aarch64) within this test file, I am not sure what kind of modifier $s4main6globalSivp needs. On s390x, lgrl load $s4main6globalSivp into REG2 and REG2 is stg stored into address REG4 +160.

@levivic
Copy link
Contributor Author

levivic commented Jan 24, 2019

Looks like lgrl takes a 32-bit relative offset.

It looks like this is hard-coding a specific frame layout. Are you okay with potentially changing this test whenever you change the backend?

You mean potentially change of this test whenever the backend platform is changed? If so, yes, our team has been closely following the development of swift, as well as the platform we are using.

@rjmccall
Copy link
Contributor

rjmccall commented Jan 24, 2019

I am not sure what kind of modifier $s4main6globalSivp needs.

@compnerd is just unfamiliar with z/Architecture assembly. In many assembly languages, the fact that the immediate is PC-relative would be more explicit.

You mean potentially change of this test whenever the backend platform is changed? If so, yes, our team has been closely following the development of swift, as well as the platform we are using.

It feels like an unnecessary burden to have frontend tests break from unrelated backend changes. If this test is just checking that we generate PIC, I think the only line you actually need here is the lgrl.

@levivic
Copy link
Contributor Author

levivic commented Jan 24, 2019

It feels like an unnecessary burden to have frontend tests break from unrelated backend changes. If this test is just checking that we generate PIC, I think the only line you actually need here is the lgrl.

Sure, will provide an update. Thanks.

Copy link
Contributor

@rjmccall rjmccall left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@rjmccall
Copy link
Contributor

@swift-ci Please test.

@swift-ci
Copy link
Contributor

Build failed
Swift Test OS X Platform
Git Sha - 05fbe8d

@swift-ci
Copy link
Contributor

Build failed
Swift Test Linux Platform
Git Sha - 05fbe8d

@compnerd compnerd merged commit ebed597 into swiftlang:master Jan 30, 2019
@levivic levivic deleted the swift5.0-s390x-pictest-fix branch January 30, 2019 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants