Matt Arsenault | 6689abe | 2016-05-05 20:07:37 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=amdgcn < %s | FileCheck -check-prefix=SI --check-prefix=FUNC %s |
Matt Arsenault | 7aad8fd | 2017-01-24 22:02:15 +0000 | [diff] [blame] | 2 | ; RUN: llc -march=amdgcn -mcpu=tonga -mattr=-flat-for-global < %s | FileCheck -check-prefix=SI --check-prefix=FUNC %s |
Matt Arsenault | 6689abe | 2016-05-05 20:07:37 +0000 | [diff] [blame] | 3 | ; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG --check-prefix=FUNC %s |
Matt Arsenault | 41e2f2b | 2014-02-24 21:01:28 +0000 | [diff] [blame] | 4 | |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 5 | declare float @llvm.trunc.f32(float) nounwind readnone |
| 6 | declare <2 x float> @llvm.trunc.v2f32(<2 x float>) nounwind readnone |
| 7 | declare <3 x float> @llvm.trunc.v3f32(<3 x float>) nounwind readnone |
| 8 | declare <4 x float> @llvm.trunc.v4f32(<4 x float>) nounwind readnone |
| 9 | declare <8 x float> @llvm.trunc.v8f32(<8 x float>) nounwind readnone |
| 10 | declare <16 x float> @llvm.trunc.v16f32(<16 x float>) nounwind readnone |
Matt Arsenault | 41e2f2b | 2014-02-24 21:01:28 +0000 | [diff] [blame] | 11 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 12 | ; FUNC-LABEL: {{^}}ftrunc_f32: |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 13 | ; EG: TRUNC |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 14 | ; SI: v_trunc_f32_e32 |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 15 | define amdgpu_kernel void @ftrunc_f32(float addrspace(1)* %out, float %x) { |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 16 | %y = call float @llvm.trunc.f32(float %x) nounwind readnone |
| 17 | store float %y, float addrspace(1)* %out |
Matt Arsenault | 4601093 | 2014-06-18 17:05:30 +0000 | [diff] [blame] | 18 | ret void |
| 19 | } |
| 20 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 21 | ; FUNC-LABEL: {{^}}ftrunc_v2f32: |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 22 | ; EG: TRUNC |
| 23 | ; EG: TRUNC |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 24 | ; SI: v_trunc_f32_e32 |
| 25 | ; SI: v_trunc_f32_e32 |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 26 | define amdgpu_kernel void @ftrunc_v2f32(<2 x float> addrspace(1)* %out, <2 x float> %x) { |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 27 | %y = call <2 x float> @llvm.trunc.v2f32(<2 x float> %x) nounwind readnone |
| 28 | store <2 x float> %y, <2 x float> addrspace(1)* %out |
Matt Arsenault | 41e2f2b | 2014-02-24 21:01:28 +0000 | [diff] [blame] | 29 | ret void |
| 30 | } |
| 31 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 32 | ; FIXME-FUNC-LABEL: {{^}}ftrunc_v3f32: |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 33 | ; FIXME-EG: TRUNC |
| 34 | ; FIXME-EG: TRUNC |
| 35 | ; FIXME-EG: TRUNC |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 36 | ; FIXME-SI: v_trunc_f32_e32 |
| 37 | ; FIXME-SI: v_trunc_f32_e32 |
| 38 | ; FIXME-SI: v_trunc_f32_e32 |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 39 | ; define amdgpu_kernel void @ftrunc_v3f32(<3 x float> addrspace(1)* %out, <3 x float> %x) { |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 40 | ; %y = call <3 x float> @llvm.trunc.v3f32(<3 x float> %x) nounwind readnone |
| 41 | ; store <3 x float> %y, <3 x float> addrspace(1)* %out |
Matt Arsenault | 41e2f2b | 2014-02-24 21:01:28 +0000 | [diff] [blame] | 42 | ; ret void |
| 43 | ; } |
| 44 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 45 | ; FUNC-LABEL: {{^}}ftrunc_v4f32: |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 46 | ; EG: TRUNC |
| 47 | ; EG: TRUNC |
| 48 | ; EG: TRUNC |
| 49 | ; EG: TRUNC |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 50 | ; SI: v_trunc_f32_e32 |
| 51 | ; SI: v_trunc_f32_e32 |
| 52 | ; SI: v_trunc_f32_e32 |
| 53 | ; SI: v_trunc_f32_e32 |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 54 | define amdgpu_kernel void @ftrunc_v4f32(<4 x float> addrspace(1)* %out, <4 x float> %x) { |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 55 | %y = call <4 x float> @llvm.trunc.v4f32(<4 x float> %x) nounwind readnone |
| 56 | store <4 x float> %y, <4 x float> addrspace(1)* %out |
Matt Arsenault | 41e2f2b | 2014-02-24 21:01:28 +0000 | [diff] [blame] | 57 | ret void |
| 58 | } |
| 59 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 60 | ; FUNC-LABEL: {{^}}ftrunc_v8f32: |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 61 | ; EG: TRUNC |
| 62 | ; EG: TRUNC |
| 63 | ; EG: TRUNC |
| 64 | ; EG: TRUNC |
| 65 | ; EG: TRUNC |
| 66 | ; EG: TRUNC |
| 67 | ; EG: TRUNC |
| 68 | ; EG: TRUNC |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 69 | ; SI: v_trunc_f32_e32 |
| 70 | ; SI: v_trunc_f32_e32 |
| 71 | ; SI: v_trunc_f32_e32 |
| 72 | ; SI: v_trunc_f32_e32 |
| 73 | ; SI: v_trunc_f32_e32 |
| 74 | ; SI: v_trunc_f32_e32 |
| 75 | ; SI: v_trunc_f32_e32 |
| 76 | ; SI: v_trunc_f32_e32 |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 77 | define amdgpu_kernel void @ftrunc_v8f32(<8 x float> addrspace(1)* %out, <8 x float> %x) { |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 78 | %y = call <8 x float> @llvm.trunc.v8f32(<8 x float> %x) nounwind readnone |
| 79 | store <8 x float> %y, <8 x float> addrspace(1)* %out |
Matt Arsenault | 41e2f2b | 2014-02-24 21:01:28 +0000 | [diff] [blame] | 80 | ret void |
| 81 | } |
| 82 | |
Tom Stellard | 79243d9 | 2014-10-01 17:15:17 +0000 | [diff] [blame] | 83 | ; FUNC-LABEL: {{^}}ftrunc_v16f32: |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 84 | ; EG: TRUNC |
| 85 | ; EG: TRUNC |
| 86 | ; EG: TRUNC |
| 87 | ; EG: TRUNC |
| 88 | ; EG: TRUNC |
| 89 | ; EG: TRUNC |
| 90 | ; EG: TRUNC |
| 91 | ; EG: TRUNC |
| 92 | ; EG: TRUNC |
| 93 | ; EG: TRUNC |
| 94 | ; EG: TRUNC |
| 95 | ; EG: TRUNC |
| 96 | ; EG: TRUNC |
| 97 | ; EG: TRUNC |
| 98 | ; EG: TRUNC |
| 99 | ; EG: TRUNC |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 100 | ; SI: v_trunc_f32_e32 |
| 101 | ; SI: v_trunc_f32_e32 |
| 102 | ; SI: v_trunc_f32_e32 |
| 103 | ; SI: v_trunc_f32_e32 |
| 104 | ; SI: v_trunc_f32_e32 |
| 105 | ; SI: v_trunc_f32_e32 |
| 106 | ; SI: v_trunc_f32_e32 |
| 107 | ; SI: v_trunc_f32_e32 |
| 108 | ; SI: v_trunc_f32_e32 |
| 109 | ; SI: v_trunc_f32_e32 |
| 110 | ; SI: v_trunc_f32_e32 |
| 111 | ; SI: v_trunc_f32_e32 |
| 112 | ; SI: v_trunc_f32_e32 |
| 113 | ; SI: v_trunc_f32_e32 |
| 114 | ; SI: v_trunc_f32_e32 |
| 115 | ; SI: v_trunc_f32_e32 |
Matt Arsenault | 3dbeefa | 2017-03-21 21:39:51 +0000 | [diff] [blame] | 116 | define amdgpu_kernel void @ftrunc_v16f32(<16 x float> addrspace(1)* %out, <16 x float> %x) { |
Tom Stellard | 9c603eb | 2014-06-20 17:06:09 +0000 | [diff] [blame] | 117 | %y = call <16 x float> @llvm.trunc.v16f32(<16 x float> %x) nounwind readnone |
| 118 | store <16 x float> %y, <16 x float> addrspace(1)* %out |
Matt Arsenault | 41e2f2b | 2014-02-24 21:01:28 +0000 | [diff] [blame] | 119 | ret void |
| 120 | } |