1 // Copyright 2015 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 #![feature(repr_simd, platform_intrinsics)]
14 struct A(i16, i16, i16, i16, i16, i16, i16, i16);
16 struct B(i16, i16, i16, i16, i16, i16, i16, i16);
18 // each intrinsic definition has to use the same nominal type for any
19 // vector structure throughout that declaration (i.e., every instance
20 // of i16x8 in each `fn ...;` needs to be either A or B)
22 extern "platform-intrinsic" {
23 fn x86_mm_adds_epi16(x: A, y: A) -> B;
24 //~^ ERROR intrinsic return value has wrong type: found `B`, expected `A`
25 fn x86_mm_subs_epi16(x: A, y: B) -> A;
26 //~^ ERROR intrinsic argument 2 has wrong type: found `B`, expected `A`
29 fn x86_mm_max_epi16(x: B, y: B) -> B;
30 fn x86_mm_min_epi16(x: A, y: A) -> A;