Repository navigation
add c-variadic support for x87_f80 - #166510
Conversation
| // X86_64-NEXT: mov rcx, qword ptr [rax] | ||
| // X86_64-NEXT: movzx edx, byte ptr [rax + 8] | ||
| // X86_64-NEXT: movzx eax, byte ptr [rax + 9] |
There was a problem hiding this comment.
This is a 10-byte load which is worse assembly than a x87_fp80 load. Totally acceptable, certainly for now.
|
r? beetrees |
|
|
There was a problem hiding this comment.
This PR currently results in llvm_type being called on a Rust aggregate (x87_f80) and then the resulting LLVM aggregate being loaded, both of which should be avoided. One solution that would work in this particular case is to substitute cx.type_x87_f80() when layout.is_x87_f80() and let the llvm_value_to_intrinsicresult call at the bottom of codegen_rustc_intrinsic_call store it to the result place. This would work in this particular scenario (and would be fine for this PR), but won't work for other BackendRepr::Memory aggregates like Complex<x87_f80> that can't be represented as a LLVM primitive. The more long-term solution would be to pass result_place to emit_va_arg and directly memcpy the result into it.
Could you also add an codegen-llvm test for the IR emitted by next_arg::<x87_f80>()? Since this is the first Rust aggregate type to have va_arg support it would be good to have a test for what LLVM IR we emit.
|
Reminder, once the PR becomes ready for a review, use |
8bbf69e to
9336909
Compare
This comment has been minimized.
This comment has been minimized.
9336909 to
d6027f8
Compare
This comment has been minimized.
This comment has been minimized.
d6027f8 to
1cd12c4
Compare
I guess things got renamed and there were some editing mishaps.
1cd12c4 to
5300ab3
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. |
| ) | ||
| } | ||
|
|
||
| /// A helper for llvm_type that ensures we don't call it on non-primitive types. |
There was a problem hiding this comment.
| /// A helper for llvm_type that ensures we don't call it on non-primitive types. | |
| /// A helper for backend_type that ensures we don't call it on non-primitive types. |
To match the method.
da50b19 to
b19a65d
Compare
|
@bors r=beetrees |
…eetrees add c-variadic support for `x87_f80` tracking issue: rust-lang#163982 The default paths already have the right behavior. Validated with abi-cafe.
…uwer Rollup of 9 pull requests Successful merges: - #163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope) - #163910 (debugger: stabilize trim-paths unremap file loading) - #166175 (Use `__fastfail()` for `crash()` on Windows) - #166377 (fix: ignore format literal source availability in stable hashes) - #166510 (add c-variadic support for `x87_f80`) - #166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`) - #161531 (Remove `T: Send + Sync` bound from `Arc::downcast`) - #166641 (fix: bootstrap build directory handling with --set) - #166655 (Submodule update of rustc-perf)
…uwer Rollup of 9 pull requests Successful merges: - #163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope) - #163910 (debugger: stabilize trim-paths unremap file loading) - #166377 (fix: ignore format literal source availability in stable hashes) - #166510 (add c-variadic support for `x87_f80`) - #166631 (Remove `fn terminator()` and `terminator_mut()`) - #166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`) - #161531 (Remove `T: Send + Sync` bound from `Arc::downcast`) - #166641 (fix: bootstrap build directory handling with --set) - #166655 (Submodule update of rustc-perf)
…uwer Rollup of 9 pull requests Successful merges: - rust-lang/rust#163895 (Stabilize `--remap-path-scope` in rustdoc and the `documentation` scope) - rust-lang/rust#163910 (debugger: stabilize trim-paths unremap file loading) - rust-lang/rust#166377 (fix: ignore format literal source availability in stable hashes) - rust-lang/rust#166510 (add c-variadic support for `x87_f80`) - rust-lang/rust#166631 (Remove `fn terminator()` and `terminator_mut()`) - rust-lang/rust#166650 (Don't round the number of bits passed to `{Size,Align}::from_bits`) - rust-lang/rust#161531 (Remove `T: Send + Sync` bound from `Arc::downcast`) - rust-lang/rust#166641 (fix: bootstrap build directory handling with --set) - rust-lang/rust#166655 (Submodule update of rustc-perf)
View all comments
tracking issue: #163982
The default paths already have the right behavior. Validated with abi-cafe.