Logo
Explore Help
Register Sign In
rust-lang/rust
1
0
Fork 0
You've already forked rust
Code Issues Pull Requests Actions 1 Packages Projects Releases Wiki Activity
Files
52f833a254ddfa786f34944bc31c205b51e28ecb
rust/library/core/tests/simd.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
236 B
Rust
Raw Normal View History

Test core::simd works These tests just verify some basic APIs of core::simd function, and guarantees that attempting to access the wrong things doesn't work. The majority of tests are stochastic, and so remain upstream, but a few deterministic tests arrive in the subtree as doc tests.
2021-10-22 00:47:12 -07:00
use core::simd::f32x4;
#[test]
fn testing() {
let x = f32x4::from_array([1.0, 1.0, 1.0, 1.0]);
let y = -x;
Force splatting in SIMD test
2021-12-02 19:22:00 -08:00
let h = x * f32x4::splat(0.5);
Test core::simd works These tests just verify some basic APIs of core::simd function, and guarantees that attempting to access the wrong things doesn't work. The majority of tests are stochastic, and so remain upstream, but a few deterministic tests arrive in the subtree as doc tests.
2021-10-22 00:47:12 -07:00
let r = y.abs();
assert_eq!(x, r);
assert_eq!(h, f32x4::splat(0.5));
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.24.6 Page: 166ms Template: 4ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API