Skip to content

Commit 9e79db6

Browse files
folkertdevsayantn
authored andcommitted
make funnel shifts work
1 parent d64fba9 commit 9e79db6

File tree

5 files changed

+15
-0
lines changed

5 files changed

+15
-0
lines changed

compiler/rustc_hir_analysis/src/check/intrinsic.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ fn intrinsic_operation_unsafety(tcx: TyCtxt<'_>, intrinsic_id: LocalDefId) -> hi
8585
| sym::saturating_sub
8686
| sym::rotate_left
8787
| sym::rotate_right
88+
| sym::funnel_shl
89+
| sym::funnel_shr
8890
| sym::ctpop
8991
| sym::ctlz
9092
| sym::cttz

library/core/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,7 @@
156156
#![feature(f128)]
157157
#![feature(freeze_impls)]
158158
#![feature(fundamental)]
159+
#![feature(funnel_shifts)]
159160
#![feature(if_let_guard)]
160161
#![feature(intra_doc_pointers)]
161162
#![feature(intrinsics)]

library/core/src/num/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1222,6 +1222,9 @@ impl usize {
12221222
rot = 4,
12231223
rot_op = "0xa003",
12241224
rot_result = "0x3a",
1225+
fsh_op = "0x2fe78e45983acd98039000008736273",
1226+
fshl_result = "0x4f7602fe",
1227+
fshr_result = "0x4f7602fe78e45983acd9803900000873",
12251228
swap_op = "0x1234",
12261229
swapped = "0x3412",
12271230
reversed = "0x2c48",
@@ -1246,6 +1249,9 @@ impl usize {
12461249
rot = 8,
12471250
rot_op = "0x10000b3",
12481251
rot_result = "0xb301",
1252+
fsh_op = "0x2fe78e45",
1253+
fshl_result = "0xb32f",
1254+
fshr_result = "0xb32fe78e",
12491255
swap_op = "0x12345678",
12501256
swapped = "0x78563412",
12511257
reversed = "0x1e6a2c48",
@@ -1270,6 +1276,9 @@ impl usize {
12701276
rot = 12,
12711277
rot_op = "0xaa00000000006e1",
12721278
rot_result = "0x6e10aa",
1279+
fsh_op = "0x2fe78e45983acd98",
1280+
fshl_result = "0x6e12fe",
1281+
fshr_result = "0x6e12fe78e45983ac",
12731282
swap_op = "0x1234567890123456",
12741283
swapped = "0x5634129078563412",
12751284
reversed = "0x6a2c48091e6a2c48",

library/core/src/num/uint_macros.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,7 @@ macro_rules! uint_impl {
391391
/// Basic usage:
392392
///
393393
/// ```
394+
/// #![feature(funnel_shifts)]
394395
#[doc = concat!("let a = ", $rot_op, stringify!($SelfT), ";")]
395396
#[doc = concat!("let b = ", $fsh_op, stringify!($SelfT), ";")]
396397
#[doc = concat!("let m = ", $fshl_result, ";")]
@@ -419,6 +420,7 @@ macro_rules! uint_impl {
419420
/// Basic usage:
420421
///
421422
/// ```
423+
/// #![feature(funnel_shifts)]
422424
#[doc = concat!("let a = ", $rot_op, stringify!($SelfT), ";")]
423425
#[doc = concat!("let b = ", $fsh_op, stringify!($SelfT), ";")]
424426
#[doc = concat!("let m = ", $fshr_result, ";")]

library/std/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,7 @@
296296
#![feature(f128)]
297297
#![feature(ffi_const)]
298298
#![feature(formatting_options)]
299+
#![feature(funnel_shifts)]
299300
#![feature(hash_map_internals)]
300301
#![feature(hash_map_macro)]
301302
#![feature(if_let_guard)]

0 commit comments

Comments
 (0)