Updated several files to use rust intrinsic macros instead of the legacy extern "rust-intrinsic" blocks
This commit is contained in:
parent
1f81f90689
commit
c79fc90e9a
29 changed files with 61 additions and 85 deletions
|
@ -1,4 +1,5 @@
|
|||
//! Codegen of intrinsics. This includes `extern "rust-intrinsic"`,
|
||||
//! functions marked with the `#[rustc_intrinsic]` attribute
|
||||
//! and LLVM intrinsics that have symbol names starting with `llvm.`.
|
||||
|
||||
macro_rules! intrinsic_args {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn copy_nonoverlapping<T>(_src: *const T, _dst: *mut T, _count: usize);
|
||||
|
||||
fn main() {
|
||||
let mut data = [0u8; 16];
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn copy_nonoverlapping<T>(src: *const T, dst: *mut T, count: usize);
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn copy_nonoverlapping<T>(_src: *const T, _dst: *mut T, _count: usize);
|
||||
|
||||
fn main() {
|
||||
let mut data = [0u16; 8];
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
mod rusti {
|
||||
extern "rust-intrinsic" {
|
||||
pub fn ctlz_nonzero<T>(x: T) -> u32;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
pub unsafe fn ctlz_nonzero<T>(_x: T) -> u32;
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
|
||||
#![feature(intrinsics)]
|
||||
|
||||
mod rusti {
|
||||
extern "rust-intrinsic" {
|
||||
pub fn cttz_nonzero<T>(x: T) -> u32;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
pub unsafe fn cttz_nonzero<T>(_x: T) -> u32;
|
||||
}
|
||||
|
||||
pub fn main() {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
#![feature(intrinsics)]
|
||||
|
||||
// Directly call intrinsic to avoid debug assertions in libstd
|
||||
extern "rust-intrinsic" {
|
||||
fn float_to_int_unchecked<Float: Copy, Int: Copy>(value: Float) -> Int;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
unsafe fn float_to_int_unchecked<Float: Copy, Int: Copy>(_value: Float) -> Int;
|
||||
|
||||
fn main() {
|
||||
unsafe {
|
||||
|
|
|
@ -14,10 +14,9 @@ use std::ptr;
|
|||
use std::simd::StdFloat;
|
||||
use std::simd::prelude::*;
|
||||
|
||||
extern "rust-intrinsic" {
|
||||
#[rustc_nounwind]
|
||||
pub fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(x: T, y: T) -> U;
|
||||
}
|
||||
#[rustc_intrinsic]
|
||||
#[rustc_nounwind]
|
||||
pub unsafe fn simd_shuffle_generic<T, U, const IDX: &'static [u32]>(_x: T, _y: T) -> U;
|
||||
|
||||
fn simd_ops_f32() {
|
||||
let a = f32x4::splat(10.0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue