Dan Gohman | 0cb2f67 | 2009-09-11 18:36:27 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -march=cellspu > %t1.s |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 2 | ; RUN: grep selb %t1.s | count 56 |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 3 | |
Scott Michel | dbac4cf | 2008-01-11 02:53:15 +0000 | [diff] [blame] | 4 | target datalayout = "E-p:32:32:128-f64:64:128-f32:32:128-i64:32:128-i32:32:128-i16:16:128-i8:8:128-i1:8:128-a0:0:128-v128:128:128-s0:128:128" |
| 5 | target triple = "spu" |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 6 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 7 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 8 | ; v2i64 |
| 9 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 10 | |
| 11 | ; (or (and rC, rB), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 12 | define <2 x i64> @selectbits_v2i64_01(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 13 | %C = and <2 x i64> %rC, %rB |
| 14 | %A = xor <2 x i64> %rC, < i64 -1, i64 -1 > |
| 15 | %B = and <2 x i64> %A, %rA |
| 16 | %D = or <2 x i64> %C, %B |
| 17 | ret <2 x i64> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 18 | } |
| 19 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 20 | ; (or (and rB, rC), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 21 | define <2 x i64> @selectbits_v2i64_02(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 22 | %C = and <2 x i64> %rB, %rC |
| 23 | %A = xor <2 x i64> %rC, < i64 -1, i64 -1 > |
| 24 | %B = and <2 x i64> %A, %rA |
| 25 | %D = or <2 x i64> %C, %B |
| 26 | ret <2 x i64> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 27 | } |
| 28 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 29 | ; (or (and (not rC), rA), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 30 | define <2 x i64> @selectbits_v2i64_03(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 31 | %A = xor <2 x i64> %rC, < i64 -1, i64 -1 > |
| 32 | %B = and <2 x i64> %A, %rA |
| 33 | %C = and <2 x i64> %rB, %rC |
| 34 | %D = or <2 x i64> %C, %B |
| 35 | ret <2 x i64> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 36 | } |
| 37 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 38 | ; (or (and (not rC), rA), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 39 | define <2 x i64> @selectbits_v2i64_04(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 40 | %A = xor <2 x i64> %rC, < i64 -1, i64 -1 > |
| 41 | %B = and <2 x i64> %A, %rA |
| 42 | %C = and <2 x i64> %rC, %rB |
| 43 | %D = or <2 x i64> %C, %B |
| 44 | ret <2 x i64> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 45 | } |
| 46 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 47 | ; (or (and rC, rB), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 48 | define <2 x i64> @selectbits_v2i64_05(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 49 | %C = and <2 x i64> %rC, %rB |
| 50 | %A = xor <2 x i64> %rC, < i64 -1, i64 -1 > |
| 51 | %B = and <2 x i64> %rA, %A |
| 52 | %D = or <2 x i64> %C, %B |
| 53 | ret <2 x i64> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 54 | } |
| 55 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 56 | ; (or (and rB, rC), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 57 | define <2 x i64> @selectbits_v2i64_06(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 58 | %C = and <2 x i64> %rB, %rC |
| 59 | %A = xor <2 x i64> %rC, < i64 -1, i64 -1 > |
| 60 | %B = and <2 x i64> %rA, %A |
| 61 | %D = or <2 x i64> %C, %B |
| 62 | ret <2 x i64> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 63 | } |
| 64 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 65 | ; (or (and rA, (not rC)), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 66 | define <2 x i64> @selectbits_v2i64_07(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 67 | %A = xor <2 x i64> %rC, < i64 -1, i64 -1 > |
| 68 | %B = and <2 x i64> %rA, %A |
| 69 | %C = and <2 x i64> %rB, %rC |
| 70 | %D = or <2 x i64> %C, %B |
| 71 | ret <2 x i64> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 72 | } |
| 73 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 74 | ; (or (and rA, (not rC)), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 75 | define <2 x i64> @selectbits_v2i64_08(<2 x i64> %rA, <2 x i64> %rB, <2 x i64> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 76 | %A = xor <2 x i64> %rC, < i64 -1, i64 -1 > |
| 77 | %B = and <2 x i64> %rA, %A |
| 78 | %C = and <2 x i64> %rC, %rB |
| 79 | %D = or <2 x i64> %C, %B |
| 80 | ret <2 x i64> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 81 | } |
| 82 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 83 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 84 | ; v4i32 |
| 85 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 86 | |
| 87 | ; (or (and rC, rB), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 88 | define <4 x i32> @selectbits_v4i32_01(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 89 | %C = and <4 x i32> %rC, %rB |
| 90 | %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1 > |
| 91 | %B = and <4 x i32> %A, %rA |
| 92 | %D = or <4 x i32> %C, %B |
| 93 | ret <4 x i32> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 94 | } |
| 95 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 96 | ; (or (and rB, rC), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 97 | define <4 x i32> @selectbits_v4i32_02(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 98 | %C = and <4 x i32> %rB, %rC |
| 99 | %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1 > |
| 100 | %B = and <4 x i32> %A, %rA |
| 101 | %D = or <4 x i32> %C, %B |
| 102 | ret <4 x i32> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 103 | } |
| 104 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 105 | ; (or (and (not rC), rA), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 106 | define <4 x i32> @selectbits_v4i32_03(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 107 | %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1 > |
| 108 | %B = and <4 x i32> %A, %rA |
| 109 | %C = and <4 x i32> %rB, %rC |
| 110 | %D = or <4 x i32> %C, %B |
| 111 | ret <4 x i32> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 112 | } |
| 113 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 114 | ; (or (and (not rC), rA), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 115 | define <4 x i32> @selectbits_v4i32_04(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 116 | %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1> |
| 117 | %B = and <4 x i32> %A, %rA |
| 118 | %C = and <4 x i32> %rC, %rB |
| 119 | %D = or <4 x i32> %C, %B |
| 120 | ret <4 x i32> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 121 | } |
| 122 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 123 | ; (or (and rC, rB), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 124 | define <4 x i32> @selectbits_v4i32_05(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 125 | %C = and <4 x i32> %rC, %rB |
| 126 | %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1> |
| 127 | %B = and <4 x i32> %rA, %A |
| 128 | %D = or <4 x i32> %C, %B |
| 129 | ret <4 x i32> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 130 | } |
| 131 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 132 | ; (or (and rB, rC), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 133 | define <4 x i32> @selectbits_v4i32_06(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 134 | %C = and <4 x i32> %rB, %rC |
| 135 | %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1> |
| 136 | %B = and <4 x i32> %rA, %A |
| 137 | %D = or <4 x i32> %C, %B |
| 138 | ret <4 x i32> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 139 | } |
| 140 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 141 | ; (or (and rA, (not rC)), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 142 | define <4 x i32> @selectbits_v4i32_07(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 143 | %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1> |
| 144 | %B = and <4 x i32> %rA, %A |
| 145 | %C = and <4 x i32> %rB, %rC |
| 146 | %D = or <4 x i32> %C, %B |
| 147 | ret <4 x i32> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 148 | } |
| 149 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 150 | ; (or (and rA, (not rC)), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 151 | define <4 x i32> @selectbits_v4i32_08(<4 x i32> %rA, <4 x i32> %rB, <4 x i32> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 152 | %A = xor <4 x i32> %rC, < i32 -1, i32 -1, i32 -1, i32 -1> |
| 153 | %B = and <4 x i32> %rA, %A |
| 154 | %C = and <4 x i32> %rC, %rB |
| 155 | %D = or <4 x i32> %C, %B |
| 156 | ret <4 x i32> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 157 | } |
| 158 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 159 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 160 | ; v8i16 |
| 161 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 162 | |
| 163 | ; (or (and rC, rB), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 164 | define <8 x i16> @selectbits_v8i16_01(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 165 | %C = and <8 x i16> %rC, %rB |
| 166 | %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1, |
| 167 | i16 -1, i16 -1, i16 -1, i16 -1 > |
| 168 | %B = and <8 x i16> %A, %rA |
| 169 | %D = or <8 x i16> %C, %B |
| 170 | ret <8 x i16> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 171 | } |
| 172 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 173 | ; (or (and rB, rC), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 174 | define <8 x i16> @selectbits_v8i16_02(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 175 | %C = and <8 x i16> %rB, %rC |
| 176 | %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1, |
| 177 | i16 -1, i16 -1, i16 -1, i16 -1 > |
| 178 | %B = and <8 x i16> %A, %rA |
| 179 | %D = or <8 x i16> %C, %B |
| 180 | ret <8 x i16> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 181 | } |
| 182 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 183 | ; (or (and (not rC), rA), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 184 | define <8 x i16> @selectbits_v8i16_03(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 185 | %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1, |
| 186 | i16 -1, i16 -1, i16 -1, i16 -1 > |
| 187 | %B = and <8 x i16> %A, %rA |
| 188 | %C = and <8 x i16> %rB, %rC |
| 189 | %D = or <8 x i16> %C, %B |
| 190 | ret <8 x i16> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 191 | } |
| 192 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 193 | ; (or (and (not rC), rA), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 194 | define <8 x i16> @selectbits_v8i16_04(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 195 | %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1, |
| 196 | i16 -1, i16 -1, i16 -1, i16 -1 > |
| 197 | %B = and <8 x i16> %A, %rA |
| 198 | %C = and <8 x i16> %rC, %rB |
| 199 | %D = or <8 x i16> %C, %B |
| 200 | ret <8 x i16> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 201 | } |
| 202 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 203 | ; (or (and rC, rB), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 204 | define <8 x i16> @selectbits_v8i16_05(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 205 | %C = and <8 x i16> %rC, %rB |
| 206 | %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1, |
| 207 | i16 -1, i16 -1, i16 -1, i16 -1 > |
| 208 | %B = and <8 x i16> %rA, %A |
| 209 | %D = or <8 x i16> %C, %B |
| 210 | ret <8 x i16> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 211 | } |
| 212 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 213 | ; (or (and rB, rC), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 214 | define <8 x i16> @selectbits_v8i16_06(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 215 | %C = and <8 x i16> %rB, %rC |
| 216 | %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1, |
| 217 | i16 -1, i16 -1, i16 -1, i16 -1 > |
| 218 | %B = and <8 x i16> %rA, %A |
| 219 | %D = or <8 x i16> %C, %B |
| 220 | ret <8 x i16> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 221 | } |
| 222 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 223 | ; (or (and rA, (not rC)), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 224 | define <8 x i16> @selectbits_v8i16_07(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 225 | %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1, |
| 226 | i16 -1, i16 -1, i16 -1, i16 -1 > |
| 227 | %B = and <8 x i16> %rA, %A |
| 228 | %C = and <8 x i16> %rB, %rC |
| 229 | %D = or <8 x i16> %C, %B |
| 230 | ret <8 x i16> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 231 | } |
| 232 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 233 | ; (or (and rA, (not rC)), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 234 | define <8 x i16> @selectbits_v8i16_08(<8 x i16> %rA, <8 x i16> %rB, <8 x i16> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 235 | %A = xor <8 x i16> %rC, < i16 -1, i16 -1, i16 -1, i16 -1, |
| 236 | i16 -1, i16 -1, i16 -1, i16 -1 > |
| 237 | %B = and <8 x i16> %rA, %A |
| 238 | %C = and <8 x i16> %rC, %rB |
| 239 | %D = or <8 x i16> %C, %B |
| 240 | ret <8 x i16> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 241 | } |
| 242 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 243 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 244 | ; v16i8 |
| 245 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 246 | |
| 247 | ; (or (and rC, rB), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 248 | define <16 x i8> @selectbits_v16i8_01(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 249 | %C = and <16 x i8> %rC, %rB |
| 250 | %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1, |
| 251 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 252 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 253 | i8 -1, i8 -1, i8 -1, i8 -1 > |
| 254 | %B = and <16 x i8> %A, %rA |
| 255 | %D = or <16 x i8> %C, %B |
| 256 | ret <16 x i8> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 257 | } |
| 258 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 259 | ; (or (and rB, rC), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 260 | define <16 x i8> @selectbits_v16i8_02(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 261 | %C = and <16 x i8> %rB, %rC |
| 262 | %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1, |
| 263 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 264 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 265 | i8 -1, i8 -1, i8 -1, i8 -1 > |
| 266 | %B = and <16 x i8> %A, %rA |
| 267 | %D = or <16 x i8> %C, %B |
| 268 | ret <16 x i8> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 269 | } |
| 270 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 271 | ; (or (and (not rC), rA), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 272 | define <16 x i8> @selectbits_v16i8_03(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 273 | %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1, |
| 274 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 275 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 276 | i8 -1, i8 -1, i8 -1, i8 -1 > |
| 277 | %B = and <16 x i8> %A, %rA |
| 278 | %C = and <16 x i8> %rB, %rC |
| 279 | %D = or <16 x i8> %C, %B |
| 280 | ret <16 x i8> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 281 | } |
| 282 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 283 | ; (or (and (not rC), rA), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 284 | define <16 x i8> @selectbits_v16i8_04(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 285 | %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1, |
| 286 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 287 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 288 | i8 -1, i8 -1, i8 -1, i8 -1 > |
| 289 | %B = and <16 x i8> %A, %rA |
| 290 | %C = and <16 x i8> %rC, %rB |
| 291 | %D = or <16 x i8> %C, %B |
| 292 | ret <16 x i8> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 293 | } |
| 294 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 295 | ; (or (and rC, rB), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 296 | define <16 x i8> @selectbits_v16i8_05(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 297 | %C = and <16 x i8> %rC, %rB |
| 298 | %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1, |
| 299 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 300 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 301 | i8 -1, i8 -1, i8 -1, i8 -1 > |
| 302 | %B = and <16 x i8> %rA, %A |
| 303 | %D = or <16 x i8> %C, %B |
| 304 | ret <16 x i8> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 305 | } |
| 306 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 307 | ; (or (and rB, rC), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 308 | define <16 x i8> @selectbits_v16i8_06(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 309 | %C = and <16 x i8> %rB, %rC |
| 310 | %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1, |
| 311 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 312 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 313 | i8 -1, i8 -1, i8 -1, i8 -1 > |
| 314 | %B = and <16 x i8> %rA, %A |
| 315 | %D = or <16 x i8> %C, %B |
| 316 | ret <16 x i8> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 317 | } |
| 318 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 319 | ; (or (and rA, (not rC)), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 320 | define <16 x i8> @selectbits_v16i8_07(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 321 | %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1, |
| 322 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 323 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 324 | i8 -1, i8 -1, i8 -1, i8 -1 > |
| 325 | %B = and <16 x i8> %rA, %A |
| 326 | %C = and <16 x i8> %rB, %rC |
| 327 | %D = or <16 x i8> %C, %B |
| 328 | ret <16 x i8> %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 329 | } |
| 330 | |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 331 | ; (or (and rA, (not rC)), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 332 | define <16 x i8> @selectbits_v16i8_08(<16 x i8> %rA, <16 x i8> %rB, <16 x i8> %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 333 | %A = xor <16 x i8> %rC, < i8 -1, i8 -1, i8 -1, i8 -1, |
| 334 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 335 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 336 | i8 -1, i8 -1, i8 -1, i8 -1 > |
| 337 | %B = and <16 x i8> %rA, %A |
| 338 | %C = and <16 x i8> %rC, %rB |
| 339 | %D = or <16 x i8> %C, %B |
| 340 | ret <16 x i8> %D |
| 341 | } |
| 342 | |
| 343 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 344 | ; i32 |
| 345 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 346 | |
| 347 | ; (or (and rC, rB), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 348 | define i32 @selectbits_i32_01(i32 %rA, i32 %rB, i32 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 349 | %C = and i32 %rC, %rB |
| 350 | %A = xor i32 %rC, -1 |
| 351 | %B = and i32 %A, %rA |
| 352 | %D = or i32 %C, %B |
| 353 | ret i32 %D |
| 354 | } |
| 355 | |
| 356 | ; (or (and rB, rC), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 357 | define i32 @selectbits_i32_02(i32 %rA, i32 %rB, i32 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 358 | %C = and i32 %rB, %rC |
| 359 | %A = xor i32 %rC, -1 |
| 360 | %B = and i32 %A, %rA |
| 361 | %D = or i32 %C, %B |
| 362 | ret i32 %D |
| 363 | } |
| 364 | |
| 365 | ; (or (and (not rC), rA), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 366 | define i32 @selectbits_i32_03(i32 %rA, i32 %rB, i32 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 367 | %A = xor i32 %rC, -1 |
| 368 | %B = and i32 %A, %rA |
| 369 | %C = and i32 %rB, %rC |
| 370 | %D = or i32 %C, %B |
| 371 | ret i32 %D |
| 372 | } |
| 373 | |
| 374 | ; (or (and (not rC), rA), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 375 | define i32 @selectbits_i32_04(i32 %rA, i32 %rB, i32 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 376 | %A = xor i32 %rC, -1 |
| 377 | %B = and i32 %A, %rA |
| 378 | %C = and i32 %rC, %rB |
| 379 | %D = or i32 %C, %B |
| 380 | ret i32 %D |
| 381 | } |
| 382 | |
| 383 | ; (or (and rC, rB), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 384 | define i32 @selectbits_i32_05(i32 %rA, i32 %rB, i32 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 385 | %C = and i32 %rC, %rB |
| 386 | %A = xor i32 %rC, -1 |
| 387 | %B = and i32 %rA, %A |
| 388 | %D = or i32 %C, %B |
| 389 | ret i32 %D |
| 390 | } |
| 391 | |
| 392 | ; (or (and rB, rC), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 393 | define i32 @selectbits_i32_06(i32 %rA, i32 %rB, i32 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 394 | %C = and i32 %rB, %rC |
| 395 | %A = xor i32 %rC, -1 |
| 396 | %B = and i32 %rA, %A |
| 397 | %D = or i32 %C, %B |
| 398 | ret i32 %D |
| 399 | } |
| 400 | |
| 401 | ; (or (and rA, (not rC)), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 402 | define i32 @selectbits_i32_07(i32 %rA, i32 %rB, i32 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 403 | %A = xor i32 %rC, -1 |
| 404 | %B = and i32 %rA, %A |
| 405 | %C = and i32 %rB, %rC |
| 406 | %D = or i32 %C, %B |
| 407 | ret i32 %D |
| 408 | } |
| 409 | |
| 410 | ; (or (and rA, (not rC)), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 411 | define i32 @selectbits_i32_08(i32 %rA, i32 %rB, i32 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 412 | %A = xor i32 %rC, -1 |
| 413 | %B = and i32 %rA, %A |
| 414 | %C = and i32 %rC, %rB |
| 415 | %D = or i32 %C, %B |
| 416 | ret i32 %D |
| 417 | } |
| 418 | |
| 419 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 420 | ; i16 |
| 421 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 422 | |
| 423 | ; (or (and rC, rB), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 424 | define i16 @selectbits_i16_01(i16 %rA, i16 %rB, i16 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 425 | %C = and i16 %rC, %rB |
| 426 | %A = xor i16 %rC, -1 |
| 427 | %B = and i16 %A, %rA |
| 428 | %D = or i16 %C, %B |
| 429 | ret i16 %D |
| 430 | } |
| 431 | |
| 432 | ; (or (and rB, rC), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 433 | define i16 @selectbits_i16_02(i16 %rA, i16 %rB, i16 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 434 | %C = and i16 %rB, %rC |
| 435 | %A = xor i16 %rC, -1 |
| 436 | %B = and i16 %A, %rA |
| 437 | %D = or i16 %C, %B |
| 438 | ret i16 %D |
| 439 | } |
| 440 | |
| 441 | ; (or (and (not rC), rA), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 442 | define i16 @selectbits_i16_03(i16 %rA, i16 %rB, i16 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 443 | %A = xor i16 %rC, -1 |
| 444 | %B = and i16 %A, %rA |
| 445 | %C = and i16 %rB, %rC |
| 446 | %D = or i16 %C, %B |
| 447 | ret i16 %D |
| 448 | } |
| 449 | |
| 450 | ; (or (and (not rC), rA), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 451 | define i16 @selectbits_i16_04(i16 %rA, i16 %rB, i16 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 452 | %A = xor i16 %rC, -1 |
| 453 | %B = and i16 %A, %rA |
| 454 | %C = and i16 %rC, %rB |
| 455 | %D = or i16 %C, %B |
| 456 | ret i16 %D |
| 457 | } |
| 458 | |
| 459 | ; (or (and rC, rB), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 460 | define i16 @selectbits_i16_05(i16 %rA, i16 %rB, i16 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 461 | %C = and i16 %rC, %rB |
| 462 | %A = xor i16 %rC, -1 |
| 463 | %B = and i16 %rA, %A |
| 464 | %D = or i16 %C, %B |
| 465 | ret i16 %D |
| 466 | } |
| 467 | |
| 468 | ; (or (and rB, rC), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 469 | define i16 @selectbits_i16_06(i16 %rA, i16 %rB, i16 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 470 | %C = and i16 %rB, %rC |
| 471 | %A = xor i16 %rC, -1 |
| 472 | %B = and i16 %rA, %A |
| 473 | %D = or i16 %C, %B |
| 474 | ret i16 %D |
| 475 | } |
| 476 | |
| 477 | ; (or (and rA, (not rC)), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 478 | define i16 @selectbits_i16_07(i16 %rA, i16 %rB, i16 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 479 | %A = xor i16 %rC, -1 |
| 480 | %B = and i16 %rA, %A |
| 481 | %C = and i16 %rB, %rC |
| 482 | %D = or i16 %C, %B |
| 483 | ret i16 %D |
| 484 | } |
| 485 | |
| 486 | ; (or (and rA, (not rC)), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 487 | define i16 @selectbits_i16_08(i16 %rA, i16 %rB, i16 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 488 | %A = xor i16 %rC, -1 |
| 489 | %B = and i16 %rA, %A |
| 490 | %C = and i16 %rC, %rB |
| 491 | %D = or i16 %C, %B |
| 492 | ret i16 %D |
| 493 | } |
| 494 | |
| 495 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 496 | ; i8 |
| 497 | ;-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~ |
| 498 | |
| 499 | ; (or (and rC, rB), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 500 | define i8 @selectbits_i8_01(i8 %rA, i8 %rB, i8 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 501 | %C = and i8 %rC, %rB |
| 502 | %A = xor i8 %rC, -1 |
| 503 | %B = and i8 %A, %rA |
| 504 | %D = or i8 %C, %B |
| 505 | ret i8 %D |
| 506 | } |
| 507 | |
| 508 | ; (or (and rB, rC), (and (not rC), rA)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 509 | define i8 @selectbits_i8_02(i8 %rA, i8 %rB, i8 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 510 | %C = and i8 %rB, %rC |
| 511 | %A = xor i8 %rC, -1 |
| 512 | %B = and i8 %A, %rA |
| 513 | %D = or i8 %C, %B |
| 514 | ret i8 %D |
| 515 | } |
| 516 | |
| 517 | ; (or (and (not rC), rA), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 518 | define i8 @selectbits_i8_03(i8 %rA, i8 %rB, i8 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 519 | %A = xor i8 %rC, -1 |
| 520 | %B = and i8 %A, %rA |
| 521 | %C = and i8 %rB, %rC |
| 522 | %D = or i8 %C, %B |
| 523 | ret i8 %D |
| 524 | } |
| 525 | |
| 526 | ; (or (and (not rC), rA), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 527 | define i8 @selectbits_i8_04(i8 %rA, i8 %rB, i8 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 528 | %A = xor i8 %rC, -1 |
| 529 | %B = and i8 %A, %rA |
| 530 | %C = and i8 %rC, %rB |
| 531 | %D = or i8 %C, %B |
| 532 | ret i8 %D |
| 533 | } |
| 534 | |
| 535 | ; (or (and rC, rB), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 536 | define i8 @selectbits_i8_05(i8 %rA, i8 %rB, i8 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 537 | %C = and i8 %rC, %rB |
| 538 | %A = xor i8 %rC, -1 |
| 539 | %B = and i8 %rA, %A |
| 540 | %D = or i8 %C, %B |
| 541 | ret i8 %D |
| 542 | } |
| 543 | |
| 544 | ; (or (and rB, rC), (and rA, (not rC))) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 545 | define i8 @selectbits_i8_06(i8 %rA, i8 %rB, i8 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 546 | %C = and i8 %rB, %rC |
| 547 | %A = xor i8 %rC, -1 |
| 548 | %B = and i8 %rA, %A |
| 549 | %D = or i8 %C, %B |
| 550 | ret i8 %D |
| 551 | } |
| 552 | |
| 553 | ; (or (and rA, (not rC)), (and rB, rC)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 554 | define i8 @selectbits_i8_07(i8 %rA, i8 %rB, i8 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 555 | %A = xor i8 %rC, -1 |
| 556 | %B = and i8 %rA, %A |
| 557 | %C = and i8 %rB, %rC |
| 558 | %D = or i8 %C, %B |
| 559 | ret i8 %D |
| 560 | } |
| 561 | |
| 562 | ; (or (and rA, (not rC)), (and rC, rB)) |
pingbak | 2f387e8 | 2009-01-26 03:31:40 +0000 | [diff] [blame] | 563 | define i8 @selectbits_i8_08(i8 %rA, i8 %rB, i8 %rC) { |
Scott Michel | e26d9a6 | 2008-03-05 23:00:19 +0000 | [diff] [blame] | 564 | %A = xor i8 %rC, -1 |
| 565 | %B = and i8 %rA, %A |
| 566 | %C = and i8 %rC, %rB |
| 567 | %D = or i8 %C, %B |
| 568 | ret i8 %D |
Scott Michel | 314acc2 | 2007-12-19 20:50:49 +0000 | [diff] [blame] | 569 | } |