Skip to content

Commit 9ea9a3b

Browse files
committed
Merge from rustc
2 parents 9e28f11 + 2cf1d43 commit 9ea9a3b

File tree

2 files changed

+47
-7
lines changed

2 files changed

+47
-7
lines changed

core/src/intrinsics/simd.rs

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,40 @@ pub unsafe fn simd_shl<T>(lhs: T, rhs: T) -> T;
126126
#[rustc_nounwind]
127127
pub unsafe fn simd_shr<T>(lhs: T, rhs: T) -> T;
128128

129+
/// Funnel Shifts vector left elementwise, with UB on overflow.
130+
///
131+
/// Concatenates `a` and `b` elementwise (with `a` in the most significant half),
132+
/// creating a vector of the same length, but with each element being twice as
133+
/// wide. Then shift this vector left elementwise by `shift`, shifting in zeros,
134+
/// and extract the most significant half of each of the elements. If `a` and `b`
135+
/// are the same, this is equivalent to an elementwise rotate left operation.
136+
///
137+
/// `T` must be a vector of integers.
138+
///
139+
/// # Safety
140+
///
141+
/// Each element of `shift` must be less than `<int>::BITS`.
142+
#[rustc_intrinsic]
143+
#[rustc_nounwind]
144+
pub unsafe fn simd_funnel_shl<T>(a: T, b: T, shift: T) -> T;
145+
146+
/// Funnel Shifts vector right elementwise, with UB on overflow.
147+
///
148+
/// Concatenates `a` and `b` elementwise (with `a` in the most significant half),
149+
/// creating a vector of the same length, but with each element being twice as
150+
/// wide. Then shift this vector right elementwise by `shift`, shifting in zeros,
151+
/// and extract the least significant half of each of the elements. If `a` and `b`
152+
/// are the same, this is equivalent to an elementwise rotate right operation.
153+
///
154+
/// `T` must be a vector of integers.
155+
///
156+
/// # Safety
157+
///
158+
/// Each element of `shift` must be less than `<int>::BITS`.
159+
#[rustc_intrinsic]
160+
#[rustc_nounwind]
161+
pub unsafe fn simd_funnel_shr<T>(a: T, b: T, shift: T) -> T;
162+
129163
/// "Ands" vectors elementwise.
130164
///
131165
/// `T` must be a vector of integers.
@@ -678,6 +712,14 @@ pub unsafe fn simd_floor<T>(x: T) -> T;
678712
#[rustc_nounwind]
679713
pub unsafe fn simd_round<T>(x: T) -> T;
680714

715+
/// Rounds each element to the closest integer-valued float.
716+
/// Ties are resolved by rounding to the number with an even least significant digit
717+
///
718+
/// `T` must be a vector of floats.
719+
#[rustc_intrinsic]
720+
#[rustc_nounwind]
721+
pub unsafe fn simd_round_ties_even<T>(x: T) -> T;
722+
681723
/// Returns the integer part of each element as an integer-valued float.
682724
/// In other words, non-integer values are truncated towards zero.
683725
///

std/src/os/unix/fs.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -408,24 +408,22 @@ pub trait OpenOptionsExt {
408408
/// Pass custom flags to the `flags` argument of `open`.
409409
///
410410
/// The bits that define the access mode are masked out with `O_ACCMODE`, to
411-
/// ensure they do not interfere with the access mode set by Rusts options.
411+
/// ensure they do not interfere with the access mode set by Rust's options.
412412
///
413-
/// Custom flags can only set flags, not remove flags set by Rusts options.
414-
/// This options overwrites any previously set custom flags.
413+
/// Custom flags can only set flags, not remove flags set by Rust's options.
414+
/// This function overwrites any previously-set custom flags.
415415
///
416416
/// # Examples
417417
///
418418
/// ```no_run
419-
/// # #![feature(rustc_private)]
419+
/// # mod libc { pub const O_NOFOLLOW: i32 = 0; }
420420
/// use std::fs::OpenOptions;
421421
/// use std::os::unix::fs::OpenOptionsExt;
422422
///
423423
/// # fn main() {
424424
/// let mut options = OpenOptions::new();
425425
/// options.write(true);
426-
/// if cfg!(unix) {
427-
/// options.custom_flags(libc::O_NOFOLLOW);
428-
/// }
426+
/// options.custom_flags(libc::O_NOFOLLOW);
429427
/// let file = options.open("foo.txt");
430428
/// # }
431429
/// ```

0 commit comments

Comments
 (0)