Tom Stellard | 49f8bfd | 2015-01-06 18:00:21 +0000 | [diff] [blame] | 1 | ; RUN: llc -march=amdgcn -mcpu=SI < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s |
Marek Olsak | fa6607d | 2015-02-11 14:26:46 +0000 | [diff] [blame] | 2 | ; RUN: llc -march=amdgcn -mcpu=bonaire < %s | FileCheck -check-prefix=CI -check-prefix=FUNC %s |
| 3 | ; RUN: llc -march=amdgcn -mcpu=tonga < %s | FileCheck -check-prefix=CI -check-prefix=FUNC %s |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 4 | |
| 5 | declare double @llvm.trunc.f64(double) nounwind readnone |
| 6 | declare <2 x double> @llvm.trunc.v2f64(<2 x double>) nounwind readnone |
| 7 | declare <3 x double> @llvm.trunc.v3f64(<3 x double>) nounwind readnone |
| 8 | declare <4 x double> @llvm.trunc.v4f64(<4 x double>) nounwind readnone |
| 9 | declare <8 x double> @llvm.trunc.v8f64(<8 x double>) nounwind readnone |
| 10 | declare <16 x double> @llvm.trunc.v16f64(<16 x double>) nounwind readnone |
| 11 | |
| 12 | ; FUNC-LABEL: {{^}}v_ftrunc_f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 13 | ; CI: v_trunc_f64 |
| 14 | ; SI: v_bfe_u32 {{v[0-9]+}}, {{v[0-9]+}}, 20, 11 |
| 15 | ; SI: s_endpgm |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 16 | define void @v_ftrunc_f64(double addrspace(1)* %out, double addrspace(1)* %in) { |
David Blaikie | a79ac14 | 2015-02-27 21:17:42 +0000 | [diff] [blame] | 17 | %x = load double, double addrspace(1)* %in, align 8 |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 18 | %y = call double @llvm.trunc.f64(double %x) nounwind readnone |
| 19 | store double %y, double addrspace(1)* %out, align 8 |
| 20 | ret void |
| 21 | } |
| 22 | |
| 23 | ; FUNC-LABEL: {{^}}ftrunc_f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 24 | ; CI: v_trunc_f64_e32 |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 25 | |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 26 | ; SI: s_bfe_u32 [[SEXP:s[0-9]+]], {{s[0-9]+}}, 0xb0014 |
Tom Stellard | 83f0bce | 2015-01-29 16:55:25 +0000 | [diff] [blame] | 27 | ; SI: s_and_b32 s{{[0-9]+}}, s{{[0-9]+}}, 0x80000000 |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 28 | ; SI: s_add_i32 s{{[0-9]+}}, [[SEXP]], 0xfffffc01 |
| 29 | ; SI: s_lshr_b64 |
| 30 | ; SI: s_not_b64 |
| 31 | ; SI: s_and_b64 |
Andrew Trick | 43adfb3 | 2015-03-27 06:10:13 +0000 | [diff] [blame] | 32 | ; SI: cmp_gt_i32 |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 33 | ; SI: cndmask_b32 |
| 34 | ; SI: cndmask_b32 |
Matt Arsenault | f5b2cd8 | 2015-03-23 18:45:30 +0000 | [diff] [blame] | 35 | ; SI: cmp_lt_i32 |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 36 | ; SI: cndmask_b32 |
| 37 | ; SI: cndmask_b32 |
| 38 | ; SI: s_endpgm |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 39 | define void @ftrunc_f64(double addrspace(1)* %out, double %x) { |
| 40 | %y = call double @llvm.trunc.f64(double %x) nounwind readnone |
| 41 | store double %y, double addrspace(1)* %out |
| 42 | ret void |
| 43 | } |
| 44 | |
| 45 | ; FUNC-LABEL: {{^}}ftrunc_v2f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 46 | ; CI: v_trunc_f64_e32 |
| 47 | ; CI: v_trunc_f64_e32 |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 48 | define void @ftrunc_v2f64(<2 x double> addrspace(1)* %out, <2 x double> %x) { |
| 49 | %y = call <2 x double> @llvm.trunc.v2f64(<2 x double> %x) nounwind readnone |
| 50 | store <2 x double> %y, <2 x double> addrspace(1)* %out |
| 51 | ret void |
| 52 | } |
| 53 | |
| 54 | ; FIXME-FUNC-LABEL: {{^}}ftrunc_v3f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 55 | ; FIXME-CI: v_trunc_f64_e32 |
| 56 | ; FIXME-CI: v_trunc_f64_e32 |
| 57 | ; FIXME-CI: v_trunc_f64_e32 |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 58 | ; define void @ftrunc_v3f64(<3 x double> addrspace(1)* %out, <3 x double> %x) { |
| 59 | ; %y = call <3 x double> @llvm.trunc.v3f64(<3 x double> %x) nounwind readnone |
| 60 | ; store <3 x double> %y, <3 x double> addrspace(1)* %out |
| 61 | ; ret void |
| 62 | ; } |
| 63 | |
| 64 | ; FUNC-LABEL: {{^}}ftrunc_v4f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 65 | ; CI: v_trunc_f64_e32 |
| 66 | ; CI: v_trunc_f64_e32 |
| 67 | ; CI: v_trunc_f64_e32 |
| 68 | ; CI: v_trunc_f64_e32 |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 69 | define void @ftrunc_v4f64(<4 x double> addrspace(1)* %out, <4 x double> %x) { |
| 70 | %y = call <4 x double> @llvm.trunc.v4f64(<4 x double> %x) nounwind readnone |
| 71 | store <4 x double> %y, <4 x double> addrspace(1)* %out |
| 72 | ret void |
| 73 | } |
| 74 | |
| 75 | ; FUNC-LABEL: {{^}}ftrunc_v8f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 76 | ; CI: v_trunc_f64_e32 |
| 77 | ; CI: v_trunc_f64_e32 |
| 78 | ; CI: v_trunc_f64_e32 |
| 79 | ; CI: v_trunc_f64_e32 |
| 80 | ; CI: v_trunc_f64_e32 |
| 81 | ; CI: v_trunc_f64_e32 |
| 82 | ; CI: v_trunc_f64_e32 |
| 83 | ; CI: v_trunc_f64_e32 |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 84 | define void @ftrunc_v8f64(<8 x double> addrspace(1)* %out, <8 x double> %x) { |
| 85 | %y = call <8 x double> @llvm.trunc.v8f64(<8 x double> %x) nounwind readnone |
| 86 | store <8 x double> %y, <8 x double> addrspace(1)* %out |
| 87 | ret void |
| 88 | } |
| 89 | |
| 90 | ; FUNC-LABEL: {{^}}ftrunc_v16f64: |
Tom Stellard | 326d6ec | 2014-11-05 14:50:53 +0000 | [diff] [blame] | 91 | ; CI: v_trunc_f64_e32 |
| 92 | ; CI: v_trunc_f64_e32 |
| 93 | ; CI: v_trunc_f64_e32 |
| 94 | ; CI: v_trunc_f64_e32 |
| 95 | ; CI: v_trunc_f64_e32 |
| 96 | ; CI: v_trunc_f64_e32 |
| 97 | ; CI: v_trunc_f64_e32 |
| 98 | ; CI: v_trunc_f64_e32 |
| 99 | ; CI: v_trunc_f64_e32 |
| 100 | ; CI: v_trunc_f64_e32 |
| 101 | ; CI: v_trunc_f64_e32 |
| 102 | ; CI: v_trunc_f64_e32 |
| 103 | ; CI: v_trunc_f64_e32 |
| 104 | ; CI: v_trunc_f64_e32 |
| 105 | ; CI: v_trunc_f64_e32 |
| 106 | ; CI: v_trunc_f64_e32 |
Matt Arsenault | 6cda887 | 2014-10-03 23:54:27 +0000 | [diff] [blame] | 107 | define void @ftrunc_v16f64(<16 x double> addrspace(1)* %out, <16 x double> %x) { |
| 108 | %y = call <16 x double> @llvm.trunc.v16f64(<16 x double> %x) nounwind readnone |
| 109 | store <16 x double> %y, <16 x double> addrspace(1)* %out |
| 110 | ret void |
| 111 | } |