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

Rollup of 7 pull requests #129046

Merged
merged 23 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
207ee73
std: refactor UNIX random data generation
joboet Aug 4, 2024
ba3cb15
Remove unused lifetime parameter from spawn_unchecked
dtolnay Aug 6, 2024
715728f
Refactor `powerpc64` call ABI handling
beetrees Aug 4, 2024
99c0d76
std: use `/scheme/rand` on Redox
joboet Aug 12, 2024
83727ec
don't use rustflags for `--rustc-args`
lqd Aug 8, 2024
754f565
don't use `--rustc-args` to test the stdlib's size optimizations feature
lqd Aug 8, 2024
bc9ca29
clarify that `--rustc-args` is for compiletest tests
lqd Aug 8, 2024
0ad798a
remove unexpected `--rustc-args` from `./x miri`
lqd Aug 12, 2024
5e87256
rename `./x test`'s `--rustc-args` to `--compiletest-rustc-args`
lqd Aug 12, 2024
ee5d15c
regenerate `./x` completions
lqd Aug 12, 2024
2abfa35
add change tracker notice
lqd Aug 12, 2024
66c93ac
CFI: Move CFI ui tests to cfi directory
rcvalle Aug 12, 2024
6d91017
Extract a helper method for blessing in `Diff`
Zalathar Aug 13, 2024
cc58cf6
Fix blessing of rmake tests
Zalathar Aug 13, 2024
0cfbfa9
Create a `TargetSelection` method for recognizing `*-windows-gnu` tar…
Kobzol Aug 11, 2024
1c0c2c3
Implement `AsRef<Path>` for `TargetSelection`
Kobzol Aug 11, 2024
00d040e
Rollup merge of #128643 - beetrees:ppc64-abi-fix, r=bjorn3
matthiaskrgr Aug 13, 2024
c977deb
Rollup merge of #128655 - joboet:play_with_the_dice, r=ChrisDenton
matthiaskrgr Aug 13, 2024
37b9567
Rollup merge of #128745 - dtolnay:spawnunchecked, r=workingjubilee
matthiaskrgr Aug 13, 2024
0643c3b
Rollup merge of #128841 - lqd:rustc-args, r=onur-ozkan
matthiaskrgr Aug 13, 2024
9d9c9ac
Rollup merge of #128983 - Kobzol:bootstrap-target, r=onur-ozkan
matthiaskrgr Aug 13, 2024
41aa963
Rollup merge of #129026 - rcvalle:rust-cfi-move-cfi-ui-tests-to-cfi-d…
matthiaskrgr Aug 13, 2024
42f70c2
Rollup merge of #129040 - Zalathar:bless-rmake, r=jieyouxu
matthiaskrgr Aug 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/rustc_codegen_gcc/build_system/src/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ fn asm_tests(env: &Env, args: &TestArg) -> Result<(), String> {
&"--stage",
&"0",
&"tests/assembly/asm",
&"--rustc-args",
&"--compiletest-rustc-args",
&rustc_args,
],
Some(&rust_dir),
Expand Down Expand Up @@ -1020,7 +1020,7 @@ where
&"--stage",
&"0",
&format!("tests/{}", test_type),
&"--rustc-args",
&"--compiletest-rustc-args",
&rustc_args,
],
Some(&rust_path),
Expand Down
67 changes: 12 additions & 55 deletions compiler/rustc_target/src/abi/call/powerpc64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,64 +41,23 @@ where
})
}

fn classify_ret<'a, Ty, C>(cx: &C, ret: &mut ArgAbi<'a, Ty>, abi: ABI)
fn classify<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, abi: ABI, is_ret: bool)
where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
if !ret.layout.is_sized() {
if arg.is_ignore() || !arg.layout.is_sized() {
// Not touching this...
return;
}
if !ret.layout.is_aggregate() {
ret.extend_integer_width_to(64);
if !arg.layout.is_aggregate() {
arg.extend_integer_width_to(64);
return;
}

// The ELFv1 ABI doesn't return aggregates in registers
if abi == ELFv1 {
ret.make_indirect();
return;
}

if let Some(uniform) = is_homogeneous_aggregate(cx, ret, abi) {
ret.cast_to(uniform);
return;
}

let size = ret.layout.size;
let bits = size.bits();
if bits <= 128 {
let unit = if cx.data_layout().endian == Endian::Big {
Reg { kind: RegKind::Integer, size }
} else if bits <= 8 {
Reg::i8()
} else if bits <= 16 {
Reg::i16()
} else if bits <= 32 {
Reg::i32()
} else {
Reg::i64()
};

ret.cast_to(Uniform::new(unit, size));
return;
}

ret.make_indirect();
}

fn classify_arg<'a, Ty, C>(cx: &C, arg: &mut ArgAbi<'a, Ty>, abi: ABI)
where
Ty: TyAbiInterface<'a, C> + Copy,
C: HasDataLayout,
{
if !arg.layout.is_sized() {
// Not touching this...
return;
}
if !arg.layout.is_aggregate() {
arg.extend_integer_width_to(64);
if is_ret && abi == ELFv1 {
arg.make_indirect();
return;
}

Expand All @@ -108,7 +67,10 @@ where
}

let size = arg.layout.size;
if size.bits() <= 64 {
if is_ret && size.bits() > 128 {
// Non-homogeneous aggregates larger than two doublewords are returned indirectly.
arg.make_indirect();
} else if size.bits() <= 64 {
// Aggregates smaller than a doubleword should appear in
// the least-significant bits of the parameter doubleword.
arg.cast_to(Reg { kind: RegKind::Integer, size })
Expand Down Expand Up @@ -138,14 +100,9 @@ where
}
};

if !fn_abi.ret.is_ignore() {
classify_ret(cx, &mut fn_abi.ret, abi);
}
classify(cx, &mut fn_abi.ret, abi, true);

for arg in fn_abi.args.iter_mut() {
if arg.is_ignore() {
continue;
}
classify_arg(cx, arg, abi);
classify(cx, arg, abi, false);
}
}
Loading
Loading