Skip to content

Commit c817d5d

Browse files
committed
Auto merge of #131098 - GuillaumeGomez:rollup-kk74was, r=GuillaumeGomez
Rollup of 5 pull requests Successful merges: - #130630 (Support clobber_abi and vector/access registers (clobber-only) in s390x inline assembly) - #131042 (Instantiate binders in `supertrait_vtable_slot`) - #131079 (Update wasm-component-ld to 0.5.9) - #131085 (make test_lots_of_insertions test take less long in Miri) - #131088 (add fixme to remove LLVM_ENABLE_TERMINFO when minimal llvm version is 19) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8dd5cd0 + 91f079a commit c817d5d

File tree

14 files changed

+316
-71
lines changed

14 files changed

+316
-71
lines changed

Cargo.lock

+24-24
Original file line numberDiff line numberDiff line change
@@ -5768,16 +5768,16 @@ checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484"
57685768

57695769
[[package]]
57705770
name = "wasm-component-ld"
5771-
version = "0.5.8"
5771+
version = "0.5.9"
57725772
source = "registry+https://github.com/rust-lang/crates.io-index"
5773-
checksum = "cb17cdbc91766d4ea0bcd6026c36ba77a21b5c8199aeb1f0993461fe6a6bec2b"
5773+
checksum = "fde17bc96539700198e12516230c76095cc215c84ef39ad206e1af3f84243e0f"
57745774
dependencies = [
57755775
"anyhow",
57765776
"clap",
57775777
"lexopt",
57785778
"tempfile",
57795779
"wasi-preview1-component-adapter-provider",
5780-
"wasmparser 0.217.0",
5780+
"wasmparser 0.218.0",
57815781
"wat",
57825782
"wit-component",
57835783
"wit-parser",
@@ -5801,28 +5801,28 @@ dependencies = [
58015801

58025802
[[package]]
58035803
name = "wasm-encoder"
5804-
version = "0.217.0"
5804+
version = "0.218.0"
58055805
source = "registry+https://github.com/rust-lang/crates.io-index"
5806-
checksum = "7b88b0814c9a2b323a9b46c687e726996c255ac8b64aa237dd11c81ed4854760"
5806+
checksum = "22b896fa8ceb71091ace9bcb81e853f54043183a1c9667cf93422c40252ffa0a"
58075807
dependencies = [
58085808
"leb128",
5809-
"wasmparser 0.217.0",
5809+
"wasmparser 0.218.0",
58105810
]
58115811

58125812
[[package]]
58135813
name = "wasm-metadata"
5814-
version = "0.217.0"
5814+
version = "0.218.0"
58155815
source = "registry+https://github.com/rust-lang/crates.io-index"
5816-
checksum = "65a146bf9a60e9264f0548a2599aa9656dba9a641eff9ab88299dc2a637e483c"
5816+
checksum = "aa5eeb071abe8a2132fdd5565dabffee70775ee8c24fc7e300ac43f51f4a8a91"
58175817
dependencies = [
58185818
"anyhow",
58195819
"indexmap",
58205820
"serde",
58215821
"serde_derive",
58225822
"serde_json",
58235823
"spdx",
5824-
"wasm-encoder 0.217.0",
5825-
"wasmparser 0.217.0",
5824+
"wasm-encoder 0.218.0",
5825+
"wasmparser 0.218.0",
58265826
]
58275827

58285828
[[package]]
@@ -5837,9 +5837,9 @@ dependencies = [
58375837

58385838
[[package]]
58395839
name = "wasmparser"
5840-
version = "0.217.0"
5840+
version = "0.218.0"
58415841
source = "registry+https://github.com/rust-lang/crates.io-index"
5842-
checksum = "ca917a21307d3adf2b9857b94dd05ebf8496bdcff4437a9b9fb3899d3e6c74e7"
5842+
checksum = "b09e46c7fceceaa72b2dd1a8a137ea7fd8f93dfaa69806010a709918e496c5dc"
58435843
dependencies = [
58445844
"ahash",
58455845
"bitflags 2.6.0",
@@ -5851,22 +5851,22 @@ dependencies = [
58515851

58525852
[[package]]
58535853
name = "wast"
5854-
version = "217.0.0"
5854+
version = "218.0.0"
58555855
source = "registry+https://github.com/rust-lang/crates.io-index"
5856-
checksum = "79004ecebded92d3c710d4841383368c7f04b63d0992ddd6b0c7d5029b7629b7"
5856+
checksum = "8a53cd1f0fa505df97557e36a58bddb8296e2fcdcd089529545ebfdb18a1b9d7"
58575857
dependencies = [
58585858
"bumpalo",
58595859
"leb128",
58605860
"memchr",
58615861
"unicode-width",
5862-
"wasm-encoder 0.217.0",
5862+
"wasm-encoder 0.218.0",
58635863
]
58645864

58655865
[[package]]
58665866
name = "wat"
5867-
version = "1.217.0"
5867+
version = "1.218.0"
58685868
source = "registry+https://github.com/rust-lang/crates.io-index"
5869-
checksum = "c126271c3d92ca0f7c63e4e462e40c69cca52fd4245fcda730d1cf558fb55088"
5869+
checksum = "4f87f8e14e776762e07927c27c2054d2cf678aab9aae2d431a79b3e31e4dd391"
58705870
dependencies = [
58715871
"wast",
58725872
]
@@ -6143,9 +6143,9 @@ dependencies = [
61436143

61446144
[[package]]
61456145
name = "wit-component"
6146-
version = "0.217.0"
6146+
version = "0.218.0"
61476147
source = "registry+https://github.com/rust-lang/crates.io-index"
6148-
checksum = "d7117809905e49db716d81e794f79590c052bf2fdbbcda1731ca0fb28f6f3ddf"
6148+
checksum = "aa53aa7e6bf2b3e8ccaffbcc963fbdb672a603dc0af393a481b6cec24c266406"
61496149
dependencies = [
61506150
"anyhow",
61516151
"bitflags 2.6.0",
@@ -6154,17 +6154,17 @@ dependencies = [
61546154
"serde",
61556155
"serde_derive",
61566156
"serde_json",
6157-
"wasm-encoder 0.217.0",
6157+
"wasm-encoder 0.218.0",
61586158
"wasm-metadata",
6159-
"wasmparser 0.217.0",
6159+
"wasmparser 0.218.0",
61606160
"wit-parser",
61616161
]
61626162

61636163
[[package]]
61646164
name = "wit-parser"
6165-
version = "0.217.0"
6165+
version = "0.218.0"
61666166
source = "registry+https://github.com/rust-lang/crates.io-index"
6167-
checksum = "fb893dcd6d370cfdf19a0d9adfcd403efb8e544e1a0ea3a8b81a21fe392eaa78"
6167+
checksum = "0d3d1066ab761b115f97fef2b191090faabcb0f37b555b758d3caf42d4ed9e55"
61686168
dependencies = [
61696169
"anyhow",
61706170
"id-arena",
@@ -6175,7 +6175,7 @@ dependencies = [
61756175
"serde_derive",
61766176
"serde_json",
61776177
"unicode-xid",
6178-
"wasmparser 0.217.0",
6178+
"wasmparser 0.218.0",
61796179
]
61806180

61816181
[[package]]

compiler/rustc_codegen_gcc/src/asm.rs

+8
Original file line numberDiff line numberDiff line change
@@ -682,6 +682,11 @@ fn reg_to_gcc(reg: InlineAsmRegOrRegClass) -> ConstraintOrRegister {
682682
InlineAsmRegClass::S390x(S390xInlineAsmRegClass::reg) => "r",
683683
InlineAsmRegClass::S390x(S390xInlineAsmRegClass::reg_addr) => "a",
684684
InlineAsmRegClass::S390x(S390xInlineAsmRegClass::freg) => "f",
685+
InlineAsmRegClass::S390x(
686+
S390xInlineAsmRegClass::vreg | S390xInlineAsmRegClass::areg,
687+
) => {
688+
unreachable!("clobber-only")
689+
}
685690
InlineAsmRegClass::Err => unreachable!(),
686691
},
687692
};
@@ -757,6 +762,9 @@ fn dummy_output_type<'gcc, 'tcx>(cx: &CodegenCx<'gcc, 'tcx>, reg: InlineAsmRegCl
757762
S390xInlineAsmRegClass::reg | S390xInlineAsmRegClass::reg_addr,
758763
) => cx.type_i32(),
759764
InlineAsmRegClass::S390x(S390xInlineAsmRegClass::freg) => cx.type_f64(),
765+
InlineAsmRegClass::S390x(S390xInlineAsmRegClass::vreg | S390xInlineAsmRegClass::areg) => {
766+
unreachable!("clobber-only")
767+
}
760768
InlineAsmRegClass::Msp430(Msp430InlineAsmRegClass::reg) => cx.type_i16(),
761769
InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg) => cx.type_i32(),
762770
InlineAsmRegClass::M68k(M68kInlineAsmRegClass::reg_addr) => cx.type_i32(),

compiler/rustc_codegen_llvm/src/asm.rs

+6
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,9 @@ fn reg_to_llvm(reg: InlineAsmRegOrRegClass, layout: Option<&TyAndLayout<'_>>) ->
708708
S390x(S390xInlineAsmRegClass::reg) => "r",
709709
S390x(S390xInlineAsmRegClass::reg_addr) => "a",
710710
S390x(S390xInlineAsmRegClass::freg) => "f",
711+
S390x(S390xInlineAsmRegClass::vreg | S390xInlineAsmRegClass::areg) => {
712+
unreachable!("clobber-only")
713+
}
711714
Msp430(Msp430InlineAsmRegClass::reg) => "r",
712715
M68k(M68kInlineAsmRegClass::reg) => "r",
713716
M68k(M68kInlineAsmRegClass::reg_addr) => "a",
@@ -866,6 +869,9 @@ fn dummy_output_type<'ll>(cx: &CodegenCx<'ll, '_>, reg: InlineAsmRegClass) -> &'
866869
Avr(AvrInlineAsmRegClass::reg_ptr) => cx.type_i16(),
867870
S390x(S390xInlineAsmRegClass::reg | S390xInlineAsmRegClass::reg_addr) => cx.type_i32(),
868871
S390x(S390xInlineAsmRegClass::freg) => cx.type_f64(),
872+
S390x(S390xInlineAsmRegClass::vreg | S390xInlineAsmRegClass::areg) => {
873+
unreachable!("clobber-only")
874+
}
869875
Msp430(Msp430InlineAsmRegClass::reg) => cx.type_i16(),
870876
M68k(M68kInlineAsmRegClass::reg) => cx.type_i32(),
871877
M68k(M68kInlineAsmRegClass::reg_addr) => cx.type_i32(),

compiler/rustc_span/src/symbol.rs

+1
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ symbols! {
411411
arbitrary_enum_discriminant,
412412
arbitrary_self_types,
413413
arbitrary_self_types_pointers,
414+
areg,
414415
args,
415416
arith_offset,
416417
arm,

compiler/rustc_target/src/asm/mod.rs

+28-1
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ impl InlineAsmReg {
439439
Self::Hexagon(r) => r.overlapping_regs(|r| cb(Self::Hexagon(r))),
440440
Self::LoongArch(_) => cb(self),
441441
Self::Mips(_) => cb(self),
442-
Self::S390x(_) => cb(self),
442+
Self::S390x(r) => r.overlapping_regs(|r| cb(Self::S390x(r))),
443443
Self::Bpf(r) => r.overlapping_regs(|r| cb(Self::Bpf(r))),
444444
Self::Avr(r) => r.overlapping_regs(|r| cb(Self::Avr(r))),
445445
Self::Msp430(_) => cb(self),
@@ -892,6 +892,7 @@ pub enum InlineAsmClobberAbi {
892892
AArch64NoX18,
893893
RiscV,
894894
LoongArch,
895+
S390x,
895896
}
896897

897898
impl InlineAsmClobberAbi {
@@ -941,6 +942,10 @@ impl InlineAsmClobberAbi {
941942
"C" | "system" => Ok(InlineAsmClobberAbi::LoongArch),
942943
_ => Err(&["C", "system"]),
943944
},
945+
InlineAsmArch::S390x => match name {
946+
"C" | "system" => Ok(InlineAsmClobberAbi::S390x),
947+
_ => Err(&["C", "system"]),
948+
},
944949
_ => Err(&[]),
945950
}
946951
}
@@ -1098,6 +1103,28 @@ impl InlineAsmClobberAbi {
10981103
f16, f17, f18, f19, f20, f21, f22, f23,
10991104
}
11001105
},
1106+
InlineAsmClobberAbi::S390x => clobbered_regs! {
1107+
S390x S390xInlineAsmReg {
1108+
r0, r1, r2, r3, r4, r5,
1109+
r14,
1110+
1111+
// f0-f7, v0-v7
1112+
f0, f1, f2, f3, f4, f5, f6, f7,
1113+
v0, v1, v2, v3, v4, v5, v6, v7,
1114+
1115+
// Technically the left halves of v8-v15 (i.e., f8-f15) are saved, but
1116+
// we have no way of expressing this using clobbers.
1117+
v8, v9, v10, v11, v12, v13, v14, v15,
1118+
1119+
// Other vector registers are volatile
1120+
v16, v17, v18, v19, v20, v21, v22, v23,
1121+
v24, v25, v26, v27, v28, v29, v30, v31,
1122+
1123+
// a0-a1 are reserved, other access registers are volatile
1124+
a2, a3, a4, a5, a6, a7,
1125+
a8, a9, a10, a11, a12, a13, a14, a15,
1126+
}
1127+
},
11011128
}
11021129
}
11031130
}

compiler/rustc_target/src/asm/s390x.rs

+100-11
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ def_reg_class! {
99
reg,
1010
reg_addr,
1111
freg,
12+
vreg,
13+
areg,
1214
}
1315
}
1416

@@ -35,11 +37,13 @@ impl S390xInlineAsmRegClass {
3537

3638
pub fn supported_types(
3739
self,
38-
arch: InlineAsmArch,
40+
_arch: InlineAsmArch,
3941
) -> &'static [(InlineAsmType, Option<Symbol>)] {
40-
match (self, arch) {
41-
(Self::reg | Self::reg_addr, _) => types! { _: I8, I16, I32, I64; },
42-
(Self::freg, _) => types! { _: F32, F64; },
42+
match self {
43+
Self::reg | Self::reg_addr => types! { _: I8, I16, I32, I64; },
44+
Self::freg => types! { _: F32, F64; },
45+
Self::vreg => &[],
46+
Self::areg => &[],
4347
}
4448
}
4549
}
@@ -76,6 +80,52 @@ def_regs! {
7680
f13: freg = ["f13"],
7781
f14: freg = ["f14"],
7882
f15: freg = ["f15"],
83+
v0: vreg = ["v0"],
84+
v1: vreg = ["v1"],
85+
v2: vreg = ["v2"],
86+
v3: vreg = ["v3"],
87+
v4: vreg = ["v4"],
88+
v5: vreg = ["v5"],
89+
v6: vreg = ["v6"],
90+
v7: vreg = ["v7"],
91+
v8: vreg = ["v8"],
92+
v9: vreg = ["v9"],
93+
v10: vreg = ["v10"],
94+
v11: vreg = ["v11"],
95+
v12: vreg = ["v12"],
96+
v13: vreg = ["v13"],
97+
v14: vreg = ["v14"],
98+
v15: vreg = ["v15"],
99+
v16: vreg = ["v16"],
100+
v17: vreg = ["v17"],
101+
v18: vreg = ["v18"],
102+
v19: vreg = ["v19"],
103+
v20: vreg = ["v20"],
104+
v21: vreg = ["v21"],
105+
v22: vreg = ["v22"],
106+
v23: vreg = ["v23"],
107+
v24: vreg = ["v24"],
108+
v25: vreg = ["v25"],
109+
v26: vreg = ["v26"],
110+
v27: vreg = ["v27"],
111+
v28: vreg = ["v28"],
112+
v29: vreg = ["v29"],
113+
v30: vreg = ["v30"],
114+
v31: vreg = ["v31"],
115+
a2: areg = ["a2"],
116+
a3: areg = ["a3"],
117+
a4: areg = ["a4"],
118+
a5: areg = ["a5"],
119+
a6: areg = ["a6"],
120+
a7: areg = ["a7"],
121+
a8: areg = ["a8"],
122+
a9: areg = ["a9"],
123+
a10: areg = ["a10"],
124+
a11: areg = ["a11"],
125+
a12: areg = ["a12"],
126+
a13: areg = ["a13"],
127+
a14: areg = ["a14"],
128+
a15: areg = ["a15"],
79129
#error = ["r11"] =>
80130
"The frame pointer cannot be used as an operand for inline asm",
81131
#error = ["r15"] =>
@@ -87,13 +137,8 @@ def_regs! {
87137
"c12", "c13", "c14", "c15"
88138
] =>
89139
"control registers are reserved by the kernel and cannot be used as operands for inline asm",
90-
#error = [
91-
"a0", "a1", "a2", "a3",
92-
"a4", "a5", "a6", "a7",
93-
"a8", "a9", "a10", "a11",
94-
"a12", "a13", "a14", "a15"
95-
] =>
96-
"access registers are not supported and cannot be used as operands for inline asm",
140+
#error = ["a0", "a1"] =>
141+
"a0 and a1 are reserved for system use and cannot be used as operands for inline asm",
97142
}
98143
}
99144

@@ -106,4 +151,48 @@ impl S390xInlineAsmReg {
106151
) -> fmt::Result {
107152
write!(out, "%{}", self.name())
108153
}
154+
155+
pub fn overlapping_regs(self, mut cb: impl FnMut(S390xInlineAsmReg)) {
156+
macro_rules! reg_conflicts {
157+
(
158+
$(
159+
$full:ident : $($field:ident)*
160+
),*;
161+
) => {
162+
match self {
163+
$(
164+
Self::$full => {
165+
cb(Self::$full);
166+
$(cb(Self::$field);)*
167+
}
168+
$(Self::$field)|* => {
169+
cb(Self::$full);
170+
cb(self);
171+
}
172+
)*
173+
r => cb(r),
174+
}
175+
};
176+
}
177+
178+
// The left halves of v0-v15 are aliased to f0-f15.
179+
reg_conflicts! {
180+
v0 : f0,
181+
v1 : f1,
182+
v2 : f2,
183+
v3 : f3,
184+
v4 : f4,
185+
v5 : f5,
186+
v6 : f6,
187+
v7 : f7,
188+
v8 : f8,
189+
v9 : f9,
190+
v10 : f10,
191+
v11 : f11,
192+
v12 : f12,
193+
v13 : f13,
194+
v14 : f14,
195+
v15 : f15;
196+
}
197+
}
109198
}

0 commit comments

Comments
 (0)