1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 use std::unstable::simd::{i32x4, f32x4};
13 fn test_int(e: i32) -> i32 {
14 let v = i32x4(e, 0i32, 0i32, 0i32);
15 let i32x4(e2, _, _, _) = v * v + v - v;
19 fn test_float(e: f32) -> f32 {
20 let v = f32x4(e, 0f32, 0f32, 0f32);
21 let f32x4(e2, _, _, _) = v * v + v - v;
26 assert_eq!(test_int(3i32), 9i32);
27 assert_eq!(test_float(3f32), 9f32);