Skip to content

Commit 510c996

Browse files
onestackedintel-lab-lkp
authored andcommitted
rust: remove x86 panicking intrinsics.
This removes the panicking implementation of the x86 intrinsics. This requires a PR [0] for the rust core library to remove the need for the `__udivti3` intrinsic. This PR disables formatting support for the `i/u128` rust primitives when the `no_iu128_fmt` config option is set. In order to remove the need for the other intrinsics a recent rust version is required (Tested with 1.84). Link: rust-lang/rust#136385 [0] Signed-off-by: Christian Schrefl <[email protected]>
1 parent ffd294d commit 510c996

File tree

2 files changed

+2
-50
lines changed

2 files changed

+2
-50
lines changed

rust/Makefile

+1-14
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ rustdoc_test_kernel_quiet=>/dev/null
5353
endif
5454

5555
core-cfgs = \
56-
--cfg no_fp_fmt_parse
56+
--cfg no_fp_fmt_parse --cfg no_iu128_fmt
5757

5858
quiet_cmd_rustdoc = RUSTDOC $(if $(rustdoc_host),H, ) $<
5959
cmd_rustdoc = \
@@ -388,19 +388,6 @@ rust-analyzer:
388388
$(rustc_sysroot) $(RUST_LIB_SRC) $(if $(KBUILD_EXTMOD),$(srcroot)) \
389389
> rust-project.json
390390

391-
redirect-intrinsics = \
392-
__addsf3 __eqsf2 __extendsfdf2 __gesf2 __lesf2 __ltsf2 __mulsf3 __nesf2 __truncdfsf2 __unordsf2 \
393-
__adddf3 __eqdf2 __ledf2 __ltdf2 __muldf3 __unorddf2 \
394-
__muloti4 __multi3 \
395-
__udivmodti4 __udivti3 __umodti3
396-
397-
ifneq ($(or $(CONFIG_ARM64),$(and $(CONFIG_RISCV),$(CONFIG_64BIT))),)
398-
# These intrinsics are defined for ARM64 and RISCV64
399-
redirect-intrinsics += \
400-
__ashrti3 \
401-
__ashlti3 __lshrti3
402-
endif
403-
404391
define rule_rustc_library
405392
$(call cmd_and_fixdep,rustc_library)
406393
$(call cmd,gen_objtooldep)

rust/compiler_builtins.rs

+1-36
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#![no_builtins]
2626
#![no_std]
2727

28+
#[expect(unused_macros)]
2829
macro_rules! define_panicking_intrinsics(
2930
($reason: tt, { $($ident: ident, )* }) => {
3031
$(
@@ -37,41 +38,5 @@ macro_rules! define_panicking_intrinsics(
3738
}
3839
);
3940

40-
define_panicking_intrinsics!("`f32` should not be used", {
41-
__addsf3,
42-
__eqsf2,
43-
__extendsfdf2,
44-
__gesf2,
45-
__lesf2,
46-
__ltsf2,
47-
__mulsf3,
48-
__nesf2,
49-
__truncdfsf2,
50-
__unordsf2,
51-
});
52-
53-
define_panicking_intrinsics!("`f64` should not be used", {
54-
__adddf3,
55-
__eqdf2,
56-
__ledf2,
57-
__ltdf2,
58-
__muldf3,
59-
__unorddf2,
60-
});
61-
62-
define_panicking_intrinsics!("`i128` should not be used", {
63-
__ashrti3,
64-
__muloti4,
65-
__multi3,
66-
});
67-
68-
define_panicking_intrinsics!("`u128` should not be used", {
69-
__ashlti3,
70-
__lshrti3,
71-
__udivmodti4,
72-
__udivti3,
73-
__umodti3,
74-
});
75-
7641
// NOTE: if you are adding a new intrinsic here, you should also add it to
7742
// `redirect-intrinsics` in `rust/Makefile`.

0 commit comments

Comments
 (0)