]>
git.proxmox.com Git - rustc.git/blob - src/test/compile-fail/simd-intrinsic-declaration-type.rs
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 i16x8(i16, i16, i16, i16, i16, i16, i16, i16);
16 struct u16x8(u16, u16, u16, u16, u16, u16, u16, u16);
19 struct i8x16(i8, i8, i8, i8, i8, i8, i8, i8,
20 i8, i8, i8, i8, i8, i8, i8, i8);
22 struct i32x4(i32, i32, i32, i32);
24 struct f32x4(f32, f32, f32, f32);
26 struct i64x2(i64, i64);
28 // correct signatures work well
31 extern "platform-intrinsic" {
32 fn x86_mm_adds_epi16(x
: i16x8
, y
: i16x8
) -> i16x8
;
33 fn x86_mm_adds_epu16(x
: u16x8
, y
: u16x8
) -> u16x8
;
36 // but incorrect ones don't.
41 extern "platform-intrinsic" {
42 fn x86_mm_adds_epi16(x
: u16x8
, y
: u16x8
) -> u16x8
;
43 //~^ ERROR intrinsic argument 1 has wrong type
44 //~^^ ERROR intrinsic argument 2 has wrong type
45 //~^^^ ERROR intrinsic return value has wrong type
46 fn x86_mm_adds_epu16(x
: i16x8
, y
: i16x8
) -> i16x8
;
47 //~^ ERROR intrinsic argument 1 has wrong type
48 //~^^ ERROR intrinsic argument 2 has wrong type
49 //~^^^ ERROR intrinsic return value has wrong type
53 extern "platform-intrinsic" {
54 fn x86_mm_adds_epi16(x
: i8x16
, y
: i32x4
) -> i64x2
;
55 //~^ ERROR intrinsic argument 1 has wrong type
56 //~^^ ERROR intrinsic argument 2 has wrong type
57 //~^^^ ERROR intrinsic return value has wrong type
59 // and so does int vs. float:
60 extern "platform-intrinsic" {
61 fn x86_mm_max_ps(x
: i32x4
, y
: i32x4
) -> i32x4
;
62 //~^ ERROR intrinsic argument 1 has wrong type
63 //~^^ ERROR intrinsic argument 2 has wrong type
64 //~^^^ ERROR intrinsic return value has wrong type