]> git.lizzy.rs Git - rust.git/blob - src/test/codegen/simd-intrinsic/simd-intrinsic-float-minmax.rs
resolve: Remove an incorrect assert
[rust.git] / src / test / codegen / simd-intrinsic / simd-intrinsic-float-minmax.rs
1 // min-llvm-version 7.0
2
3 // compile-flags: -C no-prepopulate-passes
4
5 #![crate_type = "lib"]
6
7 #![feature(repr_simd, platform_intrinsics)]
8 #![allow(non_camel_case_types)]
9
10 #[repr(simd)]
11 #[derive(Copy, Clone, PartialEq, Debug)]
12 pub struct f32x4(pub f32, pub f32, pub f32, pub f32);
13
14 extern "platform-intrinsic" {
15     fn simd_fmin<T>(x: T, y: T) -> T;
16     fn simd_fmax<T>(x: T, y: T) -> T;
17 }
18
19 // CHECK-LABEL: @fmin
20 #[no_mangle]
21 pub unsafe fn fmin(a: f32x4, b: f32x4) -> f32x4 {
22     // CHECK: call <4 x float> @llvm.minnum.v4f32
23     simd_fmin(a, b)
24 }
25
26 // CHECK-LABEL: @fmax
27 #[no_mangle]
28 pub unsafe fn fmax(a: f32x4, b: f32x4) -> f32x4 {
29     // CHECK: call <4 x float> @llvm.maxnum.v4f32
30     simd_fmax(a, b)
31 }