Repository navigation
make mips64 Complex GCC-compatible - #162921
Conversation
This comment has been minimized.
This comment has been minimized.
8b43135 to
1e27315
Compare
This comment has been minimized.
This comment has been minimized.
1e27315 to
74f5bbb
Compare
|
r? beetrees (one of 3 remaining architectures: we're getting there!) |
|
|
| arg.cast_to_and_pad_i32(Uniform::new(Reg::i64(), size), pad_i32); | ||
| } | ||
| Numeric::Float(Float::F128) => { | ||
| // Complex<f128> is passed in 4 GPRs, but aligned to 16 so may need padding. |
There was a problem hiding this comment.
| // Complex<f128> is passed in 4 GPRs, but aligned to 16 so may need padding. | |
| // Complex<f128> is passed in 4 FPRs, but aligned to 16 so may need padding. |
| arg.cast_to(cast_target.with_attrs(ArgAttribute::InReg.into())); | ||
| } | ||
| Numeric::Int(Integer::I64 | Integer::I128, _) => { | ||
| // Complex<i64> and Complex<i64> are passed as 2 separate arguments, which is what |
There was a problem hiding this comment.
| // Complex<i64> and Complex<i64> are passed as 2 separate arguments, which is what | |
| // Complex<i64> and Complex<i128> are passed as 2 separate arguments, which is what |
| Numeric::Float(Float::F32 | Float::F64) => { | ||
| // Only pass a Complex<f32>/Complex<f64> in FPRs when two argument slots are free, | ||
| if curr_offset.bytes() / slot.bytes() + 2 <= NUM_ARG_SLOTS { | ||
| // The default `PassMode::Pair` already passes one component per register. Both |
There was a problem hiding this comment.
Can we use PassMode::Cast rather than relying on PassMode::Pair happening to do the right thing?
| } | ||
| Numeric::Int(Integer::I64 | Integer::I128, _) => { | ||
| // Complex<i64> and Complex<i64> are passed as 2 separate arguments, which is what | ||
| // the default `PassMode::Pair` already does. |
There was a problem hiding this comment.
Use PassMode::Cast here too?
| Numeric::Float(Float::F16) => unreachable!("not supported on mips64"), | ||
| Numeric::Float(Float::F32 | Float::F64) => { | ||
| // Only pass a Complex<f32>/Complex<f64> in FPRs when two argument slots are free, | ||
| if curr_offset.bytes() / slot.bytes() + 2 <= NUM_ARG_SLOTS { |
There was a problem hiding this comment.
C-variadic arguments are always passed in GPRs, so Complex<f32> needs to be passed in one slot in that case.
There was a problem hiding this comment.
If you're wanting to leave C-variadic compatibility till later, leave a FIXME here instead?
There was a problem hiding this comment.
Add a test for passing Complex as a C-variadic argument?
There was a problem hiding this comment.
Our va_arg can't handle that for most targets at the moment (and VaArgSafe is not implemented for Complex yet). I intend to do another sweep for c-variadic once we have "normal" call support across targets.
|
Reminder, once the PR becomes ready for a review, use |
74f5bbb to
a5b7535
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@rustbot ready |
| Numeric::Float(Float::F16) => unreachable!("not supported on mips64"), | ||
| Numeric::Float(Float::F32 | Float::F64) => { | ||
| // Only pass a Complex<f32>/Complex<f64> in FPRs when two argument slots are free, | ||
| if curr_offset.bytes() / slot.bytes() + 2 <= NUM_ARG_SLOTS { |
There was a problem hiding this comment.
If you're wanting to leave C-variadic compatibility till later, leave a FIXME here instead?
a5b7535 to
dd0f941
Compare
|
fixme added (I assume we can just treat all complex numbers generically for it, but we'll see) @bors r=beetrees rollup |
make mips64 `Complex` GCC-compatible tracking issue: rust-lang#154023 This implementation is compatible with GCC and Clang >= 24, see llvm/llvm-project#212109. This implementation has been validated versus GCC and Clang 24 with abi-cafe.
…uwer Rollup of 18 pull requests Successful merges: - #163532 (rustc_codegen_cranelift subtree update) - #163534 (miri subtree update) - #163279 (const and NonZero impl for clamp_magnitude()) - #162900 (Some refactorings around metadata encoding) - #163455 (Don't use the metadata based crate_hash for rustdoc runs) - #159798 (Attribute documentation for cfg_attr) - #162921 (make mips64 `Complex` GCC-compatible) - #163368 (Don't build format string suggestions from `concat!` offsets) - #163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance) - #163405 (Remove some #[linkage] options) - #163470 (Miscellaneous attr error stuff) - #163489 (expose Rc::is_unique) - #163492 (x86 and x86_64: cleanup some callconv code) - #163496 (cycle handling: mirror old solver) - #163509 (Use more default field values in `Resolver`) - #163519 (Forbid `Reborrow` impls for types with destructors) - #163520 (Cast cleanups) - #163524 (Document `Result` case for the `arena_cache` query modifier)
…uwer Rollup of 18 pull requests Successful merges: - #163532 (rustc_codegen_cranelift subtree update) - #163534 (miri subtree update) - #163279 (const and NonZero impl for clamp_magnitude()) - #162900 (Some refactorings around metadata encoding) - #163455 (Don't use the metadata based crate_hash for rustdoc runs) - #159798 (Attribute documentation for cfg_attr) - #162921 (make mips64 `Complex` GCC-compatible) - #163368 (Don't build format string suggestions from `concat!` offsets) - #163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance) - #163405 (Remove some #[linkage] options) - #163470 (Miscellaneous attr error stuff) - #163489 (expose Rc::is_unique) - #163492 (x86 and x86_64: cleanup some callconv code) - #163496 (cycle handling: mirror old solver) - #163509 (Use more default field values in `Resolver`) - #163519 (Forbid `Reborrow` impls for types with destructors) - #163520 (Cast cleanups) - #163524 (Document `Result` case for the `arena_cache` query modifier)
Rollup of 20 pull requests Successful merges: - #163279 (const and NonZero impl for clamp_magnitude()) - #163081 (Provide more context on "not general enough" error) - #163455 (Don't use the metadata based crate_hash for rustdoc runs) - #159798 (Attribute documentation for cfg_attr) - #162921 (make mips64 `Complex` GCC-compatible) - #163368 (Don't build format string suggestions from `concat!` offsets) - #163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance) - #163470 (Miscellaneous attr error stuff) - #163489 (expose Rc::is_unique) - #163492 (x86 and x86_64: cleanup some callconv code) - #163496 (cycle handling: mirror old solver) - #163509 (Use more default field values in `Resolver`) - #163519 (Forbid `Reborrow` impls for types with destructors) - #163520 (Cast cleanups) - #163524 (Document `Result` case for the `arena_cache` query modifier) - #163546 (PassWrapper: adapt for new PassPlugin load method) - #163551 (Add libs-nominated triagebot config) - #163559 (Suggest `#[unsafe(no_mangle)]` for entry points in `no_std` binaries) - #163564 (rustc-dev-guide subtree update) - #163568 (remove dead cfg_select! arm)
Rollup merge of #162921 - folkertdev:complex-mips64, r=beetrees make mips64 `Complex` GCC-compatible tracking issue: #154023 This implementation is compatible with GCC and Clang >= 24, see llvm/llvm-project#212109. This implementation has been validated versus GCC and Clang 24 with abi-cafe.
Rollup of 20 pull requests Successful merges: - rust-lang/rust#163279 (const and NonZero impl for clamp_magnitude()) - rust-lang/rust#163081 (Provide more context on "not general enough" error) - rust-lang/rust#163455 (Don't use the metadata based crate_hash for rustdoc runs) - rust-lang/rust#159798 (Attribute documentation for cfg_attr) - rust-lang/rust#162921 (make mips64 `Complex` GCC-compatible) - rust-lang/rust#163368 (Don't build format string suggestions from `concat!` offsets) - rust-lang/rust#163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance) - rust-lang/rust#163470 (Miscellaneous attr error stuff) - rust-lang/rust#163489 (expose Rc::is_unique) - rust-lang/rust#163492 (x86 and x86_64: cleanup some callconv code) - rust-lang/rust#163496 (cycle handling: mirror old solver) - rust-lang/rust#163509 (Use more default field values in `Resolver`) - rust-lang/rust#163519 (Forbid `Reborrow` impls for types with destructors) - rust-lang/rust#163520 (Cast cleanups) - rust-lang/rust#163524 (Document `Result` case for the `arena_cache` query modifier) - rust-lang/rust#163546 (PassWrapper: adapt for new PassPlugin load method) - rust-lang/rust#163551 (Add libs-nominated triagebot config) - rust-lang/rust#163559 (Suggest `#[unsafe(no_mangle)]` for entry points in `no_std` binaries) - rust-lang/rust#163564 (rustc-dev-guide subtree update) - rust-lang/rust#163568 (remove dead cfg_select! arm)
Rollup of 20 pull requests Successful merges: - rust-lang/rust#163279 (const and NonZero impl for clamp_magnitude()) - rust-lang/rust#163081 (Provide more context on "not general enough" error) - rust-lang/rust#163455 (Don't use the metadata based crate_hash for rustdoc runs) - rust-lang/rust#159798 (Attribute documentation for cfg_attr) - rust-lang/rust#162921 (make mips64 `Complex` GCC-compatible) - rust-lang/rust#163368 (Don't build format string suggestions from `concat!` offsets) - rust-lang/rust#163375 (Update expect messages in library/std/src/os/unix/net/ following Rust's `expect` guidance) - rust-lang/rust#163470 (Miscellaneous attr error stuff) - rust-lang/rust#163489 (expose Rc::is_unique) - rust-lang/rust#163492 (x86 and x86_64: cleanup some callconv code) - rust-lang/rust#163496 (cycle handling: mirror old solver) - rust-lang/rust#163509 (Use more default field values in `Resolver`) - rust-lang/rust#163519 (Forbid `Reborrow` impls for types with destructors) - rust-lang/rust#163520 (Cast cleanups) - rust-lang/rust#163524 (Document `Result` case for the `arena_cache` query modifier) - rust-lang/rust#163546 (PassWrapper: adapt for new PassPlugin load method) - rust-lang/rust#163551 (Add libs-nominated triagebot config) - rust-lang/rust#163559 (Suggest `#[unsafe(no_mangle)]` for entry points in `no_std` binaries) - rust-lang/rust#163564 (rustc-dev-guide subtree update) - rust-lang/rust#163568 (remove dead cfg_select! arm)
tracking issue: #154023
This implementation is compatible with GCC and Clang >= 24, see llvm/llvm-project#212109.
This implementation has been validated versus GCC and Clang 24 with abi-cafe.