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