File tree 2 files changed +50
-0
lines changed
src/tests/JIT/Regression/JitBlue/ImageSharp_2117 2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ // Licensed to the .NET Foundation under one or more agreements.
2
+ // The .NET Foundation licenses this file to you under the MIT license.
3
+
4
+ using System . Runtime . Intrinsics ;
5
+ using System . Runtime . Intrinsics . X86 ;
6
+
7
+ public unsafe class ImageSharp_2117
8
+ {
9
+ public static int Main ( string [ ] args )
10
+ {
11
+ if ( Sse . IsSupported )
12
+ {
13
+ Vector128 < float > fnan = Vector128 . Create ( float . NaN ) ;
14
+ Vector128 < float > res1 = Sse . Max ( Sse . LoadVector128 ( ( float * ) ( & fnan ) ) , Vector128 < float > . Zero ) ;
15
+ Vector128 < float > res2 = Sse . Min ( Sse . LoadVector128 ( ( float * ) ( & fnan ) ) , Vector128 < float > . Zero ) ;
16
+
17
+ if ( float . IsNaN ( res1 [ 0 ] ) || float . IsNaN ( res2 [ 0 ] ) )
18
+ {
19
+ return 0 ;
20
+ }
21
+ }
22
+
23
+ if ( Sse2 . IsSupported )
24
+ {
25
+ Vector128 < double > dnan = Vector128 . Create ( double . NaN ) ;
26
+ Vector128 < double > res3 = Sse2 . Max ( Sse2 . LoadVector128 ( ( double * ) ( & dnan ) ) , Vector128 < double > . Zero ) ;
27
+ Vector128 < double > res4 = Sse2 . Min ( Sse2 . LoadVector128 ( ( double * ) ( & dnan ) ) , Vector128 < double > . Zero ) ;
28
+
29
+ if ( double . IsNaN ( res3 [ 0 ] ) || double . IsNaN ( res4 [ 0 ] ) )
30
+ {
31
+ return 0 ;
32
+ }
33
+ }
34
+
35
+ return 100 ;
36
+ }
37
+ }
Original file line number Diff line number Diff line change
1
+ <Project Sdk =" Microsoft.NET.Sdk" >
2
+ <PropertyGroup >
3
+ <OutputType >Exe</OutputType >
4
+ <AllowUnsafeBlocks >True</AllowUnsafeBlocks >
5
+ </PropertyGroup >
6
+ <PropertyGroup >
7
+ <DebugType >None</DebugType >
8
+ <Optimize >True</Optimize >
9
+ </PropertyGroup >
10
+ <ItemGroup >
11
+ <Compile Include =" $(MSBuildProjectName).cs" />
12
+ </ItemGroup >
13
+ </Project >
You can’t perform that action at this time.
0 commit comments