Repository navigation
Use emit_ptr_va_arg for va_arg on M68k - #165465
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
As discussed in #rustc-codegen-gcc > ABI of m68k, there are several ABIs for m68k and the current rust targets don't match GCC overall, so I'm not sure it should be the reference for the rustc implementation. Hopefully the target maintainers can shine a light on the situation? |
There is actually just one official SysV m68k ELF ABI. Linux is off-standard and I'm working on changing that as explained on the Debian Wiki. NetBSD/ELF is using the proper ABI, Linux isn't. |
|
So to be clear, you would support rust matching GCC's |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
For the types Rust currently supports ( |
This comment has been minimized.
This comment has been minimized.
9332810 to
1c60721
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. |
|
Final call to the target maintainers if you have any concerns here. If not, we'll just merge this. We've looked at the assembly a bunch, and I ran the c-variadic |
|
No objections from me |
|
@bors r+ |
Use `emit_ptr_va_arg` for `va_arg` on M68k This avoids using the LLVM `va_arg` instruction. AFAICT LLVM's implementation currently miscompiles the `va_arg` instruction for `f64` (and needlessly aligns the pointer that is guaranteed to be aligned for `i32` and `i64`) - this PR matches GCC (checked by comparing the assembly). Ping target maintainers: @glaubitz @ricky26 @knickish r? @folkertdev
Rollup of 16 pull requests Successful merges: - #166037 (reflection: enable tool attributes to be reflectable) - #165008 (Support `NonNull` pointers as `asm!` input operands) - #165465 (Use `emit_ptr_va_arg` for `va_arg` on M68k) - #166042 (Fix out of scope method suggestion) - #166090 (bootstrap: rebuild LLD when LLVM changes) - #159795 (Introduce `-Z pack-coroutine-layout` flag) - #163556 (arm: only f32 and f64 are valid HFA bases) - #164665 (Add Reference annotations for inline assembly) - #165725 (change target modifier errors to use the diagnostic APIs instead of structs) - #165912 (simplify `fluent_value_from_str_list_sep_by_and`) - #165982 (compiler: Stop special-casing `report_in_external_macro` in `declare_tool_lint!`) - #166006 (Detect method shadowed by another when accessing a field or calling method that isn't found in method chain) - #166083 (Record seeds in the appropriate order) - #166104 (abi/bad-custom.rs: make test run on all editions) - #166124 (platform-support: add amaanq as powerpc64-unknown-linux-gnuelfv2 maintainer) - #166127 (Add tests from failed attempt at implementing `hir::Param` move) Failed merges: - #165094 (reflection: doc attributes from adts, fields, and variants)
…uwer Rollup of 15 pull requests Successful merges: - #166037 (reflection: enable tool attributes to be reflectable) - #165465 (Use `emit_ptr_va_arg` for `va_arg` on M68k) - #166042 (Fix out of scope method suggestion) - #166090 (bootstrap: rebuild LLD when LLVM changes) - #159795 (Introduce `-Z pack-coroutine-layout` flag) - #163556 (arm: only f32 and f64 are valid HFA bases) - #164665 (Add Reference annotations for inline assembly) - #165725 (change target modifier errors to use the diagnostic APIs instead of structs) - #165912 (simplify `fluent_value_from_str_list_sep_by_and`) - #165982 (compiler: Stop special-casing `report_in_external_macro` in `declare_tool_lint!`) - #166006 (Detect method shadowed by another when accessing a field or calling method that isn't found in method chain) - #166083 (Record seeds in the appropriate order) - #166104 (abi/bad-custom.rs: make test run on all editions) - #166124 (platform-support: add amaanq as powerpc64-unknown-linux-gnuelfv2 maintainer) - #166127 (Add tests from failed attempt at implementing `hir::Param` move) Failed merges: - #165094 (reflection: doc attributes from adts, fields, and variants)
Rollup merge of #165465 - beetrees:va-arg-m68k, r=folkertdev Use `emit_ptr_va_arg` for `va_arg` on M68k This avoids using the LLVM `va_arg` instruction. AFAICT LLVM's implementation currently miscompiles the `va_arg` instruction for `f64` (and needlessly aligns the pointer that is guaranteed to be aligned for `i32` and `i64`) - this PR matches GCC (checked by comparing the assembly). Ping target maintainers: @glaubitz @ricky26 @knickish r? @folkertdev
…uwer Rollup of 15 pull requests Successful merges: - rust-lang/rust#166037 (reflection: enable tool attributes to be reflectable) - rust-lang/rust#165465 (Use `emit_ptr_va_arg` for `va_arg` on M68k) - rust-lang/rust#166042 (Fix out of scope method suggestion) - rust-lang/rust#166090 (bootstrap: rebuild LLD when LLVM changes) - rust-lang/rust#159795 (Introduce `-Z pack-coroutine-layout` flag) - rust-lang/rust#163556 (arm: only f32 and f64 are valid HFA bases) - rust-lang/rust#164665 (Add Reference annotations for inline assembly) - rust-lang/rust#165725 (change target modifier errors to use the diagnostic APIs instead of structs) - rust-lang/rust#165912 (simplify `fluent_value_from_str_list_sep_by_and`) - rust-lang/rust#165982 (compiler: Stop special-casing `report_in_external_macro` in `declare_tool_lint!`) - rust-lang/rust#166006 (Detect method shadowed by another when accessing a field or calling method that isn't found in method chain) - rust-lang/rust#166083 (Record seeds in the appropriate order) - rust-lang/rust#166104 (abi/bad-custom.rs: make test run on all editions) - rust-lang/rust#166124 (platform-support: add amaanq as powerpc64-unknown-linux-gnuelfv2 maintainer) - rust-lang/rust#166127 (Add tests from failed attempt at implementing `hir::Param` move) Failed merges: - rust-lang/rust#165094 (reflection: doc attributes from adts, fields, and variants)
This avoids using the LLVM
va_arginstruction. AFAICT LLVM's implementation currently miscompiles theva_arginstruction forf64(and needlessly aligns the pointer that is guaranteed to be aligned fori32andi64) - this PR matches GCC (checked by comparing the assembly).Ping target maintainers: @glaubitz @ricky26 @knickish
r? @folkertdev