Wouter van Oortmerssen | 8a9cb24 | 2018-08-27 15:45:51 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-unimplemented-simd -mattr=+simd128 --show-mc-encoding | FileCheck %s --check-prefixes CHECK,SIMD128 |
| 2 | ; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -wasm-enable-unimplemented-simd -mattr=+simd128 -fast-isel --show-mc-encoding | FileCheck %s --check-prefixes CHECK,SIMD128 |
| 3 | ; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+simd128 --show-mc-encoding | FileCheck %s --check-prefixes CHECK,SIMD128-VM |
| 4 | ; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+simd128 -fast-isel --show-mc-encoding | FileCheck %s --check-prefixes CHECK,SIMD128-VM |
| 5 | ; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=-simd128 --show-mc-encoding | FileCheck %s --check-prefixes CHECK,NO-SIMD128 |
| 6 | ; RUN: llc < %s -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=-simd128 -fast-isel --show-mc-encoding | 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 | ; ============================================================================== |
| 16 | ; CHECK-LABEL: add_v16i8 |
| 17 | ; NO-SIMD128-NOT: i8x16 |
| 18 | ; SIMD128: .param v128, v128{{$}} |
| 19 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 20 | ; SIMD128: i8x16.add $push0=, $0, $1 # encoding: [0xfd,0x18]{{$}} |
| 21 | ; SIMD128: return $pop0 # |
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 | |
| 27 | ; CHECK-LABEL: sub_v16i8 |
| 28 | ; NO-SIMD128-NOT: i8x16 |
| 29 | ; SIMD128: .param v128, v128{{$}} |
| 30 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 31 | ; SIMD128: i8x16.sub $push0=, $0, $1 # encoding: [0xfd,0x1c]{{$}} |
| 32 | ; SIMD128: return $pop0 # |
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 | |
| 38 | ; CHECK-LABEL: mul_v16i8 |
| 39 | ; NO-SIMD128-NOT: i8x16 |
| 40 | ; SIMD128: .param v128, v128{{$}} |
| 41 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 42 | ; SIMD128: i8x16.mul $push0=, $0, $1 # encoding: [0xfd,0x20]{{$}} |
| 43 | ; SIMD128: return $pop0 # |
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 | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 49 | ; CHECK-LABEL: and_v16i8 |
| 50 | ; NO-SIMD128-NOT: i8x16 |
| 51 | ; SIMD128: .param v128, v128{{$}} |
| 52 | ; SIMD128: .result v128{{$}} |
| 53 | ; SIMD128: v128.and $push0=, $0, $1 # encoding: [0xfd,0x3b]{{$}} |
| 54 | ; SIMD128: return $pop0 # |
| 55 | define <16 x i8> @and_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 56 | %a = and <16 x i8> %x, %y |
| 57 | ret <16 x i8> %a |
| 58 | } |
| 59 | |
| 60 | ; CHECK-LABEL: or_v16i8 |
| 61 | ; NO-SIMD128-NOT: i8x16 |
| 62 | ; SIMD128: .param v128, v128{{$}} |
| 63 | ; SIMD128: .result v128{{$}} |
| 64 | ; SIMD128: v128.or $push0=, $0, $1 # encoding: [0xfd,0x3c]{{$}} |
| 65 | ; SIMD128: return $pop0 # |
| 66 | define <16 x i8> @or_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 67 | %a = or <16 x i8> %x, %y |
| 68 | ret <16 x i8> %a |
| 69 | } |
| 70 | |
| 71 | ; CHECK-LABEL: xor_v16i8 |
| 72 | ; NO-SIMD128-NOT: i8x16 |
| 73 | ; SIMD128: .param v128, v128{{$}} |
| 74 | ; SIMD128: .result v128{{$}} |
| 75 | ; SIMD128: v128.xor $push0=, $0, $1 # encoding: [0xfd,0x3d]{{$}} |
| 76 | ; SIMD128: return $pop0 # |
| 77 | define <16 x i8> @xor_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 78 | %a = xor <16 x i8> %x, %y |
| 79 | ret <16 x i8> %a |
| 80 | } |
| 81 | |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame^] | 82 | ; CHECK-LABEL: not_v16i8 |
| 83 | ; NO-SIMD128-NOT: v128 |
| 84 | ; SIMD128: .param v128{{$}} |
| 85 | ; SIMD128: .result v128{{$}} |
| 86 | ; SIMD128: v128.not $push0=, $0 # encoding: [0xfd,0x3e]{{$}} |
| 87 | ; SIMD128: return $pop0 # |
| 88 | define <16 x i8> @not_v16i8(<16 x i8> %x) { |
| 89 | %a = xor <16 x i8> %x, <i8 -1, i8 -1, i8 -1, i8 -1, |
| 90 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 91 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 92 | i8 -1, i8 -1, i8 -1, i8 -1> |
| 93 | ret <16 x i8> %a |
| 94 | } |
| 95 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 96 | ; ============================================================================== |
| 97 | ; 8 x i16 |
| 98 | ; ============================================================================== |
| 99 | ; CHECK-LABEL: add_v8i16 |
| 100 | ; NO-SIMD128-NOT: i16x8 |
| 101 | ; SIMD128: .param v128, v128{{$}} |
| 102 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 103 | ; SIMD128: i16x8.add $push0=, $0, $1 # encoding: [0xfd,0x19]{{$}} |
| 104 | ; SIMD128: return $pop0 # |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 105 | define <8 x i16> @add_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 106 | %a = add <8 x i16> %x, %y |
| 107 | ret <8 x i16> %a |
| 108 | } |
| 109 | |
| 110 | ; CHECK-LABEL: sub_v8i16 |
| 111 | ; NO-SIMD128-NOT: i16x8 |
| 112 | ; SIMD128: .param v128, v128{{$}} |
| 113 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 114 | ; SIMD128: i16x8.sub $push0=, $0, $1 # encoding: [0xfd,0x1d]{{$}} |
| 115 | ; SIMD128: return $pop0 # |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 116 | define <8 x i16> @sub_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 117 | %a = sub <8 x i16> %x, %y |
| 118 | ret <8 x i16> %a |
| 119 | } |
| 120 | |
| 121 | ; CHECK-LABEL: mul_v8i16 |
| 122 | ; NO-SIMD128-NOT: i16x8 |
| 123 | ; SIMD128: .param v128, v128{{$}} |
| 124 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 125 | ; SIMD128: i16x8.mul $push0=, $0, $1 # encoding: [0xfd,0x21]{{$}} |
| 126 | ; SIMD128: return $pop0 # |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 127 | define <8 x i16> @mul_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 128 | %a = mul <8 x i16> %x, %y |
| 129 | ret <8 x i16> %a |
| 130 | } |
| 131 | |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 132 | ; CHECK-LABEL: and_v8i16 |
| 133 | ; NO-SIMD128-NOT: i16x8 |
| 134 | ; SIMD128: .param v128, v128{{$}} |
| 135 | ; SIMD128: .result v128{{$}} |
| 136 | ; SIMD128: v128.and $push0=, $0, $1 # encoding: [0xfd,0x3b]{{$}} |
| 137 | ; SIMD128: return $pop0 # |
| 138 | define <8 x i16> @and_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 139 | %a = and <8 x i16> %x, %y |
| 140 | ret <8 x i16> %a |
| 141 | } |
| 142 | |
| 143 | ; CHECK-LABEL: or_v8i16 |
| 144 | ; NO-SIMD128-NOT: i16x8 |
| 145 | ; SIMD128: .param v128, v128{{$}} |
| 146 | ; SIMD128: .result v128{{$}} |
| 147 | ; SIMD128: v128.or $push0=, $0, $1 # encoding: [0xfd,0x3c]{{$}} |
| 148 | ; SIMD128: return $pop0 # |
| 149 | define <8 x i16> @or_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 150 | %a = or <8 x i16> %x, %y |
| 151 | ret <8 x i16> %a |
| 152 | } |
| 153 | |
| 154 | ; CHECK-LABEL: xor_v8i16 |
| 155 | ; NO-SIMD128-NOT: i16x8 |
| 156 | ; SIMD128: .param v128, v128{{$}} |
| 157 | ; SIMD128: .result v128{{$}} |
| 158 | ; SIMD128: v128.xor $push0=, $0, $1 # encoding: [0xfd,0x3d]{{$}} |
| 159 | ; SIMD128: return $pop0 # |
| 160 | define <8 x i16> @xor_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 161 | %a = xor <8 x i16> %x, %y |
| 162 | ret <8 x i16> %a |
| 163 | } |
| 164 | |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame^] | 165 | ; CHECK-LABEL: not_v8i16 |
| 166 | ; NO-SIMD128-NOT: v128 |
| 167 | ; SIMD128: .param v128{{$}} |
| 168 | ; SIMD128: .result v128{{$}} |
| 169 | ; SIMD128: v128.not $push0=, $0 # encoding: [0xfd,0x3e]{{$}} |
| 170 | ; SIMD128: return $pop0 # |
| 171 | define <8 x i16> @not_v8i16(<8 x i16> %x) { |
| 172 | %a = xor <8 x i16> %x, <i16 -1, i16 -1, i16 -1, i16 -1, |
| 173 | i16 -1, i16 -1, i16 -1, i16 -1> |
| 174 | ret <8 x i16> %a |
| 175 | } |
| 176 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 177 | ; ============================================================================== |
| 178 | ; 4 x i32 |
| 179 | ; ============================================================================== |
| 180 | ; CHECK-LABEL: add_v4i32 |
| 181 | ; NO-SIMD128-NOT: i32x4 |
| 182 | ; SIMD128: .param v128, v128{{$}} |
| 183 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 184 | ; SIMD128: i32x4.add $push0=, $0, $1 # encoding: [0xfd,0x1a]{{$}} |
| 185 | ; SIMD128: return $pop0 # |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 186 | define <4 x i32> @add_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 187 | %a = add <4 x i32> %x, %y |
| 188 | ret <4 x i32> %a |
| 189 | } |
| 190 | |
| 191 | ; CHECK-LABEL: sub_v4i32 |
| 192 | ; NO-SIMD128-NOT: i32x4 |
| 193 | ; SIMD128: .param v128, v128{{$}} |
| 194 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 195 | ; SIMD128: i32x4.sub $push0=, $0, $1 # encoding: [0xfd,0x1e]{{$}} |
| 196 | ; SIMD128: return $pop0 # |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 197 | define <4 x i32> @sub_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 198 | %a = sub <4 x i32> %x, %y |
| 199 | ret <4 x i32> %a |
| 200 | } |
| 201 | |
| 202 | ; CHECK-LABEL: mul_v4i32 |
| 203 | ; NO-SIMD128-NOT: i32x4 |
| 204 | ; SIMD128: .param v128, v128{{$}} |
| 205 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 206 | ; SIMD128: i32x4.mul $push0=, $0, $1 # encoding: [0xfd,0x22]{{$}} |
| 207 | ; SIMD128: return $pop0 # |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 208 | define <4 x i32> @mul_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 209 | %a = mul <4 x i32> %x, %y |
| 210 | ret <4 x i32> %a |
| 211 | } |
| 212 | |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 213 | ; CHECK-LABEL: and_v4i32 |
| 214 | ; NO-SIMD128-NOT: i32x4 |
| 215 | ; SIMD128: .param v128, v128{{$}} |
| 216 | ; SIMD128: .result v128{{$}} |
| 217 | ; SIMD128: v128.and $push0=, $0, $1 # encoding: [0xfd,0x3b]{{$}} |
| 218 | ; SIMD128: return $pop0 # |
| 219 | define <4 x i32> @and_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 220 | %a = and <4 x i32> %x, %y |
| 221 | ret <4 x i32> %a |
| 222 | } |
| 223 | |
| 224 | ; CHECK-LABEL: or_v4i32 |
| 225 | ; NO-SIMD128-NOT: i32x4 |
| 226 | ; SIMD128: .param v128, v128{{$}} |
| 227 | ; SIMD128: .result v128{{$}} |
| 228 | ; SIMD128: v128.or $push0=, $0, $1 # encoding: [0xfd,0x3c]{{$}} |
| 229 | ; SIMD128: return $pop0 # |
| 230 | define <4 x i32> @or_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 231 | %a = or <4 x i32> %x, %y |
| 232 | ret <4 x i32> %a |
| 233 | } |
| 234 | |
| 235 | ; CHECK-LABEL: xor_v4i32 |
| 236 | ; NO-SIMD128-NOT: i32x4 |
| 237 | ; SIMD128: .param v128, v128{{$}} |
| 238 | ; SIMD128: .result v128{{$}} |
| 239 | ; SIMD128: v128.xor $push0=, $0, $1 # encoding: [0xfd,0x3d]{{$}} |
| 240 | ; SIMD128: return $pop0 # |
| 241 | define <4 x i32> @xor_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 242 | %a = xor <4 x i32> %x, %y |
| 243 | ret <4 x i32> %a |
| 244 | } |
| 245 | |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame^] | 246 | ; CHECK-LABEL: not_v4i32 |
| 247 | ; NO-SIMD128-NOT: v128 |
| 248 | ; SIMD128: .param v128{{$}} |
| 249 | ; SIMD128: .result v128{{$}} |
| 250 | ; SIMD128: v128.not $push0=, $0 # encoding: [0xfd,0x3e]{{$}} |
| 251 | ; SIMD128: return $pop0 # |
| 252 | define <4 x i32> @not_v4i32(<4 x i32> %x) { |
| 253 | %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1> |
| 254 | ret <4 x i32> %a |
| 255 | } |
| 256 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 257 | ; ============================================================================== |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 258 | ; 2 x i64 |
| 259 | ; ============================================================================== |
| 260 | ; CHECK-LABEL: add_v2i64 |
| 261 | ; NO-SIMD128-NOT: i64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 262 | ; SIMD128-VM-NOT: i64x2 |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 263 | ; SIMD128: .param v128, v128{{$}} |
| 264 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 265 | ; SIMD128: i64x2.add $push0=, $0, $1 # encoding: [0xfd,0x1b]{{$}} |
| 266 | ; SIMD128: return $pop0 # |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 267 | define <2 x i64> @add_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 268 | %a = add <2 x i64> %x, %y |
| 269 | ret <2 x i64> %a |
| 270 | } |
| 271 | |
| 272 | ; CHECK-LABEL: sub_v2i64 |
| 273 | ; NO-SIMD128-NOT: i64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 274 | ; SIMD128-VM-NOT: i64x2 |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 275 | ; SIMD128: .param v128, v128{{$}} |
| 276 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 277 | ; SIMD128: i64x2.sub $push0=, $0, $1 # encoding: [0xfd,0x1f]{{$}} |
| 278 | ; SIMD128: return $pop0 # |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 279 | define <2 x i64> @sub_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 280 | %a = sub <2 x i64> %x, %y |
| 281 | ret <2 x i64> %a |
| 282 | } |
| 283 | |
Thomas Lively | 2ee686d | 2018-08-22 23:06:27 +0000 | [diff] [blame] | 284 | ; v2i64.mul is not in spec |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 285 | ; CHECK-LABEL: mul_v2i64 |
| 286 | ; NO-SIMD128-NOT: i64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 287 | ; SIMD128-VM-NOT: i64x2 |
Thomas Lively | 2ee686d | 2018-08-22 23:06:27 +0000 | [diff] [blame] | 288 | ; SIMD128-NOT: i64x2.mul |
| 289 | ; SIMD128: i64x2.extract_lane |
| 290 | ; SIMD128: i64.mul |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 291 | define <2 x i64> @mul_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 292 | %a = mul <2 x i64> %x, %y |
| 293 | ret <2 x i64> %a |
| 294 | } |
| 295 | |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 296 | ; CHECK-LABEL: and_v2i64 |
| 297 | ; NO-SIMD128-NOT: i64x2 |
| 298 | ; SIMD128: .param v128, v128{{$}} |
| 299 | ; SIMD128: .result v128{{$}} |
| 300 | ; SIMD128: v128.and $push0=, $0, $1 # encoding: [0xfd,0x3b]{{$}} |
| 301 | ; SIMD128: return $pop0 # |
| 302 | define <2 x i64> @and_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 303 | %a = and <2 x i64> %x, %y |
| 304 | ret <2 x i64> %a |
| 305 | } |
| 306 | |
| 307 | ; CHECK-LABEL: or_v2i64 |
| 308 | ; NO-SIMD128-NOT: i64x2 |
| 309 | ; SIMD128: .param v128, v128{{$}} |
| 310 | ; SIMD128: .result v128{{$}} |
| 311 | ; SIMD128: v128.or $push0=, $0, $1 # encoding: [0xfd,0x3c]{{$}} |
| 312 | ; SIMD128: return $pop0 # |
| 313 | define <2 x i64> @or_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 314 | %a = or <2 x i64> %x, %y |
| 315 | ret <2 x i64> %a |
| 316 | } |
| 317 | |
| 318 | ; CHECK-LABEL: xor_v2i64 |
| 319 | ; NO-SIMD128-NOT: i64x2 |
| 320 | ; SIMD128: .param v128, v128{{$}} |
| 321 | ; SIMD128: .result v128{{$}} |
| 322 | ; SIMD128: v128.xor $push0=, $0, $1 # encoding: [0xfd,0x3d]{{$}} |
| 323 | ; SIMD128: return $pop0 # |
| 324 | define <2 x i64> @xor_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 325 | %a = xor <2 x i64> %x, %y |
| 326 | ret <2 x i64> %a |
| 327 | } |
| 328 | |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame^] | 329 | ; CHECK-LABEL: not_v2i64 |
| 330 | ; NO-SIMD128-NOT: v128 |
| 331 | ; SIMD128-VM-NOT: v128 |
| 332 | ; SIMD128: .param v128{{$}} |
| 333 | ; SIMD128: .result v128{{$}} |
| 334 | ; SIMD128: v128.not $push0=, $0 # encoding: [0xfd,0x3e]{{$}} |
| 335 | ; SIMD128: return $pop0 # |
| 336 | define <2 x i64> @not_v2i64(<2 x i64> %x) { |
| 337 | %a = xor <2 x i64> %x, <i64 -1, i64 -1> |
| 338 | ret <2 x i64> %a |
| 339 | } |
| 340 | |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 341 | ; ============================================================================== |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 342 | ; 4 x float |
| 343 | ; ============================================================================== |
| 344 | ; CHECK-LABEL: add_v4f32 |
| 345 | ; NO-SIMD128-NOT: f32x4 |
| 346 | ; SIMD128: .param v128, v128{{$}} |
| 347 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 348 | ; SIMD128: f32x4.add $push0=, $0, $1 # encoding: [0xfd,0x7a]{{$}} |
| 349 | ; SIMD128: return $pop0 # |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 350 | define <4 x float> @add_v4f32(<4 x float> %x, <4 x float> %y) { |
| 351 | %a = fadd <4 x float> %x, %y |
| 352 | ret <4 x float> %a |
| 353 | } |
| 354 | |
| 355 | ; CHECK-LABEL: sub_v4f32 |
| 356 | ; NO-SIMD128-NOT: f32x4 |
| 357 | ; SIMD128: .param v128, v128{{$}} |
| 358 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 359 | ; SIMD128: f32x4.sub $push0=, $0, $1 # encoding: [0xfd,0x7c]{{$}} |
| 360 | ; SIMD128: return $pop0 # |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 361 | define <4 x float> @sub_v4f32(<4 x float> %x, <4 x float> %y) { |
| 362 | %a = fsub <4 x float> %x, %y |
| 363 | ret <4 x float> %a |
| 364 | } |
| 365 | |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 366 | ; CHECK-LABEL: div_v4f32 |
| 367 | ; NO-SIMD128-NOT: f32x4 |
| 368 | ; SIMD128: .param v128, v128{{$}} |
| 369 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 370 | ; SIMD128: f32x4.div $push0=, $0, $1 # encoding: [0xfd,0x7e]{{$}} |
| 371 | ; SIMD128: return $pop0 # |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 372 | define <4 x float> @div_v4f32(<4 x float> %x, <4 x float> %y) { |
| 373 | %a = fdiv <4 x float> %x, %y |
| 374 | ret <4 x float> %a |
| 375 | } |
| 376 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 377 | ; CHECK-LABEL: mul_v4f32 |
| 378 | ; NO-SIMD128-NOT: f32x4 |
| 379 | ; SIMD128: .param v128, v128{{$}} |
| 380 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 381 | ; SIMD128: f32x4.mul $push0=, $0, $1 # encoding: [0xfd,0x80]{{$}} |
| 382 | ; SIMD128: return $pop0 # |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 383 | define <4 x float> @mul_v4f32(<4 x float> %x, <4 x float> %y) { |
| 384 | %a = fmul <4 x float> %x, %y |
| 385 | ret <4 x float> %a |
| 386 | } |
| 387 | |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 388 | ; ============================================================================== |
| 389 | ; 2 x double |
| 390 | ; ============================================================================== |
| 391 | ; CHECK-LABEL: add_v2f64 |
| 392 | ; NO-SIMD128-NOT: f64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 393 | ; SIMD129-VM-NOT: f62x2 |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 394 | ; SIMD128: .param v128, v128{{$}} |
| 395 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 396 | ; SIMD128: f64x2.add $push0=, $0, $1 # encoding: [0xfd,0x7b]{{$}} |
| 397 | ; SIMD128: return $pop0 # |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 398 | define <2 x double> @add_v2f64(<2 x double> %x, <2 x double> %y) { |
| 399 | %a = fadd <2 x double> %x, %y |
| 400 | ret <2 x double> %a |
| 401 | } |
| 402 | |
| 403 | ; CHECK-LABEL: sub_v2f64 |
| 404 | ; NO-SIMD128-NOT: f64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 405 | ; SIMD129-VM-NOT: f62x2 |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 406 | ; SIMD128: .param v128, v128{{$}} |
| 407 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 408 | ; SIMD128: f64x2.sub $push0=, $0, $1 # encoding: [0xfd,0x7d]{{$}} |
| 409 | ; SIMD128: return $pop0 # |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 410 | define <2 x double> @sub_v2f64(<2 x double> %x, <2 x double> %y) { |
| 411 | %a = fsub <2 x double> %x, %y |
| 412 | ret <2 x double> %a |
| 413 | } |
| 414 | |
| 415 | ; CHECK-LABEL: div_v2f64 |
| 416 | ; NO-SIMD128-NOT: f64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 417 | ; SIMD129-VM-NOT: f62x2 |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 418 | ; SIMD128: .param v128, v128{{$}} |
| 419 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 420 | ; SIMD128: f64x2.div $push0=, $0, $1 # encoding: [0xfd,0x7f]{{$}} |
| 421 | ; SIMD128: return $pop0 # |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 422 | define <2 x double> @div_v2f64(<2 x double> %x, <2 x double> %y) { |
| 423 | %a = fdiv <2 x double> %x, %y |
| 424 | ret <2 x double> %a |
| 425 | } |
| 426 | |
| 427 | ; CHECK-LABEL: mul_v2f64 |
| 428 | ; NO-SIMD128-NOT: f64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 429 | ; SIMD129-VM-NOT: f62x2 |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 430 | ; SIMD128: .param v128, v128{{$}} |
| 431 | ; SIMD128: .result v128{{$}} |
Heejin Ahn | c15a878 | 2018-08-14 19:10:50 +0000 | [diff] [blame] | 432 | ; SIMD128: f64x2.mul $push0=, $0, $1 # encoding: [0xfd,0x81]{{$}} |
| 433 | ; SIMD128: return $pop0 # |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 434 | define <2 x double> @mul_v2f64(<2 x double> %x, <2 x double> %y) { |
| 435 | %a = fmul <2 x double> %x, %y |
| 436 | ret <2 x double> %a |
| 437 | } |