Tom Stellard | 3dbf1f8 | 2014-05-02 15:41:47 +0000 | [diff] [blame] | 1 | ;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s -check-prefix=EG -check-prefix=FUNC |
Tom Stellard | 49f8bfd | 2015-01-06 18:00:21 +0000 | [diff] [blame^] | 2 | ;RUN: llc < %s -march=amdgcn -mcpu=SI | FileCheck %s -check-prefix=SI -check-prefix=FUNC |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 3 | |
Tom Stellard | 3dbf1f8 | 2014-05-02 15:41:47 +0000 | [diff] [blame] | 4 | ;FUNC-LABEL: test |
| 5 | ;EG: MULADD_IEEE * |
| 6 | ;EG: FRACT * |
| 7 | ;EG: ADD * |
| 8 | ;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} |
| 9 | ;EG-NOT: COS |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 10 | ;SI: v_cos_f32 |
| 11 | ;SI-NOT: v_cos_f32 |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 12 | |
Tom Stellard | 3dbf1f8 | 2014-05-02 15:41:47 +0000 | [diff] [blame] | 13 | define void @test(float addrspace(1)* %out, float %x) #1 { |
| 14 | %cos = call float @llvm.cos.f32(float %x) |
| 15 | store float %cos, float addrspace(1)* %out |
| 16 | ret void |
| 17 | } |
| 18 | |
| 19 | ;FUNC-LABEL: testv |
| 20 | ;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} |
| 21 | ;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} |
| 22 | ;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} |
| 23 | ;EG: COS * T{{[0-9]+\.[XYZW], PV\.[XYZW]}} |
| 24 | ;EG-NOT: COS |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 25 | ;SI: v_cos_f32 |
| 26 | ;SI: v_cos_f32 |
| 27 | ;SI: v_cos_f32 |
| 28 | ;SI: v_cos_f32 |
| 29 | ;SI-NOT: v_cos_f32 |
Tom Stellard | 3dbf1f8 | 2014-05-02 15:41:47 +0000 | [diff] [blame] | 30 | |
| 31 | define void @testv(<4 x float> addrspace(1)* %out, <4 x float> inreg %vx) #1 { |
| 32 | %cos = call <4 x float> @llvm.cos.v4f32(<4 x float> %vx) |
| 33 | store <4 x float> %cos, <4 x float> addrspace(1)* %out |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 34 | ret void |
| 35 | } |
| 36 | |
| 37 | declare float @llvm.cos.f32(float) readnone |
Tom Stellard | 3dbf1f8 | 2014-05-02 15:41:47 +0000 | [diff] [blame] | 38 | declare <4 x float> @llvm.cos.v4f32(<4 x float>) readnone |
Tom Stellard | 75aadc2 | 2012-12-11 21:25:42 +0000 | [diff] [blame] | 39 | |
Vincent Lejeune | f143af3 | 2013-11-11 22:10:24 +0000 | [diff] [blame] | 40 | attributes #0 = { "ShaderType"="0" } |