Dan Gohman | fce288f | 2009-09-09 00:09:15 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=arm -mattr=+neon | FileCheck %s |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 2 | |
| 3 | define <2 x i32> @vcvt_f32tos32(<2 x float>* %A) nounwind { |
Bob Wilson | e4696cf | 2009-08-26 18:11:50 +0000 | [diff] [blame] | 4 | ;CHECK: vcvt_f32tos32: |
| 5 | ;CHECK: vcvt.s32.f32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 6 | %tmp1 = load <2 x float>* %A |
| 7 | %tmp2 = fptosi <2 x float> %tmp1 to <2 x i32> |
| 8 | ret <2 x i32> %tmp2 |
| 9 | } |
| 10 | |
| 11 | define <2 x i32> @vcvt_f32tou32(<2 x float>* %A) nounwind { |
Bob Wilson | e4696cf | 2009-08-26 18:11:50 +0000 | [diff] [blame] | 12 | ;CHECK: vcvt_f32tou32: |
| 13 | ;CHECK: vcvt.u32.f32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 14 | %tmp1 = load <2 x float>* %A |
| 15 | %tmp2 = fptoui <2 x float> %tmp1 to <2 x i32> |
| 16 | ret <2 x i32> %tmp2 |
| 17 | } |
| 18 | |
| 19 | define <2 x float> @vcvt_s32tof32(<2 x i32>* %A) nounwind { |
Bob Wilson | e4696cf | 2009-08-26 18:11:50 +0000 | [diff] [blame] | 20 | ;CHECK: vcvt_s32tof32: |
| 21 | ;CHECK: vcvt.f32.s32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 22 | %tmp1 = load <2 x i32>* %A |
| 23 | %tmp2 = sitofp <2 x i32> %tmp1 to <2 x float> |
| 24 | ret <2 x float> %tmp2 |
| 25 | } |
| 26 | |
| 27 | define <2 x float> @vcvt_u32tof32(<2 x i32>* %A) nounwind { |
Bob Wilson | e4696cf | 2009-08-26 18:11:50 +0000 | [diff] [blame] | 28 | ;CHECK: vcvt_u32tof32: |
| 29 | ;CHECK: vcvt.f32.u32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 30 | %tmp1 = load <2 x i32>* %A |
| 31 | %tmp2 = uitofp <2 x i32> %tmp1 to <2 x float> |
| 32 | ret <2 x float> %tmp2 |
| 33 | } |
| 34 | |
| 35 | define <4 x i32> @vcvtQ_f32tos32(<4 x float>* %A) nounwind { |
Bob Wilson | e4696cf | 2009-08-26 18:11:50 +0000 | [diff] [blame] | 36 | ;CHECK: vcvtQ_f32tos32: |
| 37 | ;CHECK: vcvt.s32.f32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 38 | %tmp1 = load <4 x float>* %A |
| 39 | %tmp2 = fptosi <4 x float> %tmp1 to <4 x i32> |
| 40 | ret <4 x i32> %tmp2 |
| 41 | } |
| 42 | |
| 43 | define <4 x i32> @vcvtQ_f32tou32(<4 x float>* %A) nounwind { |
Bob Wilson | e4696cf | 2009-08-26 18:11:50 +0000 | [diff] [blame] | 44 | ;CHECK: vcvtQ_f32tou32: |
| 45 | ;CHECK: vcvt.u32.f32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 46 | %tmp1 = load <4 x float>* %A |
| 47 | %tmp2 = fptoui <4 x float> %tmp1 to <4 x i32> |
| 48 | ret <4 x i32> %tmp2 |
| 49 | } |
| 50 | |
| 51 | define <4 x float> @vcvtQ_s32tof32(<4 x i32>* %A) nounwind { |
Bob Wilson | e4696cf | 2009-08-26 18:11:50 +0000 | [diff] [blame] | 52 | ;CHECK: vcvtQ_s32tof32: |
| 53 | ;CHECK: vcvt.f32.s32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 54 | %tmp1 = load <4 x i32>* %A |
| 55 | %tmp2 = sitofp <4 x i32> %tmp1 to <4 x float> |
| 56 | ret <4 x float> %tmp2 |
| 57 | } |
| 58 | |
| 59 | define <4 x float> @vcvtQ_u32tof32(<4 x i32>* %A) nounwind { |
Bob Wilson | e4696cf | 2009-08-26 18:11:50 +0000 | [diff] [blame] | 60 | ;CHECK: vcvtQ_u32tof32: |
| 61 | ;CHECK: vcvt.f32.u32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 62 | %tmp1 = load <4 x i32>* %A |
| 63 | %tmp2 = uitofp <4 x i32> %tmp1 to <4 x float> |
| 64 | ret <4 x float> %tmp2 |
| 65 | } |
Bob Wilson | 83815ae | 2009-10-09 20:20:54 +0000 | [diff] [blame] | 66 | |
| 67 | define <2 x i32> @vcvt_n_f32tos32(<2 x float>* %A) nounwind { |
| 68 | ;CHECK: vcvt_n_f32tos32: |
| 69 | ;CHECK: vcvt.s32.f32 |
| 70 | %tmp1 = load <2 x float>* %A |
| 71 | %tmp2 = call <2 x i32> @llvm.arm.neon.vcvtfp2fxs.v2i32.v2f32(<2 x float> %tmp1, i32 1) |
| 72 | ret <2 x i32> %tmp2 |
| 73 | } |
| 74 | |
| 75 | define <2 x i32> @vcvt_n_f32tou32(<2 x float>* %A) nounwind { |
| 76 | ;CHECK: vcvt_n_f32tou32: |
| 77 | ;CHECK: vcvt.u32.f32 |
| 78 | %tmp1 = load <2 x float>* %A |
| 79 | %tmp2 = call <2 x i32> @llvm.arm.neon.vcvtfp2fxu.v2i32.v2f32(<2 x float> %tmp1, i32 1) |
| 80 | ret <2 x i32> %tmp2 |
| 81 | } |
| 82 | |
| 83 | define <2 x float> @vcvt_n_s32tof32(<2 x i32>* %A) nounwind { |
| 84 | ;CHECK: vcvt_n_s32tof32: |
| 85 | ;CHECK: vcvt.f32.s32 |
| 86 | %tmp1 = load <2 x i32>* %A |
| 87 | %tmp2 = call <2 x float> @llvm.arm.neon.vcvtfxs2fp.v2f32.v2i32(<2 x i32> %tmp1, i32 1) |
| 88 | ret <2 x float> %tmp2 |
| 89 | } |
| 90 | |
| 91 | define <2 x float> @vcvt_n_u32tof32(<2 x i32>* %A) nounwind { |
| 92 | ;CHECK: vcvt_n_u32tof32: |
| 93 | ;CHECK: vcvt.f32.u32 |
| 94 | %tmp1 = load <2 x i32>* %A |
| 95 | %tmp2 = call <2 x float> @llvm.arm.neon.vcvtfxu2fp.v2f32.v2i32(<2 x i32> %tmp1, i32 1) |
| 96 | ret <2 x float> %tmp2 |
| 97 | } |
| 98 | |
| 99 | declare <2 x i32> @llvm.arm.neon.vcvtfp2fxs.v2i32.v2f32(<2 x float>, i32) nounwind readnone |
| 100 | declare <2 x i32> @llvm.arm.neon.vcvtfp2fxu.v2i32.v2f32(<2 x float>, i32) nounwind readnone |
| 101 | declare <2 x float> @llvm.arm.neon.vcvtfxs2fp.v2f32.v2i32(<2 x i32>, i32) nounwind readnone |
| 102 | declare <2 x float> @llvm.arm.neon.vcvtfxu2fp.v2f32.v2i32(<2 x i32>, i32) nounwind readnone |
| 103 | |
| 104 | define <4 x i32> @vcvtQ_n_f32tos32(<4 x float>* %A) nounwind { |
| 105 | ;CHECK: vcvtQ_n_f32tos32: |
| 106 | ;CHECK: vcvt.s32.f32 |
| 107 | %tmp1 = load <4 x float>* %A |
| 108 | %tmp2 = call <4 x i32> @llvm.arm.neon.vcvtfp2fxs.v4i32.v4f32(<4 x float> %tmp1, i32 1) |
| 109 | ret <4 x i32> %tmp2 |
| 110 | } |
| 111 | |
| 112 | define <4 x i32> @vcvtQ_n_f32tou32(<4 x float>* %A) nounwind { |
| 113 | ;CHECK: vcvtQ_n_f32tou32: |
| 114 | ;CHECK: vcvt.u32.f32 |
| 115 | %tmp1 = load <4 x float>* %A |
| 116 | %tmp2 = call <4 x i32> @llvm.arm.neon.vcvtfp2fxu.v4i32.v4f32(<4 x float> %tmp1, i32 1) |
| 117 | ret <4 x i32> %tmp2 |
| 118 | } |
| 119 | |
| 120 | define <4 x float> @vcvtQ_n_s32tof32(<4 x i32>* %A) nounwind { |
| 121 | ;CHECK: vcvtQ_n_s32tof32: |
| 122 | ;CHECK: vcvt.f32.s32 |
| 123 | %tmp1 = load <4 x i32>* %A |
| 124 | %tmp2 = call <4 x float> @llvm.arm.neon.vcvtfxs2fp.v4f32.v4i32(<4 x i32> %tmp1, i32 1) |
| 125 | ret <4 x float> %tmp2 |
| 126 | } |
| 127 | |
| 128 | define <4 x float> @vcvtQ_n_u32tof32(<4 x i32>* %A) nounwind { |
| 129 | ;CHECK: vcvtQ_n_u32tof32: |
| 130 | ;CHECK: vcvt.f32.u32 |
| 131 | %tmp1 = load <4 x i32>* %A |
| 132 | %tmp2 = call <4 x float> @llvm.arm.neon.vcvtfxu2fp.v4f32.v4i32(<4 x i32> %tmp1, i32 1) |
| 133 | ret <4 x float> %tmp2 |
| 134 | } |
| 135 | |
| 136 | declare <4 x i32> @llvm.arm.neon.vcvtfp2fxs.v4i32.v4f32(<4 x float>, i32) nounwind readnone |
| 137 | declare <4 x i32> @llvm.arm.neon.vcvtfp2fxu.v4i32.v4f32(<4 x float>, i32) nounwind readnone |
| 138 | declare <4 x float> @llvm.arm.neon.vcvtfxs2fp.v4f32.v4i32(<4 x i32>, i32) nounwind readnone |
| 139 | declare <4 x float> @llvm.arm.neon.vcvtfxu2fp.v4f32.v4i32(<4 x i32>, i32) nounwind readnone |
| 140 | |