Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-unimplemented-simd -mattr=+simd128 | FileCheck %s --check-prefixes CHECK,SIMD128,SIMD128-SLOW |
| 2 | ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-unimplemented-simd -mattr=+simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,SIMD128,SIMD128-FAST |
Thomas Lively | 4b47d08 | 2018-10-05 00:45:20 +0000 | [diff] [blame] | 3 | ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+simd128 | FileCheck %s --check-prefixes CHECK,SIMD128-VM |
| 4 | ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,SIMD128-VM |
| 5 | ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=-simd128 | FileCheck %s --check-prefixes CHECK,NO-SIMD128 |
| 6 | ; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=-simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,NO-SIMD128 |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 7 | |
| 8 | ; Test that basic SIMD128 arithmetic operations assemble as expected. |
| 9 | |
| 10 | target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" |
Sam Clegg | a590800 | 2018-05-10 17:49:11 +0000 | [diff] [blame] | 11 | target triple = "wasm32-unknown-unknown" |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 12 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 13 | ; ============================================================================== |
| 14 | ; 16 x i8 |
| 15 | ; ============================================================================== |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 16 | ; CHECK-LABEL: add_v16i8: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 17 | ; NO-SIMD128-NOT: i8x16 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 18 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 19 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 20 | ; SIMD128-NEXT: i8x16.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 21 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 22 | define <16 x i8> @add_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 23 | %a = add <16 x i8> %x, %y |
| 24 | ret <16 x i8> %a |
| 25 | } |
| 26 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 27 | ; CHECK-LABEL: sub_v16i8: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 28 | ; NO-SIMD128-NOT: i8x16 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 29 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 30 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 31 | ; SIMD128-NEXT: i8x16.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 32 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 33 | define <16 x i8> @sub_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 34 | %a = sub <16 x i8> %x, %y |
| 35 | ret <16 x i8> %a |
| 36 | } |
| 37 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 38 | ; CHECK-LABEL: mul_v16i8: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 39 | ; NO-SIMD128-NOT: i8x16 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 40 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 41 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 42 | ; SIMD128-NEXT: i8x16.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 43 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 44 | define <16 x i8> @mul_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 45 | %a = mul <16 x i8> %x, %y |
| 46 | ret <16 x i8> %a |
| 47 | } |
| 48 | |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 49 | ; CHECK-LABEL: neg_v16i8: |
| 50 | ; NO-SIMD128-NOT: i8x16 |
| 51 | ; SIMD128-NEXT: .param v128{{$}} |
| 52 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 53 | ; SIMD128-NEXT: i8x16.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 54 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 55 | define <16 x i8> @neg_v16i8(<16 x i8> %x) { |
| 56 | %a = sub <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, |
| 57 | i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0>, |
| 58 | %x |
| 59 | ret <16 x i8> %a |
| 60 | } |
| 61 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 62 | ; CHECK-LABEL: shl_v16i8: |
| 63 | ; NO-SIMD128-NOT: i8x16 |
| 64 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 65 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 66 | ; SIMD128-NEXT: i8x16.shl $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 67 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 68 | define <16 x i8> @shl_v16i8(<16 x i8> %v, i8 %x) { |
| 69 | %t = insertelement <16 x i8> undef, i8 %x, i32 0 |
| 70 | %s = shufflevector <16 x i8> %t, <16 x i8> undef, |
| 71 | <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, |
| 72 | i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 73 | %a = shl <16 x i8> %v, %s |
| 74 | ret <16 x i8> %a |
| 75 | } |
| 76 | |
| 77 | ; CHECK-LABEL: shl_const_v16i8: |
| 78 | ; NO-SIMD128-NOT: i8x16 |
| 79 | ; SIMD128-NEXT: .param v128{{$}} |
| 80 | ; SIMD128-NEXT: .result v128{{$}} |
| 81 | ; SIMD128-NEXT: i32.const $push[[L0:[0-9]+]]=, 5 |
| 82 | ; SIMD128-NEXT: i8x16.shl $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 83 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 84 | define <16 x i8> @shl_const_v16i8(<16 x i8> %v) { |
| 85 | %a = shl <16 x i8> %v, |
| 86 | <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, |
| 87 | i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5> |
| 88 | ret <16 x i8> %a |
| 89 | } |
| 90 | |
| 91 | ; CHECK-LABEL: shr_s_v16i8: |
| 92 | ; NO-SIMD128-NOT: i8x16 |
| 93 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 94 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 95 | ; SIMD128-NEXT: i8x16.shr_s $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 96 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 97 | define <16 x i8> @shr_s_v16i8(<16 x i8> %v, i8 %x) { |
| 98 | %t = insertelement <16 x i8> undef, i8 %x, i32 0 |
| 99 | %s = shufflevector <16 x i8> %t, <16 x i8> undef, |
| 100 | <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, |
| 101 | i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 102 | %a = ashr <16 x i8> %v, %s |
| 103 | ret <16 x i8> %a |
| 104 | } |
| 105 | |
| 106 | ; CHECK-LABEL: shr_u_v16i8: |
| 107 | ; NO-SIMD128-NOT: i8x16 |
| 108 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 109 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 110 | ; SIMD128-NEXT: i8x16.shr_u $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 111 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 112 | define <16 x i8> @shr_u_v16i8(<16 x i8> %v, i8 %x) { |
| 113 | %t = insertelement <16 x i8> undef, i8 %x, i32 0 |
| 114 | %s = shufflevector <16 x i8> %t, <16 x i8> undef, |
| 115 | <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, |
| 116 | i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 117 | %a = lshr <16 x i8> %v, %s |
| 118 | ret <16 x i8> %a |
| 119 | } |
| 120 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 121 | ; CHECK-LABEL: and_v16i8: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 122 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 123 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 124 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 125 | ; SIMD128-NEXT: v128.and $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 126 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 127 | define <16 x i8> @and_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 128 | %a = and <16 x i8> %x, %y |
| 129 | ret <16 x i8> %a |
| 130 | } |
| 131 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 132 | ; CHECK-LABEL: or_v16i8: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 133 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 134 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 135 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 136 | ; SIMD128-NEXT: v128.or $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 137 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 138 | define <16 x i8> @or_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 139 | %a = or <16 x i8> %x, %y |
| 140 | ret <16 x i8> %a |
| 141 | } |
| 142 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 143 | ; CHECK-LABEL: xor_v16i8: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 144 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 145 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 146 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 147 | ; SIMD128-NEXT: v128.xor $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 148 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 149 | define <16 x i8> @xor_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 150 | %a = xor <16 x i8> %x, %y |
| 151 | ret <16 x i8> %a |
| 152 | } |
| 153 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 154 | ; CHECK-LABEL: not_v16i8: |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 155 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 156 | ; SIMD128-NEXT: .param v128{{$}} |
| 157 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 158 | ; SIMD128-NEXT: v128.not $push[[R:[0-9]+]]=, $0{{$}} |
| 159 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 160 | define <16 x i8> @not_v16i8(<16 x i8> %x) { |
| 161 | %a = xor <16 x i8> %x, <i8 -1, i8 -1, i8 -1, i8 -1, |
| 162 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 163 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 164 | i8 -1, i8 -1, i8 -1, i8 -1> |
| 165 | ret <16 x i8> %a |
| 166 | } |
| 167 | |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 168 | ; CHECK-LABEL: bitselect_v16i8: |
| 169 | ; NO-SIMD128-NOT: v128 |
| 170 | ; SIMD128-NEXT: .param v128, v128, v128{{$}} |
| 171 | ; SIMD128-NEXT: .result v128{{$}} |
| 172 | ; SIMD128-SLOW-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $1, $2, $0{{$}} |
| 173 | ; SIMD128-SLOW-NEXT: return $pop[[R]]{{$}} |
| 174 | ; SIMD128-FAST-NEXT: v128.and |
| 175 | ; SIMD128-FAST-NEXT: v128.not |
| 176 | ; SIMD128-FAST-NEXT: v128.and |
| 177 | ; SIMD128-FAST-NEXT: v128.or |
| 178 | ; SIMD128-FAST-NEXT: return |
| 179 | define <16 x i8> @bitselect_v16i8(<16 x i8> %c, <16 x i8> %v1, <16 x i8> %v2) { |
| 180 | %masked_v1 = and <16 x i8> %c, %v1 |
| 181 | %inv_mask = xor <16 x i8> %c, |
| 182 | <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, |
| 183 | i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1> |
| 184 | %masked_v2 = and <16 x i8> %inv_mask, %v2 |
| 185 | %a = or <16 x i8> %masked_v1, %masked_v2 |
| 186 | ret <16 x i8> %a |
| 187 | } |
| 188 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 189 | ; ============================================================================== |
| 190 | ; 8 x i16 |
| 191 | ; ============================================================================== |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 192 | ; CHECK-LABEL: add_v8i16: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 193 | ; NO-SIMD128-NOT: i16x8 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 194 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 195 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 196 | ; SIMD128-NEXT: i16x8.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 197 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 198 | define <8 x i16> @add_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 199 | %a = add <8 x i16> %x, %y |
| 200 | ret <8 x i16> %a |
| 201 | } |
| 202 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 203 | ; CHECK-LABEL: sub_v8i16: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 204 | ; NO-SIMD128-NOT: i16x8 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 205 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 206 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 207 | ; SIMD128-NEXT: i16x8.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 208 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 209 | define <8 x i16> @sub_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 210 | %a = sub <8 x i16> %x, %y |
| 211 | ret <8 x i16> %a |
| 212 | } |
| 213 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 214 | ; CHECK-LABEL: mul_v8i16: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 215 | ; NO-SIMD128-NOT: i16x8 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 216 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 217 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 218 | ; SIMD128-NEXT: i16x8.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 219 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 220 | define <8 x i16> @mul_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 221 | %a = mul <8 x i16> %x, %y |
| 222 | ret <8 x i16> %a |
| 223 | } |
| 224 | |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 225 | ; CHECK-LABEL: neg_v8i16: |
| 226 | ; NO-SIMD128-NOT: i16x8 |
| 227 | ; SIMD128-NEXT: .param v128{{$}} |
| 228 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 229 | ; SIMD128-NEXT: i16x8.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 230 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 231 | define <8 x i16> @neg_v8i16(<8 x i16> %x) { |
| 232 | %a = sub <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, |
| 233 | %x |
| 234 | ret <8 x i16> %a |
| 235 | } |
| 236 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 237 | ; CHECK-LABEL: shl_v8i16: |
| 238 | ; NO-SIMD128-NOT: i16x8 |
| 239 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 240 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 241 | ; SIMD128-NEXT: i16x8.shl $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 242 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 243 | define <8 x i16> @shl_v8i16(<8 x i16> %v, i16 %x) { |
| 244 | %t = insertelement <8 x i16> undef, i16 %x, i32 0 |
| 245 | %s = shufflevector <8 x i16> %t, <8 x i16> undef, |
| 246 | <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 247 | %a = shl <8 x i16> %v, %s |
| 248 | ret <8 x i16> %a |
| 249 | } |
| 250 | |
| 251 | ; CHECK-LABEL: shl_const_v8i16: |
| 252 | ; NO-SIMD128-NOT: i16x8 |
| 253 | ; SIMD128-NEXT: .param v128{{$}} |
| 254 | ; SIMD128-NEXT: .result v128{{$}} |
| 255 | ; SIMD128-NEXT: i32.const $push[[L0:[0-9]+]]=, 5 |
| 256 | ; SIMD128-NEXT: i16x8.shl $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 257 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 258 | define <8 x i16> @shl_const_v8i16(<8 x i16> %v) { |
| 259 | %a = shl <8 x i16> %v, |
| 260 | <i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5> |
| 261 | ret <8 x i16> %a |
| 262 | } |
| 263 | |
| 264 | ; CHECK-LABEL: shr_s_v8i16: |
| 265 | ; NO-SIMD128-NOT: i16x8 |
| 266 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 267 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 268 | ; SIMD128-NEXT: i16x8.shr_s $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 269 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 270 | define <8 x i16> @shr_s_v8i16(<8 x i16> %v, i16 %x) { |
| 271 | %t = insertelement <8 x i16> undef, i16 %x, i32 0 |
| 272 | %s = shufflevector <8 x i16> %t, <8 x i16> undef, |
| 273 | <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 274 | %a = ashr <8 x i16> %v, %s |
| 275 | ret <8 x i16> %a |
| 276 | } |
| 277 | |
| 278 | ; CHECK-LABEL: shr_u_v8i16: |
| 279 | ; NO-SIMD128-NOT: i16x8 |
| 280 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 281 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 282 | ; SIMD128-NEXT: i16x8.shr_u $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 283 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 284 | define <8 x i16> @shr_u_v8i16(<8 x i16> %v, i16 %x) { |
| 285 | %t = insertelement <8 x i16> undef, i16 %x, i32 0 |
| 286 | %s = shufflevector <8 x i16> %t, <8 x i16> undef, |
| 287 | <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 288 | %a = lshr <8 x i16> %v, %s |
| 289 | ret <8 x i16> %a |
| 290 | } |
| 291 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 292 | ; CHECK-LABEL: and_v8i16: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 293 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 294 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 295 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 296 | ; SIMD128-NEXT: v128.and $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 297 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 298 | define <8 x i16> @and_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 299 | %a = and <8 x i16> %x, %y |
| 300 | ret <8 x i16> %a |
| 301 | } |
| 302 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 303 | ; CHECK-LABEL: or_v8i16: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 304 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 305 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 306 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 307 | ; SIMD128-NEXT: v128.or $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 308 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 309 | define <8 x i16> @or_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 310 | %a = or <8 x i16> %x, %y |
| 311 | ret <8 x i16> %a |
| 312 | } |
| 313 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 314 | ; CHECK-LABEL: xor_v8i16: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 315 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 316 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 317 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 318 | ; SIMD128-NEXT: v128.xor $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 319 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 320 | define <8 x i16> @xor_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 321 | %a = xor <8 x i16> %x, %y |
| 322 | ret <8 x i16> %a |
| 323 | } |
| 324 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 325 | ; CHECK-LABEL: not_v8i16: |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 326 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 327 | ; SIMD128-NEXT: .param v128{{$}} |
| 328 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 329 | ; SIMD128-NEXT: v128.not $push[[R:[0-9]+]]=, $0{{$}} |
| 330 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 331 | define <8 x i16> @not_v8i16(<8 x i16> %x) { |
| 332 | %a = xor <8 x i16> %x, <i16 -1, i16 -1, i16 -1, i16 -1, |
| 333 | i16 -1, i16 -1, i16 -1, i16 -1> |
| 334 | ret <8 x i16> %a |
| 335 | } |
| 336 | |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 337 | ; CHECK-LABEL: bitselect_v8i16: |
| 338 | ; NO-SIMD128-NOT: v128 |
| 339 | ; SIMD128-NEXT: .param v128, v128, v128{{$}} |
| 340 | ; SIMD128-NEXT: .result v128{{$}} |
| 341 | ; SIMD128-SLOW-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $1, $2, $0{{$}} |
| 342 | ; SIMD128-SLOW-NEXT: return $pop[[R]]{{$}} |
| 343 | ; SIMD128-FAST-NEXT: v128.and |
| 344 | ; SIMD128-FAST-NEXT: v128.not |
| 345 | ; SIMD128-FAST-NEXT: v128.and |
| 346 | ; SIMD128-FAST-NEXT: v128.or |
| 347 | ; SIMD128-FAST-NEXT: return |
| 348 | define <8 x i16> @bitselect_v8i16(<8 x i16> %c, <8 x i16> %v1, <8 x i16> %v2) { |
| 349 | %masked_v1 = and <8 x i16> %v1, %c |
| 350 | %inv_mask = xor <8 x i16> |
| 351 | <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>, |
| 352 | %c |
| 353 | %masked_v2 = and <8 x i16> %v2, %inv_mask |
| 354 | %a = or <8 x i16> %masked_v1, %masked_v2 |
| 355 | ret <8 x i16> %a |
| 356 | } |
| 357 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 358 | ; ============================================================================== |
| 359 | ; 4 x i32 |
| 360 | ; ============================================================================== |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 361 | ; CHECK-LABEL: add_v4i32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 362 | ; NO-SIMD128-NOT: i32x4 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 363 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 364 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 365 | ; SIMD128-NEXT: i32x4.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 366 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 367 | define <4 x i32> @add_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 368 | %a = add <4 x i32> %x, %y |
| 369 | ret <4 x i32> %a |
| 370 | } |
| 371 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 372 | ; CHECK-LABEL: sub_v4i32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 373 | ; NO-SIMD128-NOT: i32x4 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 374 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 375 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 376 | ; SIMD128-NEXT: i32x4.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 377 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 378 | define <4 x i32> @sub_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 379 | %a = sub <4 x i32> %x, %y |
| 380 | ret <4 x i32> %a |
| 381 | } |
| 382 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 383 | ; CHECK-LABEL: mul_v4i32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 384 | ; NO-SIMD128-NOT: i32x4 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 385 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 386 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 387 | ; SIMD128-NEXT: i32x4.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 388 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 389 | define <4 x i32> @mul_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 390 | %a = mul <4 x i32> %x, %y |
| 391 | ret <4 x i32> %a |
| 392 | } |
| 393 | |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 394 | ; CHECK-LABEL: neg_v4i32: |
| 395 | ; NO-SIMD128-NOT: i32x4 |
| 396 | ; SIMD128-NEXT: .param v128{{$}} |
| 397 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 398 | ; SIMD128-NEXT: i32x4.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 399 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 400 | define <4 x i32> @neg_v4i32(<4 x i32> %x) { |
| 401 | %a = sub <4 x i32> <i32 0, i32 0, i32 0, i32 0>, %x |
| 402 | ret <4 x i32> %a |
| 403 | } |
| 404 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 405 | ; CHECK-LABEL: shl_v4i32: |
| 406 | ; NO-SIMD128-NOT: i32x4 |
| 407 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 408 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 409 | ; SIMD128-NEXT: i32x4.shl $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 410 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 411 | define <4 x i32> @shl_v4i32(<4 x i32> %v, i32 %x) { |
| 412 | %t = insertelement <4 x i32> undef, i32 %x, i32 0 |
| 413 | %s = shufflevector <4 x i32> %t, <4 x i32> undef, |
| 414 | <4 x i32> <i32 0, i32 0, i32 0, i32 0> |
| 415 | %a = shl <4 x i32> %v, %s |
| 416 | ret <4 x i32> %a |
| 417 | } |
| 418 | |
| 419 | ; CHECK-LABEL: shl_const_v4i32: |
| 420 | ; NO-SIMD128-NOT: i32x4 |
| 421 | ; SIMD128-NEXT: .param v128{{$}} |
| 422 | ; SIMD128-NEXT: .result v128{{$}} |
| 423 | ; SIMD128-NEXT: i32.const $push[[L0:[0-9]+]]=, 5 |
| 424 | ; SIMD128-NEXT: i32x4.shl $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 425 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 426 | define <4 x i32> @shl_const_v4i32(<4 x i32> %v) { |
| 427 | %a = shl <4 x i32> %v, <i32 5, i32 5, i32 5, i32 5> |
| 428 | ret <4 x i32> %a |
| 429 | } |
| 430 | |
| 431 | ; CHECK-LABEL: shr_s_v4i32: |
| 432 | ; NO-SIMD128-NOT: i32x4 |
| 433 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 434 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 435 | ; SIMD128-NEXT: i32x4.shr_s $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 436 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 437 | define <4 x i32> @shr_s_v4i32(<4 x i32> %v, i32 %x) { |
| 438 | %t = insertelement <4 x i32> undef, i32 %x, i32 0 |
| 439 | %s = shufflevector <4 x i32> %t, <4 x i32> undef, |
| 440 | <4 x i32> <i32 0, i32 0, i32 0, i32 0> |
| 441 | %a = ashr <4 x i32> %v, %s |
| 442 | ret <4 x i32> %a |
| 443 | } |
| 444 | |
| 445 | ; CHECK-LABEL: shr_u_v4i32: |
| 446 | ; NO-SIMD128-NOT: i32x4 |
| 447 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 448 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 449 | ; SIMD128-NEXT: i32x4.shr_u $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 450 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 451 | define <4 x i32> @shr_u_v4i32(<4 x i32> %v, i32 %x) { |
| 452 | %t = insertelement <4 x i32> undef, i32 %x, i32 0 |
| 453 | %s = shufflevector <4 x i32> %t, <4 x i32> undef, |
| 454 | <4 x i32> <i32 0, i32 0, i32 0, i32 0> |
| 455 | %a = lshr <4 x i32> %v, %s |
| 456 | ret <4 x i32> %a |
| 457 | } |
| 458 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 459 | ; CHECK-LABEL: and_v4i32: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 460 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 461 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 462 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 463 | ; SIMD128-NEXT: v128.and $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 464 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 465 | define <4 x i32> @and_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 466 | %a = and <4 x i32> %x, %y |
| 467 | ret <4 x i32> %a |
| 468 | } |
| 469 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 470 | ; CHECK-LABEL: or_v4i32: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 471 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 472 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 473 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 474 | ; SIMD128-NEXT: v128.or $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 475 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 476 | define <4 x i32> @or_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 477 | %a = or <4 x i32> %x, %y |
| 478 | ret <4 x i32> %a |
| 479 | } |
| 480 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 481 | ; CHECK-LABEL: xor_v4i32: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 482 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 483 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 484 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 485 | ; SIMD128-NEXT: v128.xor $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 486 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 487 | define <4 x i32> @xor_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 488 | %a = xor <4 x i32> %x, %y |
| 489 | ret <4 x i32> %a |
| 490 | } |
| 491 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 492 | ; CHECK-LABEL: not_v4i32: |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 493 | ; NO-SIMD128-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 494 | ; SIMD128-NEXT: .param v128{{$}} |
| 495 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 496 | ; SIMD128-NEXT: v128.not $push[[R:[0-9]+]]=, $0{{$}} |
| 497 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 498 | define <4 x i32> @not_v4i32(<4 x i32> %x) { |
| 499 | %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1> |
| 500 | ret <4 x i32> %a |
| 501 | } |
| 502 | |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 503 | ; CHECK-LABEL: bitselect_v4i32: |
| 504 | ; NO-SIMD128-NOT: v128 |
| 505 | ; SIMD128-NEXT: .param v128, v128, v128{{$}} |
| 506 | ; SIMD128-NEXT: .result v128{{$}} |
| 507 | ; SIMD128-SLOW-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $1, $2, $0{{$}} |
| 508 | ; SIMD128-SLOW-NEXT: return $pop[[R]]{{$}} |
| 509 | ; SIMD128-FAST-NEXT: v128.not |
| 510 | ; SIMD128-FAST-NEXT: v128.and |
| 511 | ; SIMD128-FAST-NEXT: v128.and |
| 512 | ; SIMD128-FAST-NEXT: v128.or |
| 513 | ; SIMD128-FAST-NEXT: return |
| 514 | define <4 x i32> @bitselect_v4i32(<4 x i32> %c, <4 x i32> %v1, <4 x i32> %v2) { |
| 515 | %masked_v1 = and <4 x i32> %c, %v1 |
| 516 | %inv_mask = xor <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, %c |
| 517 | %masked_v2 = and <4 x i32> %inv_mask, %v2 |
| 518 | %a = or <4 x i32> %masked_v2, %masked_v1 |
| 519 | ret <4 x i32> %a |
| 520 | } |
| 521 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 522 | ; ============================================================================== |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 523 | ; 2 x i64 |
| 524 | ; ============================================================================== |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 525 | ; CHECK-LABEL: add_v2i64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 526 | ; NO-SIMD128-NOT: i64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 527 | ; SIMD128-VM-NOT: i64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 528 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 529 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 530 | ; SIMD128-NEXT: i64x2.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 531 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 532 | define <2 x i64> @add_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 533 | %a = add <2 x i64> %x, %y |
| 534 | ret <2 x i64> %a |
| 535 | } |
| 536 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 537 | ; CHECK-LABEL: sub_v2i64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 538 | ; NO-SIMD128-NOT: i64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 539 | ; SIMD128-VM-NOT: i64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 540 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 541 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 542 | ; SIMD128-NEXT: i64x2.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 543 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 544 | define <2 x i64> @sub_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 545 | %a = sub <2 x i64> %x, %y |
| 546 | ret <2 x i64> %a |
| 547 | } |
| 548 | |
Thomas Lively | 2ee686d | 2018-08-22 23:06:27 +0000 | [diff] [blame] | 549 | ; v2i64.mul is not in spec |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 550 | ; CHECK-LABEL: mul_v2i64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 551 | ; NO-SIMD128-NOT: i64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 552 | ; SIMD128-VM-NOT: i64x2 |
Thomas Lively | 2ee686d | 2018-08-22 23:06:27 +0000 | [diff] [blame] | 553 | ; SIMD128-NOT: i64x2.mul |
| 554 | ; SIMD128: i64x2.extract_lane |
| 555 | ; SIMD128: i64.mul |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 556 | define <2 x i64> @mul_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 557 | %a = mul <2 x i64> %x, %y |
| 558 | ret <2 x i64> %a |
| 559 | } |
| 560 | |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 561 | ; CHECK-LABEL: neg_v2i64: |
| 562 | ; NO-SIMD128-NOT: i64x2 |
| 563 | ; SIMD128-NEXT: .param v128{{$}} |
| 564 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 565 | ; SIMD128-NEXT: i64x2.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 566 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 567 | define <2 x i64> @neg_v2i64(<2 x i64> %x) { |
| 568 | %a = sub <2 x i64> <i64 0, i64 0>, %x |
| 569 | ret <2 x i64> %a |
| 570 | } |
| 571 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 572 | ; CHECK-LABEL: shl_v2i64: |
| 573 | ; NO-SIMD128-NOT: i64x2 |
| 574 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 575 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 576 | ; SIMD128-NEXT: i64x2.shl $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 577 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 578 | define <2 x i64> @shl_v2i64(<2 x i64> %v, i32 %x) { |
| 579 | %x2 = zext i32 %x to i64 |
| 580 | %t = insertelement <2 x i64> undef, i64 %x2, i32 0 |
| 581 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 582 | %a = shl <2 x i64> %v, %s |
| 583 | ret <2 x i64> %a |
| 584 | } |
| 585 | |
| 586 | ; CHECK-LABEL: shl_nozext_v2i64: |
| 587 | ; NO-SIMD128-NOT: i64x2 |
| 588 | ; SIMD128-NEXT: .param v128, i64{{$}} |
| 589 | ; SIMD128-NEXT: .result v128{{$}} |
| 590 | ; SIMD128-NEXT: i32.wrap/i64 $push[[L0:[0-9]+]]=, $1{{$}} |
| 591 | ; SIMD128-NEXT: i64x2.shl $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 592 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 593 | define <2 x i64> @shl_nozext_v2i64(<2 x i64> %v, i64 %x) { |
| 594 | %t = insertelement <2 x i64> undef, i64 %x, i32 0 |
| 595 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 596 | %a = shl <2 x i64> %v, %s |
| 597 | ret <2 x i64> %a |
| 598 | } |
| 599 | |
| 600 | ; CHECK-LABEL: shl_const_v2i64: |
| 601 | ; NO-SIMD128-NOT: i64x2 |
| 602 | ; SIMD128-NEXT: .param v128{{$}} |
| 603 | ; SIMD128-NEXT: .result v128{{$}} |
| 604 | ; SIMD128-NEXT: i64.const $push[[L0:[0-9]+]]=, 5{{$}} |
| 605 | ; SIMD128-NEXT: i32.wrap/i64 $push[[L1:[0-9]+]]=, $pop[[L0]]{{$}} |
| 606 | ; SIMD128-NEXT: i64x2.shl $push[[R:[0-9]+]]=, $0, $pop[[L1]]{{$}} |
| 607 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 608 | define <2 x i64> @shl_const_v2i64(<2 x i64> %v) { |
| 609 | %a = shl <2 x i64> %v, <i64 5, i64 5> |
| 610 | ret <2 x i64> %a |
| 611 | } |
| 612 | |
| 613 | ; CHECK-LABEL: shr_s_v2i64: |
| 614 | ; NO-SIMD128-NOT: i64x2 |
| 615 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 616 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 617 | ; SIMD128-NEXT: i64x2.shr_s $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 618 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 619 | define <2 x i64> @shr_s_v2i64(<2 x i64> %v, i32 %x) { |
| 620 | %x2 = zext i32 %x to i64 |
| 621 | %t = insertelement <2 x i64> undef, i64 %x2, i32 0 |
| 622 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 623 | %a = ashr <2 x i64> %v, %s |
| 624 | ret <2 x i64> %a |
| 625 | } |
| 626 | |
| 627 | ; CHECK-LABEL: shr_s_nozext_v2i64: |
| 628 | ; NO-SIMD128-NOT: i64x2 |
| 629 | ; SIMD128-NEXT: .param v128, i64{{$}} |
| 630 | ; SIMD128-NEXT: .result v128{{$}} |
| 631 | ; SIMD128-NEXT: i32.wrap/i64 $push[[L0:[0-9]+]]=, $1{{$}} |
| 632 | ; SIMD128-NEXT: i64x2.shr_s $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 633 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 634 | define <2 x i64> @shr_s_nozext_v2i64(<2 x i64> %v, i64 %x) { |
| 635 | %t = insertelement <2 x i64> undef, i64 %x, i32 0 |
| 636 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 637 | %a = ashr <2 x i64> %v, %s |
| 638 | ret <2 x i64> %a |
| 639 | } |
| 640 | |
| 641 | ; CHECK-LABEL: shr_u_v2i64: |
| 642 | ; NO-SIMD128-NOT: i64x2 |
| 643 | ; SIMD128-NEXT: .param v128, i32{{$}} |
| 644 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 645 | ; SIMD128-NEXT: i64x2.shr_u $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 646 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 647 | define <2 x i64> @shr_u_v2i64(<2 x i64> %v, i32 %x) { |
| 648 | %x2 = zext i32 %x to i64 |
| 649 | %t = insertelement <2 x i64> undef, i64 %x2, i32 0 |
| 650 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 651 | %a = lshr <2 x i64> %v, %s |
| 652 | ret <2 x i64> %a |
| 653 | } |
| 654 | |
| 655 | ; CHECK-LABEL: shr_u_nozext_v2i64: |
| 656 | ; NO-SIMD128-NOT: i64x2 |
| 657 | ; SIMD128-NEXT: .param v128, i64{{$}} |
| 658 | ; SIMD128-NEXT: .result v128{{$}} |
| 659 | ; SIMD128-NEXT: i32.wrap/i64 $push[[L0:[0-9]+]]=, $1{{$}} |
| 660 | ; SIMD128-NEXT: i64x2.shr_u $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 661 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 662 | define <2 x i64> @shr_u_nozext_v2i64(<2 x i64> %v, i64 %x) { |
| 663 | %t = insertelement <2 x i64> undef, i64 %x, i32 0 |
| 664 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 665 | %a = lshr <2 x i64> %v, %s |
| 666 | ret <2 x i64> %a |
| 667 | } |
| 668 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 669 | ; CHECK-LABEL: and_v2i64: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 670 | ; NO-SIMD128-NOT: v128 |
| 671 | ; SIMD128-VM-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 672 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 673 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 674 | ; SIMD128-NEXT: v128.and $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 675 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 676 | define <2 x i64> @and_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 677 | %a = and <2 x i64> %x, %y |
| 678 | ret <2 x i64> %a |
| 679 | } |
| 680 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 681 | ; CHECK-LABEL: or_v2i64: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 682 | ; NO-SIMD128-NOT: v128 |
| 683 | ; SIMD128-VM-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 684 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 685 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 686 | ; SIMD128-NEXT: v128.or $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 687 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 688 | define <2 x i64> @or_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 689 | %a = or <2 x i64> %x, %y |
| 690 | ret <2 x i64> %a |
| 691 | } |
| 692 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 693 | ; CHECK-LABEL: xor_v2i64: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 694 | ; NO-SIMD128-NOT: v128 |
| 695 | ; SIMD128-VM-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 696 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 697 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 698 | ; SIMD128-NEXT: v128.xor $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 699 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 700 | define <2 x i64> @xor_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 701 | %a = xor <2 x i64> %x, %y |
| 702 | ret <2 x i64> %a |
| 703 | } |
| 704 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 705 | ; CHECK-LABEL: not_v2i64: |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 706 | ; NO-SIMD128-NOT: v128 |
| 707 | ; SIMD128-VM-NOT: v128 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 708 | ; SIMD128-NEXT: .param v128{{$}} |
| 709 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 710 | ; SIMD128-NEXT: v128.not $push[[R:[0-9]+]]=, $0{{$}} |
| 711 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 712 | define <2 x i64> @not_v2i64(<2 x i64> %x) { |
| 713 | %a = xor <2 x i64> %x, <i64 -1, i64 -1> |
| 714 | ret <2 x i64> %a |
| 715 | } |
| 716 | |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 717 | ; CHECK-LABEL: bitselect_v2i64: |
| 718 | ; NO-SIMD128-NOT: v128 |
| 719 | ; SIMD128-VM-NOT: v128 |
| 720 | ; SIMD128-NEXT: .param v128, v128, v128{{$}} |
| 721 | ; SIMD128-NEXT: .result v128{{$}} |
| 722 | ; SIMD128-SLOW-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $1, $2, $0{{$}} |
| 723 | ; SIMD128-SLOW-NEXT: return $pop[[R]]{{$}} |
| 724 | ; SIMD128-FAST-NEXT: v128.not |
| 725 | ; SIMD128-FAST-NEXT: v128.and |
| 726 | ; SIMD128-FAST-NEXT: v128.and |
| 727 | ; SIMD128-FAST-NEXT: v128.or |
| 728 | ; SIMD128-FAST-NEXT: return |
| 729 | define <2 x i64> @bitselect_v2i64(<2 x i64> %c, <2 x i64> %v1, <2 x i64> %v2) { |
| 730 | %masked_v1 = and <2 x i64> %v1, %c |
| 731 | %inv_mask = xor <2 x i64> <i64 -1, i64 -1>, %c |
| 732 | %masked_v2 = and <2 x i64> %v2, %inv_mask |
| 733 | %a = or <2 x i64> %masked_v2, %masked_v1 |
| 734 | ret <2 x i64> %a |
| 735 | } |
| 736 | |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 737 | ; ============================================================================== |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 738 | ; 4 x float |
| 739 | ; ============================================================================== |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 740 | ; CHECK-LABEL: neg_v4f32: |
| 741 | ; NO-SIMD128-NOT: f32x4 |
| 742 | ; SIMD128-NEXT: .param v128{{$}} |
| 743 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 744 | ; SIMD128-NEXT: f32x4.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 745 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 746 | define <4 x float> @neg_v4f32(<4 x float> %x) { |
| 747 | %a = fsub <4 x float> <float 0., float 0., float 0., float 0.>, %x |
| 748 | ret <4 x float> %a |
| 749 | } |
| 750 | |
Thomas Lively | aaf4e2c | 2018-09-18 21:45:12 +0000 | [diff] [blame] | 751 | ; CHECK-LABEL: abs_v4f32: |
| 752 | ; NO-SIMD128-NOT: f32x4 |
| 753 | ; SIMD128-NEXT: .param v128{{$}} |
| 754 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 5861536 | 2018-09-24 23:42:07 +0000 | [diff] [blame] | 755 | ; SIMD128-NEXT: f32x4.abs $push[[R:[0-9]+]]=, $0{{$}} |
| 756 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | aaf4e2c | 2018-09-18 21:45:12 +0000 | [diff] [blame] | 757 | declare <4 x float> @llvm.fabs.v4f32(<4 x float>) nounwind readnone |
| 758 | define <4 x float> @abs_v4f32(<4 x float> %x) { |
| 759 | %a = call <4 x float> @llvm.fabs.v4f32(<4 x float> %x) |
| 760 | ret <4 x float> %a |
| 761 | } |
| 762 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 763 | ; CHECK-LABEL: add_v4f32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 764 | ; NO-SIMD128-NOT: f32x4 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 765 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 766 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 767 | ; SIMD128-NEXT: f32x4.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 768 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 769 | define <4 x float> @add_v4f32(<4 x float> %x, <4 x float> %y) { |
| 770 | %a = fadd <4 x float> %x, %y |
| 771 | ret <4 x float> %a |
| 772 | } |
| 773 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 774 | ; CHECK-LABEL: sub_v4f32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 775 | ; NO-SIMD128-NOT: f32x4 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 776 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 777 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 778 | ; SIMD128-NEXT: f32x4.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 779 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 780 | define <4 x float> @sub_v4f32(<4 x float> %x, <4 x float> %y) { |
| 781 | %a = fsub <4 x float> %x, %y |
| 782 | ret <4 x float> %a |
| 783 | } |
| 784 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 785 | ; CHECK-LABEL: div_v4f32: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 786 | ; NO-SIMD128-NOT: f32x4 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 787 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 788 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 789 | ; SIMD128-NEXT: f32x4.div $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 790 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 791 | define <4 x float> @div_v4f32(<4 x float> %x, <4 x float> %y) { |
| 792 | %a = fdiv <4 x float> %x, %y |
| 793 | ret <4 x float> %a |
| 794 | } |
| 795 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 796 | ; CHECK-LABEL: mul_v4f32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 797 | ; NO-SIMD128-NOT: f32x4 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 798 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 799 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 800 | ; SIMD128-NEXT: f32x4.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 801 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 802 | define <4 x float> @mul_v4f32(<4 x float> %x, <4 x float> %y) { |
| 803 | %a = fmul <4 x float> %x, %y |
| 804 | ret <4 x float> %a |
| 805 | } |
| 806 | |
Thomas Lively | 12da0f9 | 2018-09-25 03:39:28 +0000 | [diff] [blame] | 807 | ; CHECK-LABEL: sqrt_v4f32: |
| 808 | ; NO-SIMD128-NOT: f32x4 |
| 809 | ; SIMD128-NEXT: .param v128{{$}} |
| 810 | ; SIMD128-NEXT: .result v128{{$}} |
| 811 | ; SIMD128-NEXT: f32x4.sqrt $push[[R:[0-9]+]]=, $0{{$}} |
| 812 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 813 | declare <4 x float> @llvm.sqrt.v4f32(<4 x float> %x) |
| 814 | define <4 x float> @sqrt_v4f32(<4 x float> %x) { |
| 815 | %a = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %x) |
| 816 | ret <4 x float> %a |
| 817 | } |
| 818 | |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 819 | ; ============================================================================== |
| 820 | ; 2 x double |
| 821 | ; ============================================================================== |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 822 | ; CHECK-LABEL: neg_v2f64: |
| 823 | ; NO-SIMD128-NOT: f64x2 |
| 824 | ; SIMD128-NEXT: .param v128{{$}} |
| 825 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 826 | ; SIMD128-NEXT: f64x2.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 827 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 828 | define <2 x double> @neg_v2f64(<2 x double> %x) { |
| 829 | %a = fsub <2 x double> <double 0., double 0.>, %x |
| 830 | ret <2 x double> %a |
| 831 | } |
| 832 | |
Thomas Lively | aaf4e2c | 2018-09-18 21:45:12 +0000 | [diff] [blame] | 833 | ; CHECK-LABEL: abs_v2f64: |
| 834 | ; NO-SIMD128-NOT: f64x2 |
| 835 | ; SIMD128-NEXT: .param v128{{$}} |
| 836 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 5861536 | 2018-09-24 23:42:07 +0000 | [diff] [blame] | 837 | ; SIMD128-NEXT: f64x2.abs $push[[R:[0-9]+]]=, $0{{$}} |
| 838 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | aaf4e2c | 2018-09-18 21:45:12 +0000 | [diff] [blame] | 839 | declare <2 x double> @llvm.fabs.v2f64(<2 x double>) nounwind readnone |
| 840 | define <2 x double> @abs_v2f64(<2 x double> %x) { |
| 841 | %a = call <2 x double> @llvm.fabs.v2f64(<2 x double> %x) |
| 842 | ret <2 x double> %a |
| 843 | } |
| 844 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 845 | ; CHECK-LABEL: add_v2f64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 846 | ; NO-SIMD128-NOT: f64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 847 | ; SIMD128-VM-NOT: f62x2 |
| 848 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 849 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 850 | ; SIMD128-NEXT: f64x2.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 851 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 852 | define <2 x double> @add_v2f64(<2 x double> %x, <2 x double> %y) { |
| 853 | %a = fadd <2 x double> %x, %y |
| 854 | ret <2 x double> %a |
| 855 | } |
| 856 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 857 | ; CHECK-LABEL: sub_v2f64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 858 | ; NO-SIMD128-NOT: f64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 859 | ; SIMD128-VM-NOT: f62x2 |
| 860 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 861 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 862 | ; SIMD128-NEXT: f64x2.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 863 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 864 | define <2 x double> @sub_v2f64(<2 x double> %x, <2 x double> %y) { |
| 865 | %a = fsub <2 x double> %x, %y |
| 866 | ret <2 x double> %a |
| 867 | } |
| 868 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 869 | ; CHECK-LABEL: div_v2f64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 870 | ; NO-SIMD128-NOT: f64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 871 | ; SIMD128-VM-NOT: f62x2 |
| 872 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 873 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 874 | ; SIMD128-NEXT: f64x2.div $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 875 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 876 | define <2 x double> @div_v2f64(<2 x double> %x, <2 x double> %y) { |
| 877 | %a = fdiv <2 x double> %x, %y |
| 878 | ret <2 x double> %a |
| 879 | } |
| 880 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 881 | ; CHECK-LABEL: mul_v2f64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 882 | ; NO-SIMD128-NOT: f64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 883 | ; SIMD128-VM-NOT: f62x2 |
| 884 | ; SIMD128-NEXT: .param v128, v128{{$}} |
| 885 | ; SIMD128-NEXT: .result v128{{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 886 | ; SIMD128-NEXT: f64x2.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 887 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 888 | define <2 x double> @mul_v2f64(<2 x double> %x, <2 x double> %y) { |
| 889 | %a = fmul <2 x double> %x, %y |
| 890 | ret <2 x double> %a |
| 891 | } |
Thomas Lively | 12da0f9 | 2018-09-25 03:39:28 +0000 | [diff] [blame] | 892 | |
| 893 | ; CHECK-LABEL: sqrt_v2f64: |
| 894 | ; NO-SIMD128-NOT: f64x2 |
| 895 | ; SIMD128-NEXT: .param v128{{$}} |
| 896 | ; SIMD128-NEXT: .result v128{{$}} |
| 897 | ; SIMD128-NEXT: f64x2.sqrt $push[[R:[0-9]+]]=, $0{{$}} |
| 898 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 899 | declare <2 x double> @llvm.sqrt.v2f64(<2 x double> %x) |
| 900 | define <2 x double> @sqrt_v2f64(<2 x double> %x) { |
| 901 | %a = call <2 x double> @llvm.sqrt.v2f64(<2 x double> %x) |
| 902 | ret <2 x double> %a |
| 903 | } |