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

Support 16-bit targets in get_pointer_width #56567

Closed
varkor opened this issue Dec 6, 2018 · 3 comments
Closed

Support 16-bit targets in get_pointer_width #56567

varkor opened this issue Dec 6, 2018 · 3 comments
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@varkor
Copy link
Member

varkor commented Dec 6, 2018

pub fn get_pointer_width(triple: &str) -> &'static str {
if (triple.contains("64") && !triple.ends_with("gnux32")) || triple.starts_with("s390x") {
"64bit"
} else {
"32bit"
}
}

We should also support "16bit" here.

Once that's supported, the precise_pointer_matching test can be updated:

// normalize-stderr-32bit: "-2147483648isize" -> "$$ISIZE_MIN"
// normalize-stderr-64bit: "-9223372036854775808isize" -> "$$ISIZE_MIN"
// normalize-stderr-32bit: "2147483647isize" -> "$$ISIZE_MAX"
// normalize-stderr-64bit: "9223372036854775807isize" -> "$$ISIZE_MAX"
// normalize-stderr-32bit: "4294967295usize" -> "$$USIZE_MAX"
// normalize-stderr-64bit: "18446744073709551615usize" -> "$$USIZE_MAX"

@Centril
Copy link
Contributor

Centril commented Dec 6, 2018

cc @pnkfelix

@estebank estebank added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Dec 6, 2018
@eddyb
Copy link
Member

eddyb commented Dec 7, 2018

if (triple.contains("64") && !triple.ends_with("gnux32")) || triple.starts_with("s390x") {

That's very fragile, it should've used rustc --print=cfg instead (or --print=target-spec-json and parse the output as JSON).
cc @nikomatsakis @kennytm

@jonas-schievink jonas-schievink added the A-testsuite Area: The testsuite used to check the correctness of rustc label Oct 16, 2019
@kadiwa4
Copy link
Contributor

kadiwa4 commented Jan 25, 2023

No longer relevant since #100260.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testsuite Area: The testsuite used to check the correctness of rustc C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants