| Tom Stellard | 49f8bfd | 2015-01-06 18:00:21 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | 
|  | 2 | ; RUN: llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s | 
| Marek Olsak | 7517077 | 2015-01-27 17:27:15 +0000 | [diff] [blame] | 3 | ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | 
| Matt Arsenault | 692bd5e | 2014-06-18 22:03:45 +0000 | [diff] [blame] | 4 |  | 
|  | 5 | ; This should have the exactly the same output as the test for rint, | 
|  | 6 | ; so no need to check anything. | 
|  | 7 |  | 
|  | 8 | declare float @llvm.nearbyint.f32(float) #0 | 
|  | 9 | declare <2 x float> @llvm.nearbyint.v2f32(<2 x float>) #0 | 
|  | 10 | declare <4 x float> @llvm.nearbyint.v4f32(<4 x float>) #0 | 
|  | 11 | declare double @llvm.nearbyint.f64(double) #0 | 
|  | 12 | declare <2 x double> @llvm.nearbyint.v2f64(<2 x double>) #0 | 
|  | 13 | declare <4 x double> @llvm.nearbyint.v4f64(<4 x double>) #0 | 
|  | 14 |  | 
|  | 15 |  | 
|  | 16 | define void @fnearbyint_f32(float addrspace(1)* %out, float %in) #1 { | 
|  | 17 | entry: | 
|  | 18 | %0 = call float @llvm.nearbyint.f32(float %in) | 
|  | 19 | store float %0, float addrspace(1)* %out | 
|  | 20 | ret void | 
|  | 21 | } | 
|  | 22 |  | 
|  | 23 | define void @fnearbyint_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %in) #1 { | 
|  | 24 | entry: | 
|  | 25 | %0 = call <2 x float> @llvm.nearbyint.v2f32(<2 x float> %in) | 
|  | 26 | store <2 x float> %0, <2 x float> addrspace(1)* %out | 
|  | 27 | ret void | 
|  | 28 | } | 
|  | 29 |  | 
|  | 30 | define void @fnearbyint_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %in) #1 { | 
|  | 31 | entry: | 
|  | 32 | %0 = call <4 x float> @llvm.nearbyint.v4f32(<4 x float> %in) | 
|  | 33 | store <4 x float> %0, <4 x float> addrspace(1)* %out | 
|  | 34 | ret void | 
|  | 35 | } | 
|  | 36 |  | 
|  | 37 | define void @nearbyint_f64(double addrspace(1)* %out, double %in) { | 
|  | 38 | entry: | 
|  | 39 | %0 = call double @llvm.nearbyint.f64(double %in) | 
|  | 40 | store double %0, double addrspace(1)* %out | 
|  | 41 | ret void | 
|  | 42 | } | 
|  | 43 | define void @nearbyint_v2f64(<2 x double> addrspace(1)* %out, <2 x double> %in) { | 
|  | 44 | entry: | 
|  | 45 | %0 = call <2 x double> @llvm.nearbyint.v2f64(<2 x double> %in) | 
|  | 46 | store <2 x double> %0, <2 x double> addrspace(1)* %out | 
|  | 47 | ret void | 
|  | 48 | } | 
|  | 49 |  | 
|  | 50 | define void @nearbyint_v4f64(<4 x double> addrspace(1)* %out, <4 x double> %in) { | 
|  | 51 | entry: | 
|  | 52 | %0 = call <4 x double> @llvm.nearbyint.v4f64(<4 x double> %in) | 
|  | 53 | store <4 x double> %0, <4 x double> addrspace(1)* %out | 
|  | 54 | ret void | 
|  | 55 | } | 
|  | 56 |  | 
|  | 57 | attributes #0 = { nounwind readonly } | 
|  | 58 | attributes #1 = { nounwind } |