Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +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 | |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 3 | ; This tests fcmp operations that do not map directly to NEON instructions. |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 4 | |
| 5 | ; une is implemented with VCEQ/VMVN |
| 6 | define <2 x i32> @vcunef32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 7 | ;CHECK: vcunef32: |
| 8 | ;CHECK: vceq.f32 |
| 9 | ;CHECK-NEXT: vmvn |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 10 | %tmp1 = load <2 x float>* %A |
| 11 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 12 | %tmp3 = fcmp une <2 x float> %tmp1, %tmp2 |
| 13 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 14 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 15 | } |
| 16 | |
| 17 | ; olt is implemented with VCGT |
| 18 | define <2 x i32> @vcoltf32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 19 | ;CHECK: vcoltf32: |
| 20 | ;CHECK: vcgt.f32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 21 | %tmp1 = load <2 x float>* %A |
| 22 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 23 | %tmp3 = fcmp olt <2 x float> %tmp1, %tmp2 |
| 24 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 25 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 26 | } |
| 27 | |
| 28 | ; ole is implemented with VCGE |
| 29 | define <2 x i32> @vcolef32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 30 | ;CHECK: vcolef32: |
| 31 | ;CHECK: vcge.f32 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 32 | %tmp1 = load <2 x float>* %A |
| 33 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 34 | %tmp3 = fcmp ole <2 x float> %tmp1, %tmp2 |
| 35 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 36 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 37 | } |
| 38 | |
| 39 | ; uge is implemented with VCGT/VMVN |
| 40 | define <2 x i32> @vcugef32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 41 | ;CHECK: vcugef32: |
| 42 | ;CHECK: vcgt.f32 |
| 43 | ;CHECK-NEXT: vmvn |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 44 | %tmp1 = load <2 x float>* %A |
| 45 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 46 | %tmp3 = fcmp uge <2 x float> %tmp1, %tmp2 |
| 47 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 48 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | ; ule is implemented with VCGT/VMVN |
| 52 | define <2 x i32> @vculef32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 53 | ;CHECK: vculef32: |
| 54 | ;CHECK: vcgt.f32 |
| 55 | ;CHECK-NEXT: vmvn |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 56 | %tmp1 = load <2 x float>* %A |
| 57 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 58 | %tmp3 = fcmp ule <2 x float> %tmp1, %tmp2 |
| 59 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 60 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 61 | } |
| 62 | |
| 63 | ; ugt is implemented with VCGE/VMVN |
| 64 | define <2 x i32> @vcugtf32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 65 | ;CHECK: vcugtf32: |
| 66 | ;CHECK: vcge.f32 |
| 67 | ;CHECK-NEXT: vmvn |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 68 | %tmp1 = load <2 x float>* %A |
| 69 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 70 | %tmp3 = fcmp ugt <2 x float> %tmp1, %tmp2 |
| 71 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 72 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | ; ult is implemented with VCGE/VMVN |
| 76 | define <2 x i32> @vcultf32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 77 | ;CHECK: vcultf32: |
| 78 | ;CHECK: vcge.f32 |
| 79 | ;CHECK-NEXT: vmvn |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 80 | %tmp1 = load <2 x float>* %A |
| 81 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 82 | %tmp3 = fcmp ult <2 x float> %tmp1, %tmp2 |
| 83 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 84 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | ; ueq is implemented with VCGT/VCGT/VORR/VMVN |
| 88 | define <2 x i32> @vcueqf32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 89 | ;CHECK: vcueqf32: |
| 90 | ;CHECK: vcgt.f32 |
| 91 | ;CHECK-NEXT: vcgt.f32 |
| 92 | ;CHECK-NEXT: vorr |
| 93 | ;CHECK-NEXT: vmvn |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 94 | %tmp1 = load <2 x float>* %A |
| 95 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 96 | %tmp3 = fcmp ueq <2 x float> %tmp1, %tmp2 |
| 97 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 98 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 99 | } |
| 100 | |
| 101 | ; one is implemented with VCGT/VCGT/VORR |
| 102 | define <2 x i32> @vconef32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 103 | ;CHECK: vconef32: |
| 104 | ;CHECK: vcgt.f32 |
| 105 | ;CHECK-NEXT: vcgt.f32 |
| 106 | ;CHECK-NEXT: vorr |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 107 | %tmp1 = load <2 x float>* %A |
| 108 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 109 | %tmp3 = fcmp one <2 x float> %tmp1, %tmp2 |
| 110 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 111 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 112 | } |
| 113 | |
| 114 | ; uno is implemented with VCGT/VCGE/VORR/VMVN |
| 115 | define <2 x i32> @vcunof32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 116 | ;CHECK: vcunof32: |
| 117 | ;CHECK: vcge.f32 |
| 118 | ;CHECK-NEXT: vcgt.f32 |
| 119 | ;CHECK-NEXT: vorr |
| 120 | ;CHECK-NEXT: vmvn |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 121 | %tmp1 = load <2 x float>* %A |
| 122 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 123 | %tmp3 = fcmp uno <2 x float> %tmp1, %tmp2 |
| 124 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 125 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 126 | } |
| 127 | |
| 128 | ; ord is implemented with VCGT/VCGE/VORR |
| 129 | define <2 x i32> @vcordf32(<2 x float>* %A, <2 x float>* %B) nounwind { |
Bob Wilson | 9b379dc | 2009-09-15 20:58:02 +0000 | [diff] [blame^] | 130 | ;CHECK: vcordf32: |
| 131 | ;CHECK: vcge.f32 |
| 132 | ;CHECK-NEXT: vcgt.f32 |
| 133 | ;CHECK-NEXT: vorr |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 134 | %tmp1 = load <2 x float>* %A |
| 135 | %tmp2 = load <2 x float>* %B |
Chris Lattner | b2773e1 | 2009-07-08 00:46:57 +0000 | [diff] [blame] | 136 | %tmp3 = fcmp ord <2 x float> %tmp1, %tmp2 |
| 137 | %tmp4 = sext <2 x i1> %tmp3 to <2 x i32> |
| 138 | ret <2 x i32> %tmp4 |
Bob Wilson | 5bafff3 | 2009-06-22 23:27:02 +0000 | [diff] [blame] | 139 | } |