Thomas Lively | 64a39a1 | 2019-01-10 22:32:11 +0000 | [diff] [blame] | 1 | ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+unimplemented-simd128 | FileCheck %s --check-prefixes CHECK,SIMD128,SIMD128-SLOW |
| 2 | ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+unimplemented-simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,SIMD128,SIMD128-FAST |
Thomas Lively | b6dac89 | 2018-12-21 06:58:15 +0000 | [diff] [blame] | 3 | ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -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 -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,SIMD128-VM |
Thomas Lively | 64a39a1 | 2019-01-10 22:32:11 +0000 | [diff] [blame] | 5 | ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers | FileCheck %s --check-prefixes CHECK,NO-SIMD128 |
| 6 | ; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -fast-isel | FileCheck %s --check-prefixes CHECK,NO-SIMD128 |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 7 | |
Thomas Lively | 409f584 | 2018-10-09 23:33:16 +0000 | [diff] [blame] | 8 | ; check that a non-test run (including explicit locals pass) at least finishes |
Thomas Lively | 64a39a1 | 2019-01-10 22:32:11 +0000 | [diff] [blame] | 9 | ; RUN: llc < %s -O0 -mattr=+unimplemented-simd128 |
| 10 | ; RUN: llc < %s -O2 -mattr=+unimplemented-simd128 |
Thomas Lively | 409f584 | 2018-10-09 23:33:16 +0000 | [diff] [blame] | 11 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 12 | ; Test that basic SIMD128 arithmetic operations assemble as expected. |
| 13 | |
| 14 | 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] | 15 | target triple = "wasm32-unknown-unknown" |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 16 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 17 | ; ============================================================================== |
| 18 | ; 16 x i8 |
| 19 | ; ============================================================================== |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 20 | ; CHECK-LABEL: add_v16i8: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 21 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 22 | ; SIMD128-NEXT: .functype add_v16i8 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 23 | ; SIMD128-NEXT: i8x16.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 24 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 25 | define <16 x i8> @add_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 26 | %a = add <16 x i8> %x, %y |
| 27 | ret <16 x i8> %a |
| 28 | } |
| 29 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 30 | ; CHECK-LABEL: sub_v16i8: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 31 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 32 | ; SIMD128-NEXT: .functype sub_v16i8 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 33 | ; SIMD128-NEXT: i8x16.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 34 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 35 | define <16 x i8> @sub_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 36 | %a = sub <16 x i8> %x, %y |
| 37 | ret <16 x i8> %a |
| 38 | } |
| 39 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 40 | ; CHECK-LABEL: mul_v16i8: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 41 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 42 | ; SIMD128-NEXT: .functype mul_v16i8 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 43 | ; SIMD128-NEXT: i8x16.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 44 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 45 | define <16 x i8> @mul_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 46 | %a = mul <16 x i8> %x, %y |
| 47 | ret <16 x i8> %a |
| 48 | } |
| 49 | |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 50 | ; CHECK-LABEL: neg_v16i8: |
| 51 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 52 | ; SIMD128-NEXT: .functype neg_v16i8 (v128) -> (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 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 64 | ; SIMD128-NEXT: .functype shl_v16i8 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 65 | ; SIMD128-NEXT: i8x16.shl $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 66 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 67 | define <16 x i8> @shl_v16i8(<16 x i8> %v, i8 %x) { |
| 68 | %t = insertelement <16 x i8> undef, i8 %x, i32 0 |
| 69 | %s = shufflevector <16 x i8> %t, <16 x i8> undef, |
| 70 | <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, |
| 71 | i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 72 | %a = shl <16 x i8> %v, %s |
| 73 | ret <16 x i8> %a |
| 74 | } |
| 75 | |
| 76 | ; CHECK-LABEL: shl_const_v16i8: |
| 77 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 78 | ; SIMD128-NEXT: .functype shl_const_v16i8 (v128) -> (v128){{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 79 | ; SIMD128-NEXT: i32.const $push[[L0:[0-9]+]]=, 5 |
| 80 | ; SIMD128-NEXT: i8x16.shl $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 81 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 82 | define <16 x i8> @shl_const_v16i8(<16 x i8> %v) { |
| 83 | %a = shl <16 x i8> %v, |
| 84 | <i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, |
| 85 | i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5, i8 5> |
| 86 | ret <16 x i8> %a |
| 87 | } |
| 88 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 89 | ; CHECK-LABEL: shl_vec_v16i8: |
| 90 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 91 | ; SIMD128-NEXT: .functype shl_vec_v16i8 (v128, v128) -> (v128){{$}} |
Thomas Lively | 8dbf29af | 2018-12-20 02:10:22 +0000 | [diff] [blame] | 92 | ; SIMD128-NEXT: i8x16.extract_lane_s $push[[L0:[0-9]+]]=, $0, 0{{$}} |
Thomas Lively | 6bf2b40 | 2019-01-15 02:16:03 +0000 | [diff] [blame] | 93 | ; SIMD128-NEXT: i32.const $push[[M0:[0-9]+]]=, 7{{$}} |
| 94 | ; SIMD128-NEXT: i8x16.splat $push[[M1:[0-9]+]]=, $pop[[M0]]{{$}} |
| 95 | ; SIMD128-NEXT: v128.and $push[[M2:[0-9]+]]=, $1, $pop[[M1]]{{$}} |
| 96 | ; SIMD128-NEXT: local.tee $push[[M:[0-9]+]]=, $1=, $pop[[M2]]{{$}} |
| 97 | ; SIMD128-NEXT: i8x16.extract_lane_u $push[[L1:[0-9]+]]=, $pop[[M]], 0{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 98 | ; SIMD128-NEXT: i32.shl $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 99 | ; SIMD128-NEXT: i8x16.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 100 | ; Skip 14 lanes |
Thomas Lively | 8dbf29af | 2018-12-20 02:10:22 +0000 | [diff] [blame] | 101 | ; SIMD128: i8x16.extract_lane_s $push[[L4:[0-9]+]]=, $0, 15{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 102 | ; SIMD128-NEXT: i8x16.extract_lane_u $push[[L5:[0-9]+]]=, $1, 15{{$}} |
| 103 | ; SIMD128-NEXT: i32.shl $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 104 | ; SIMD128-NEXT: i8x16.replace_lane $push[[R:[0-9]+]]=, $pop[[L7:[0-9]+]], 15, $pop[[L6]]{{$}} |
| 105 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 106 | define <16 x i8> @shl_vec_v16i8(<16 x i8> %v, <16 x i8> %x) { |
| 107 | %a = shl <16 x i8> %v, %x |
| 108 | ret <16 x i8> %a |
| 109 | } |
| 110 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 111 | ; CHECK-LABEL: shr_s_v16i8: |
| 112 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 113 | ; SIMD128-NEXT: .functype shr_s_v16i8 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 114 | ; SIMD128-NEXT: i8x16.shr_s $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 115 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 116 | define <16 x i8> @shr_s_v16i8(<16 x i8> %v, i8 %x) { |
| 117 | %t = insertelement <16 x i8> undef, i8 %x, i32 0 |
| 118 | %s = shufflevector <16 x i8> %t, <16 x i8> undef, |
| 119 | <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, |
| 120 | i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 121 | %a = ashr <16 x i8> %v, %s |
| 122 | ret <16 x i8> %a |
| 123 | } |
| 124 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 125 | ; CHECK-LABEL: shr_s_vec_v16i8: |
| 126 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 127 | ; SIMD128-NEXT: .functype shr_s_vec_v16i8 (v128, v128) -> (v128){{$}} |
Thomas Lively | 8dbf29af | 2018-12-20 02:10:22 +0000 | [diff] [blame] | 128 | ; SIMD128-NEXT: i8x16.extract_lane_s $push[[L0:[0-9]+]]=, $0, 0{{$}} |
Thomas Lively | 6bf2b40 | 2019-01-15 02:16:03 +0000 | [diff] [blame] | 129 | ; SIMD128-NEXT: i32.const $push[[M0:[0-9]+]]=, 7{{$}} |
| 130 | ; SIMD128-NEXT: i8x16.splat $push[[M1:[0-9]+]]=, $pop[[M0]]{{$}} |
| 131 | ; SIMD128-NEXT: v128.and $push[[M2:[0-9]+]]=, $1, $pop[[M1]]{{$}} |
| 132 | ; SIMD128-NEXT: local.tee $push[[M:[0-9]+]]=, $1=, $pop[[M2]]{{$}} |
| 133 | ; SIMD128-NEXT: i8x16.extract_lane_u $push[[L1:[0-9]+]]=, $pop[[M]], 0{{$}} |
Thomas Lively | 64a39a1 | 2019-01-10 22:32:11 +0000 | [diff] [blame] | 134 | ; SIMD128-NEXT: i32.shr_s $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 135 | ; SIMD128-NEXT: i8x16.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 136 | ; Skip 14 lanes |
Thomas Lively | 64a39a1 | 2019-01-10 22:32:11 +0000 | [diff] [blame] | 137 | ; SIMD128: i8x16.extract_lane_s $push[[L0:[0-9]+]]=, $0, 15{{$}} |
| 138 | ; SIMD128-NEXT: i8x16.extract_lane_u $push[[L1:[0-9]+]]=, $1, 15{{$}} |
| 139 | ; SIMD128-NEXT: i32.shr_s $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 140 | ; SIMD128-NEXT: i8x16.replace_lane $push[[R:[0-9]+]]=, $pop{{[0-9]+}}, 15, $pop[[L2]]{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 141 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 142 | define <16 x i8> @shr_s_vec_v16i8(<16 x i8> %v, <16 x i8> %x) { |
| 143 | %a = ashr <16 x i8> %v, %x |
| 144 | ret <16 x i8> %a |
| 145 | } |
| 146 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 147 | ; CHECK-LABEL: shr_u_v16i8: |
| 148 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 149 | ; SIMD128-NEXT: .functype shr_u_v16i8 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 150 | ; SIMD128-NEXT: i8x16.shr_u $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 151 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 152 | define <16 x i8> @shr_u_v16i8(<16 x i8> %v, i8 %x) { |
| 153 | %t = insertelement <16 x i8> undef, i8 %x, i32 0 |
| 154 | %s = shufflevector <16 x i8> %t, <16 x i8> undef, |
| 155 | <16 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, |
| 156 | i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 157 | %a = lshr <16 x i8> %v, %s |
| 158 | ret <16 x i8> %a |
| 159 | } |
| 160 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 161 | ; CHECK-LABEL: shr_u_vec_v16i8: |
| 162 | ; NO-SIMD128-NOT: i8x16 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 163 | ; SIMD128-NEXT: .functype shr_u_vec_v16i8 (v128, v128) -> (v128){{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 164 | ; SIMD128-NEXT: i8x16.extract_lane_u $push[[L0:[0-9]+]]=, $0, 0{{$}} |
Thomas Lively | 6bf2b40 | 2019-01-15 02:16:03 +0000 | [diff] [blame] | 165 | ; SIMD128-NEXT: i32.const $push[[M0:[0-9]+]]=, 7{{$}} |
| 166 | ; SIMD128-NEXT: i8x16.splat $push[[M1:[0-9]+]]=, $pop[[M0]]{{$}} |
| 167 | ; SIMD128-NEXT: v128.and $push[[M2:[0-9]+]]=, $1, $pop[[M1]]{{$}} |
| 168 | ; SIMD128-NEXT: local.tee $push[[M:[0-9]+]]=, $1=, $pop[[M2]]{{$}} |
| 169 | ; SIMD128-NEXT: i8x16.extract_lane_u $push[[L1:[0-9]+]]=, $pop[[M]], 0{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 170 | ; SIMD128-NEXT: i32.shr_u $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 171 | ; SIMD128-NEXT: i8x16.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 172 | ; Skip 14 lanes |
| 173 | ; SIMD128: i8x16.extract_lane_u $push[[L4:[0-9]+]]=, $0, 15{{$}} |
| 174 | ; SIMD128-NEXT: i8x16.extract_lane_u $push[[L5:[0-9]+]]=, $1, 15{{$}} |
| 175 | ; SIMD128-NEXT: i32.shr_u $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 176 | ; SIMD128-NEXT: i8x16.replace_lane $push[[R:[0-9]+]]=, $pop[[L7:[0-9]+]], 15, $pop[[L6]]{{$}} |
| 177 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 178 | define <16 x i8> @shr_u_vec_v16i8(<16 x i8> %v, <16 x i8> %x) { |
| 179 | %a = lshr <16 x i8> %v, %x |
| 180 | ret <16 x i8> %a |
| 181 | } |
| 182 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 183 | ; CHECK-LABEL: and_v16i8: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 184 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 185 | ; SIMD128-NEXT: .functype and_v16i8 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 186 | ; SIMD128-NEXT: v128.and $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 187 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 188 | define <16 x i8> @and_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 189 | %a = and <16 x i8> %x, %y |
| 190 | ret <16 x i8> %a |
| 191 | } |
| 192 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 193 | ; CHECK-LABEL: or_v16i8: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 194 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 195 | ; SIMD128-NEXT: .functype or_v16i8 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 196 | ; SIMD128-NEXT: v128.or $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 197 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 198 | define <16 x i8> @or_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 199 | %a = or <16 x i8> %x, %y |
| 200 | ret <16 x i8> %a |
| 201 | } |
| 202 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 203 | ; CHECK-LABEL: xor_v16i8: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 204 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 205 | ; SIMD128-NEXT: .functype xor_v16i8 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 206 | ; SIMD128-NEXT: v128.xor $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 207 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 208 | define <16 x i8> @xor_v16i8(<16 x i8> %x, <16 x i8> %y) { |
| 209 | %a = xor <16 x i8> %x, %y |
| 210 | ret <16 x i8> %a |
| 211 | } |
| 212 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 213 | ; CHECK-LABEL: not_v16i8: |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 214 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 215 | ; SIMD128-NEXT: .functype not_v16i8 (v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 216 | ; SIMD128-NEXT: v128.not $push[[R:[0-9]+]]=, $0{{$}} |
| 217 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 218 | define <16 x i8> @not_v16i8(<16 x i8> %x) { |
| 219 | %a = xor <16 x i8> %x, <i8 -1, i8 -1, i8 -1, i8 -1, |
| 220 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 221 | i8 -1, i8 -1, i8 -1, i8 -1, |
| 222 | i8 -1, i8 -1, i8 -1, i8 -1> |
| 223 | ret <16 x i8> %a |
| 224 | } |
| 225 | |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 226 | ; CHECK-LABEL: bitselect_v16i8: |
| 227 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 228 | ; SIMD128-NEXT: .functype bitselect_v16i8 (v128, v128, v128) -> (v128){{$}} |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 229 | ; SIMD128-SLOW-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $1, $2, $0{{$}} |
| 230 | ; SIMD128-SLOW-NEXT: return $pop[[R]]{{$}} |
| 231 | ; SIMD128-FAST-NEXT: v128.and |
| 232 | ; SIMD128-FAST-NEXT: v128.not |
| 233 | ; SIMD128-FAST-NEXT: v128.and |
| 234 | ; SIMD128-FAST-NEXT: v128.or |
| 235 | ; SIMD128-FAST-NEXT: return |
| 236 | define <16 x i8> @bitselect_v16i8(<16 x i8> %c, <16 x i8> %v1, <16 x i8> %v2) { |
| 237 | %masked_v1 = and <16 x i8> %c, %v1 |
| 238 | %inv_mask = xor <16 x i8> %c, |
| 239 | <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, |
| 240 | i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1> |
| 241 | %masked_v2 = and <16 x i8> %inv_mask, %v2 |
| 242 | %a = or <16 x i8> %masked_v1, %masked_v2 |
| 243 | ret <16 x i8> %a |
| 244 | } |
| 245 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 246 | ; ============================================================================== |
| 247 | ; 8 x i16 |
| 248 | ; ============================================================================== |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 249 | ; CHECK-LABEL: add_v8i16: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 250 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 251 | ; SIMD128-NEXT: .functype add_v8i16 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 252 | ; SIMD128-NEXT: i16x8.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 253 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 254 | define <8 x i16> @add_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 255 | %a = add <8 x i16> %x, %y |
| 256 | ret <8 x i16> %a |
| 257 | } |
| 258 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 259 | ; CHECK-LABEL: sub_v8i16: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 260 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 261 | ; SIMD128-NEXT: .functype sub_v8i16 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 262 | ; SIMD128-NEXT: i16x8.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 263 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 264 | define <8 x i16> @sub_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 265 | %a = sub <8 x i16> %x, %y |
| 266 | ret <8 x i16> %a |
| 267 | } |
| 268 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 269 | ; CHECK-LABEL: mul_v8i16: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 270 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 271 | ; SIMD128-NEXT: .functype mul_v8i16 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 272 | ; SIMD128-NEXT: i16x8.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 273 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 274 | define <8 x i16> @mul_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 275 | %a = mul <8 x i16> %x, %y |
| 276 | ret <8 x i16> %a |
| 277 | } |
| 278 | |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 279 | ; CHECK-LABEL: neg_v8i16: |
| 280 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 281 | ; SIMD128-NEXT: .functype neg_v8i16 (v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 282 | ; SIMD128-NEXT: i16x8.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 283 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 284 | define <8 x i16> @neg_v8i16(<8 x i16> %x) { |
| 285 | %a = sub <8 x i16> <i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0, i16 0>, |
| 286 | %x |
| 287 | ret <8 x i16> %a |
| 288 | } |
| 289 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 290 | ; CHECK-LABEL: shl_v8i16: |
| 291 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 292 | ; SIMD128-NEXT: .functype shl_v8i16 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 293 | ; SIMD128-NEXT: i16x8.shl $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 294 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 295 | define <8 x i16> @shl_v8i16(<8 x i16> %v, i16 %x) { |
| 296 | %t = insertelement <8 x i16> undef, i16 %x, i32 0 |
| 297 | %s = shufflevector <8 x i16> %t, <8 x i16> undef, |
| 298 | <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 299 | %a = shl <8 x i16> %v, %s |
| 300 | ret <8 x i16> %a |
| 301 | } |
| 302 | |
| 303 | ; CHECK-LABEL: shl_const_v8i16: |
| 304 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 305 | ; SIMD128-NEXT: .functype shl_const_v8i16 (v128) -> (v128){{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 306 | ; SIMD128-NEXT: i32.const $push[[L0:[0-9]+]]=, 5 |
| 307 | ; SIMD128-NEXT: i16x8.shl $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 308 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 309 | define <8 x i16> @shl_const_v8i16(<8 x i16> %v) { |
| 310 | %a = shl <8 x i16> %v, |
| 311 | <i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5, i16 5> |
| 312 | ret <8 x i16> %a |
| 313 | } |
| 314 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 315 | ; CHECK-LABEL: shl_vec_v8i16: |
| 316 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 317 | ; SIMD128-NEXT: .functype shl_vec_v8i16 (v128, v128) -> (v128){{$}} |
Thomas Lively | 8dbf29af | 2018-12-20 02:10:22 +0000 | [diff] [blame] | 318 | ; SIMD128-NEXT: i16x8.extract_lane_s $push[[L0:[0-9]+]]=, $0, 0{{$}} |
Thomas Lively | 6bf2b40 | 2019-01-15 02:16:03 +0000 | [diff] [blame] | 319 | ; SIMD128-NEXT: i32.const $push[[M0:[0-9]+]]=, 15{{$}} |
| 320 | ; SIMD128-NEXT: i16x8.splat $push[[M1:[0-9]+]]=, $pop[[M0]]{{$}} |
| 321 | ; SIMD128-NEXT: v128.and $push[[M2:[0-9]+]]=, $1, $pop[[M1]]{{$}} |
| 322 | ; SIMD128-NEXT: local.tee $push[[M:[0-9]+]]=, $1=, $pop[[M2]]{{$}} |
| 323 | ; SIMD128-NEXT: i16x8.extract_lane_u $push[[L1:[0-9]+]]=, $pop[[M]], 0{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 324 | ; SIMD128-NEXT: i32.shl $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 325 | ; SIMD128-NEXT: i16x8.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 326 | ; Skip 6 lanes |
Thomas Lively | 8dbf29af | 2018-12-20 02:10:22 +0000 | [diff] [blame] | 327 | ; SIMD128: i16x8.extract_lane_s $push[[L4:[0-9]+]]=, $0, 7{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 328 | ; SIMD128-NEXT: i16x8.extract_lane_u $push[[L5:[0-9]+]]=, $1, 7{{$}} |
| 329 | ; SIMD128-NEXT: i32.shl $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 330 | ; SIMD128-NEXT: i16x8.replace_lane $push[[R:[0-9]+]]=, $pop[[L7:[0-9]+]], 7, $pop[[L6]]{{$}} |
| 331 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 332 | define <8 x i16> @shl_vec_v8i16(<8 x i16> %v, <8 x i16> %x) { |
| 333 | %a = shl <8 x i16> %v, %x |
| 334 | ret <8 x i16> %a |
| 335 | } |
| 336 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 337 | ; CHECK-LABEL: shr_s_v8i16: |
| 338 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 339 | ; SIMD128-NEXT: .functype shr_s_v8i16 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 340 | ; SIMD128-NEXT: i16x8.shr_s $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 341 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 342 | define <8 x i16> @shr_s_v8i16(<8 x i16> %v, i16 %x) { |
| 343 | %t = insertelement <8 x i16> undef, i16 %x, i32 0 |
| 344 | %s = shufflevector <8 x i16> %t, <8 x i16> undef, |
| 345 | <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 346 | %a = ashr <8 x i16> %v, %s |
| 347 | ret <8 x i16> %a |
| 348 | } |
| 349 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 350 | ; CHECK-LABEL: shr_s_vec_v8i16: |
| 351 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 352 | ; SIMD128-NEXT: .functype shr_s_vec_v8i16 (v128, v128) -> (v128){{$}} |
Thomas Lively | 8dbf29af | 2018-12-20 02:10:22 +0000 | [diff] [blame] | 353 | ; SIMD128-NEXT: i16x8.extract_lane_s $push[[L0:[0-9]+]]=, $0, 0{{$}} |
Thomas Lively | 6bf2b40 | 2019-01-15 02:16:03 +0000 | [diff] [blame] | 354 | ; SIMD128-NEXT: i32.const $push[[M0:[0-9]+]]=, 15{{$}} |
| 355 | ; SIMD128-NEXT: i16x8.splat $push[[M1:[0-9]+]]=, $pop[[M0]]{{$}} |
| 356 | ; SIMD128-NEXT: v128.and $push[[M2:[0-9]+]]=, $1, $pop[[M1]]{{$}} |
| 357 | ; SIMD128-NEXT: local.tee $push[[M:[0-9]+]]=, $1=, $pop[[M2]]{{$}} |
| 358 | ; SIMD128-NEXT: i16x8.extract_lane_u $push[[L1:[0-9]+]]=, $pop[[M]], 0{{$}} |
Thomas Lively | 64a39a1 | 2019-01-10 22:32:11 +0000 | [diff] [blame] | 359 | ; SIMD128-NEXT: i32.shr_s $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 360 | ; SIMD128-NEXT: i16x8.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 361 | ; Skip 6 lanes |
Thomas Lively | 64a39a1 | 2019-01-10 22:32:11 +0000 | [diff] [blame] | 362 | ; SIMD128: i16x8.extract_lane_s $push[[L0:[0-9]+]]=, $0, 7{{$}} |
| 363 | ; SIMD128-NEXT: i16x8.extract_lane_u $push[[L1:[0-9]+]]=, $1, 7{{$}} |
| 364 | ; SIMD128-NEXT: i32.shr_s $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 365 | ; SIMD128-NEXT: i16x8.replace_lane $push[[R:[0-9]+]]=, $pop{{[0-9]+}}, 7, $pop[[L2]]{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 366 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 367 | define <8 x i16> @shr_s_vec_v8i16(<8 x i16> %v, <8 x i16> %x) { |
| 368 | %a = ashr <8 x i16> %v, %x |
| 369 | ret <8 x i16> %a |
| 370 | } |
| 371 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 372 | ; CHECK-LABEL: shr_u_v8i16: |
| 373 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 374 | ; SIMD128-NEXT: .functype shr_u_v8i16 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 375 | ; SIMD128-NEXT: i16x8.shr_u $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 376 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 377 | define <8 x i16> @shr_u_v8i16(<8 x i16> %v, i16 %x) { |
| 378 | %t = insertelement <8 x i16> undef, i16 %x, i32 0 |
| 379 | %s = shufflevector <8 x i16> %t, <8 x i16> undef, |
| 380 | <8 x i32> <i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0, i32 0> |
| 381 | %a = lshr <8 x i16> %v, %s |
| 382 | ret <8 x i16> %a |
| 383 | } |
| 384 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 385 | ; CHECK-LABEL: shr_u_vec_v8i16: |
| 386 | ; NO-SIMD128-NOT: i16x8 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 387 | ; SIMD128-NEXT: .functype shr_u_vec_v8i16 (v128, v128) -> (v128){{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 388 | ; SIMD128-NEXT: i16x8.extract_lane_u $push[[L0:[0-9]+]]=, $0, 0{{$}} |
Thomas Lively | 6bf2b40 | 2019-01-15 02:16:03 +0000 | [diff] [blame] | 389 | ; SIMD128-NEXT: i32.const $push[[M0:[0-9]+]]=, 15{{$}} |
| 390 | ; SIMD128-NEXT: i16x8.splat $push[[M1:[0-9]+]]=, $pop[[M0]]{{$}} |
| 391 | ; SIMD128-NEXT: v128.and $push[[M2:[0-9]+]]=, $1, $pop[[M1]]{{$}} |
| 392 | ; SIMD128-NEXT: local.tee $push[[M:[0-9]+]]=, $1=, $pop[[M2]]{{$}} |
| 393 | ; SIMD128-NEXT: i16x8.extract_lane_u $push[[L1:[0-9]+]]=, $pop[[M]], 0{{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 394 | ; SIMD128-NEXT: i32.shr_u $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 395 | ; SIMD128-NEXT: i16x8.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 396 | ; Skip 6 lanes |
| 397 | ; SIMD128: i16x8.extract_lane_u $push[[L4:[0-9]+]]=, $0, 7{{$}} |
| 398 | ; SIMD128-NEXT: i16x8.extract_lane_u $push[[L5:[0-9]+]]=, $1, 7{{$}} |
| 399 | ; SIMD128-NEXT: i32.shr_u $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 400 | ; SIMD128-NEXT: i16x8.replace_lane $push[[R:[0-9]+]]=, $pop[[L7:[0-9]+]], 7, $pop[[L6]]{{$}} |
| 401 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 402 | define <8 x i16> @shr_u_vec_v8i16(<8 x i16> %v, <8 x i16> %x) { |
| 403 | %a = lshr <8 x i16> %v, %x |
| 404 | ret <8 x i16> %a |
| 405 | } |
| 406 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 407 | ; CHECK-LABEL: and_v8i16: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 408 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 409 | ; SIMD128-NEXT: .functype and_v8i16 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 410 | ; SIMD128-NEXT: v128.and $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 411 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 412 | define <8 x i16> @and_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 413 | %a = and <8 x i16> %x, %y |
| 414 | ret <8 x i16> %a |
| 415 | } |
| 416 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 417 | ; CHECK-LABEL: or_v8i16: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 418 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 419 | ; SIMD128-NEXT: .functype or_v8i16 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 420 | ; SIMD128-NEXT: v128.or $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 421 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 422 | define <8 x i16> @or_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 423 | %a = or <8 x i16> %x, %y |
| 424 | ret <8 x i16> %a |
| 425 | } |
| 426 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 427 | ; CHECK-LABEL: xor_v8i16: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 428 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 429 | ; SIMD128-NEXT: .functype xor_v8i16 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 430 | ; SIMD128-NEXT: v128.xor $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 431 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 432 | define <8 x i16> @xor_v8i16(<8 x i16> %x, <8 x i16> %y) { |
| 433 | %a = xor <8 x i16> %x, %y |
| 434 | ret <8 x i16> %a |
| 435 | } |
| 436 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 437 | ; CHECK-LABEL: not_v8i16: |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 438 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 439 | ; SIMD128-NEXT: .functype not_v8i16 (v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 440 | ; SIMD128-NEXT: v128.not $push[[R:[0-9]+]]=, $0{{$}} |
| 441 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 442 | define <8 x i16> @not_v8i16(<8 x i16> %x) { |
| 443 | %a = xor <8 x i16> %x, <i16 -1, i16 -1, i16 -1, i16 -1, |
| 444 | i16 -1, i16 -1, i16 -1, i16 -1> |
| 445 | ret <8 x i16> %a |
| 446 | } |
| 447 | |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 448 | ; CHECK-LABEL: bitselect_v8i16: |
| 449 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 450 | ; SIMD128-NEXT: .functype bitselect_v8i16 (v128, v128, v128) -> (v128){{$}} |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 451 | ; SIMD128-SLOW-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $1, $2, $0{{$}} |
| 452 | ; SIMD128-SLOW-NEXT: return $pop[[R]]{{$}} |
| 453 | ; SIMD128-FAST-NEXT: v128.and |
| 454 | ; SIMD128-FAST-NEXT: v128.not |
| 455 | ; SIMD128-FAST-NEXT: v128.and |
| 456 | ; SIMD128-FAST-NEXT: v128.or |
| 457 | ; SIMD128-FAST-NEXT: return |
| 458 | define <8 x i16> @bitselect_v8i16(<8 x i16> %c, <8 x i16> %v1, <8 x i16> %v2) { |
| 459 | %masked_v1 = and <8 x i16> %v1, %c |
| 460 | %inv_mask = xor <8 x i16> |
| 461 | <i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1, i16 -1>, |
| 462 | %c |
| 463 | %masked_v2 = and <8 x i16> %v2, %inv_mask |
| 464 | %a = or <8 x i16> %masked_v1, %masked_v2 |
| 465 | ret <8 x i16> %a |
| 466 | } |
| 467 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 468 | ; ============================================================================== |
| 469 | ; 4 x i32 |
| 470 | ; ============================================================================== |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 471 | ; CHECK-LABEL: add_v4i32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 472 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 473 | ; SIMD128-NEXT: .functype add_v4i32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 474 | ; SIMD128-NEXT: i32x4.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 475 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 476 | define <4 x i32> @add_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 477 | %a = add <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: sub_v4i32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 482 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 483 | ; SIMD128-NEXT: .functype sub_v4i32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 484 | ; SIMD128-NEXT: i32x4.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 485 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 486 | define <4 x i32> @sub_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 487 | %a = sub <4 x i32> %x, %y |
| 488 | ret <4 x i32> %a |
| 489 | } |
| 490 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 491 | ; CHECK-LABEL: mul_v4i32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 492 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 493 | ; SIMD128-NEXT: .functype mul_v4i32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 494 | ; SIMD128-NEXT: i32x4.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 495 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 496 | define <4 x i32> @mul_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 497 | %a = mul <4 x i32> %x, %y |
| 498 | ret <4 x i32> %a |
| 499 | } |
| 500 | |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 501 | ; CHECK-LABEL: neg_v4i32: |
| 502 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 503 | ; SIMD128-NEXT: .functype neg_v4i32 (v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 504 | ; SIMD128-NEXT: i32x4.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 505 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 506 | define <4 x i32> @neg_v4i32(<4 x i32> %x) { |
| 507 | %a = sub <4 x i32> <i32 0, i32 0, i32 0, i32 0>, %x |
| 508 | ret <4 x i32> %a |
| 509 | } |
| 510 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 511 | ; CHECK-LABEL: shl_v4i32: |
| 512 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 513 | ; SIMD128-NEXT: .functype shl_v4i32 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 514 | ; SIMD128-NEXT: i32x4.shl $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 515 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 516 | define <4 x i32> @shl_v4i32(<4 x i32> %v, i32 %x) { |
| 517 | %t = insertelement <4 x i32> undef, i32 %x, i32 0 |
| 518 | %s = shufflevector <4 x i32> %t, <4 x i32> undef, |
| 519 | <4 x i32> <i32 0, i32 0, i32 0, i32 0> |
| 520 | %a = shl <4 x i32> %v, %s |
| 521 | ret <4 x i32> %a |
| 522 | } |
| 523 | |
| 524 | ; CHECK-LABEL: shl_const_v4i32: |
| 525 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 526 | ; SIMD128-NEXT: .functype shl_const_v4i32 (v128) -> (v128){{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 527 | ; SIMD128-NEXT: i32.const $push[[L0:[0-9]+]]=, 5 |
| 528 | ; SIMD128-NEXT: i32x4.shl $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 529 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 530 | define <4 x i32> @shl_const_v4i32(<4 x i32> %v) { |
| 531 | %a = shl <4 x i32> %v, <i32 5, i32 5, i32 5, i32 5> |
| 532 | ret <4 x i32> %a |
| 533 | } |
| 534 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 535 | ; CHECK-LABEL: shl_vec_v4i32: |
| 536 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 537 | ; SIMD128-NEXT: .functype shl_vec_v4i32 (v128, v128) -> (v128){{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 538 | ; SIMD128-NEXT: i32x4.extract_lane $push[[L0:[0-9]+]]=, $0, 0{{$}} |
| 539 | ; SIMD128-NEXT: i32x4.extract_lane $push[[L1:[0-9]+]]=, $1, 0{{$}} |
| 540 | ; SIMD128-NEXT: i32.shl $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 541 | ; SIMD128-NEXT: i32x4.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 542 | ; Skip 2 lanes |
| 543 | ; SIMD128: i32x4.extract_lane $push[[L4:[0-9]+]]=, $0, 3{{$}} |
| 544 | ; SIMD128-NEXT: i32x4.extract_lane $push[[L5:[0-9]+]]=, $1, 3{{$}} |
| 545 | ; SIMD128-NEXT: i32.shl $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 546 | ; SIMD128-NEXT: i32x4.replace_lane $push[[R:[0-9]+]]=, $pop[[L7:[0-9]+]], 3, $pop[[L6]]{{$}} |
| 547 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 548 | define <4 x i32> @shl_vec_v4i32(<4 x i32> %v, <4 x i32> %x) { |
| 549 | %a = shl <4 x i32> %v, %x |
| 550 | ret <4 x i32> %a |
| 551 | } |
| 552 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 553 | ; CHECK-LABEL: shr_s_v4i32: |
| 554 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 555 | ; SIMD128-NEXT: .functype shr_s_v4i32 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 556 | ; SIMD128-NEXT: i32x4.shr_s $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 557 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 558 | define <4 x i32> @shr_s_v4i32(<4 x i32> %v, i32 %x) { |
| 559 | %t = insertelement <4 x i32> undef, i32 %x, i32 0 |
| 560 | %s = shufflevector <4 x i32> %t, <4 x i32> undef, |
| 561 | <4 x i32> <i32 0, i32 0, i32 0, i32 0> |
| 562 | %a = ashr <4 x i32> %v, %s |
| 563 | ret <4 x i32> %a |
| 564 | } |
| 565 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 566 | ; CHECK-LABEL: shr_s_vec_v4i32: |
| 567 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 568 | ; SIMD128-NEXT: .functype shr_s_vec_v4i32 (v128, v128) -> (v128){{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 569 | ; SIMD128-NEXT: i32x4.extract_lane $push[[L0:[0-9]+]]=, $0, 0{{$}} |
| 570 | ; SIMD128-NEXT: i32x4.extract_lane $push[[L1:[0-9]+]]=, $1, 0{{$}} |
| 571 | ; SIMD128-NEXT: i32.shr_s $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 572 | ; SIMD128-NEXT: i32x4.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 573 | ; Skip 2 lanes |
| 574 | ; SIMD128: i32x4.extract_lane $push[[L4:[0-9]+]]=, $0, 3{{$}} |
| 575 | ; SIMD128-NEXT: i32x4.extract_lane $push[[L5:[0-9]+]]=, $1, 3{{$}} |
| 576 | ; SIMD128-NEXT: i32.shr_s $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 577 | ; SIMD128-NEXT: i32x4.replace_lane $push[[R:[0-9]+]]=, $pop[[L7:[0-9]+]], 3, $pop[[L6]]{{$}} |
| 578 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 579 | define <4 x i32> @shr_s_vec_v4i32(<4 x i32> %v, <4 x i32> %x) { |
| 580 | %a = ashr <4 x i32> %v, %x |
| 581 | ret <4 x i32> %a |
| 582 | } |
| 583 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 584 | ; CHECK-LABEL: shr_u_v4i32: |
| 585 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 586 | ; SIMD128-NEXT: .functype shr_u_v4i32 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 587 | ; SIMD128-NEXT: i32x4.shr_u $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 588 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 589 | define <4 x i32> @shr_u_v4i32(<4 x i32> %v, i32 %x) { |
| 590 | %t = insertelement <4 x i32> undef, i32 %x, i32 0 |
| 591 | %s = shufflevector <4 x i32> %t, <4 x i32> undef, |
| 592 | <4 x i32> <i32 0, i32 0, i32 0, i32 0> |
| 593 | %a = lshr <4 x i32> %v, %s |
| 594 | ret <4 x i32> %a |
| 595 | } |
| 596 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 597 | ; CHECK-LABEL: shr_u_vec_v4i32: |
| 598 | ; NO-SIMD128-NOT: i32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 599 | ; SIMD128-NEXT: .functype shr_u_vec_v4i32 (v128, v128) -> (v128){{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 600 | ; SIMD128-NEXT: i32x4.extract_lane $push[[L0:[0-9]+]]=, $0, 0{{$}} |
| 601 | ; SIMD128-NEXT: i32x4.extract_lane $push[[L1:[0-9]+]]=, $1, 0{{$}} |
| 602 | ; SIMD128-NEXT: i32.shr_u $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 603 | ; SIMD128-NEXT: i32x4.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 604 | ; Skip 2 lanes |
| 605 | ; SIMD128: i32x4.extract_lane $push[[L4:[0-9]+]]=, $0, 3{{$}} |
| 606 | ; SIMD128-NEXT: i32x4.extract_lane $push[[L5:[0-9]+]]=, $1, 3{{$}} |
| 607 | ; SIMD128-NEXT: i32.shr_u $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 608 | ; SIMD128-NEXT: i32x4.replace_lane $push[[R:[0-9]+]]=, $pop[[L7:[0-9]+]], 3, $pop[[L6]]{{$}} |
| 609 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 610 | define <4 x i32> @shr_u_vec_v4i32(<4 x i32> %v, <4 x i32> %x) { |
| 611 | %a = lshr <4 x i32> %v, %x |
| 612 | ret <4 x i32> %a |
| 613 | } |
| 614 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 615 | ; CHECK-LABEL: and_v4i32: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 616 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 617 | ; SIMD128-NEXT: .functype and_v4i32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 618 | ; SIMD128-NEXT: v128.and $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 619 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 620 | define <4 x i32> @and_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 621 | %a = and <4 x i32> %x, %y |
| 622 | ret <4 x i32> %a |
| 623 | } |
| 624 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 625 | ; CHECK-LABEL: or_v4i32: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 626 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 627 | ; SIMD128-NEXT: .functype or_v4i32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 628 | ; SIMD128-NEXT: v128.or $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 629 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 630 | define <4 x i32> @or_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 631 | %a = or <4 x i32> %x, %y |
| 632 | ret <4 x i32> %a |
| 633 | } |
| 634 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 635 | ; CHECK-LABEL: xor_v4i32: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 636 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 637 | ; SIMD128-NEXT: .functype xor_v4i32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 638 | ; SIMD128-NEXT: v128.xor $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 639 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 640 | define <4 x i32> @xor_v4i32(<4 x i32> %x, <4 x i32> %y) { |
| 641 | %a = xor <4 x i32> %x, %y |
| 642 | ret <4 x i32> %a |
| 643 | } |
| 644 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 645 | ; CHECK-LABEL: not_v4i32: |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 646 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 647 | ; SIMD128-NEXT: .functype not_v4i32 (v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 648 | ; SIMD128-NEXT: v128.not $push[[R:[0-9]+]]=, $0{{$}} |
| 649 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 650 | define <4 x i32> @not_v4i32(<4 x i32> %x) { |
| 651 | %a = xor <4 x i32> %x, <i32 -1, i32 -1, i32 -1, i32 -1> |
| 652 | ret <4 x i32> %a |
| 653 | } |
| 654 | |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 655 | ; CHECK-LABEL: bitselect_v4i32: |
| 656 | ; NO-SIMD128-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 657 | ; SIMD128-NEXT: .functype bitselect_v4i32 (v128, v128, v128) -> (v128){{$}} |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 658 | ; SIMD128-SLOW-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $1, $2, $0{{$}} |
| 659 | ; SIMD128-SLOW-NEXT: return $pop[[R]]{{$}} |
| 660 | ; SIMD128-FAST-NEXT: v128.not |
| 661 | ; SIMD128-FAST-NEXT: v128.and |
| 662 | ; SIMD128-FAST-NEXT: v128.and |
| 663 | ; SIMD128-FAST-NEXT: v128.or |
| 664 | ; SIMD128-FAST-NEXT: return |
| 665 | define <4 x i32> @bitselect_v4i32(<4 x i32> %c, <4 x i32> %v1, <4 x i32> %v2) { |
| 666 | %masked_v1 = and <4 x i32> %c, %v1 |
| 667 | %inv_mask = xor <4 x i32> <i32 -1, i32 -1, i32 -1, i32 -1>, %c |
| 668 | %masked_v2 = and <4 x i32> %inv_mask, %v2 |
| 669 | %a = or <4 x i32> %masked_v2, %masked_v1 |
| 670 | ret <4 x i32> %a |
| 671 | } |
| 672 | |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 673 | ; ============================================================================== |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 674 | ; 2 x i64 |
| 675 | ; ============================================================================== |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 676 | ; CHECK-LABEL: add_v2i64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 677 | ; NO-SIMD128-NOT: i64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 678 | ; SIMD128-VM-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 679 | ; SIMD128-NEXT: .functype add_v2i64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 680 | ; SIMD128-NEXT: i64x2.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 681 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 682 | define <2 x i64> @add_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 683 | %a = add <2 x i64> %x, %y |
| 684 | ret <2 x i64> %a |
| 685 | } |
| 686 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 687 | ; CHECK-LABEL: sub_v2i64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 688 | ; NO-SIMD128-NOT: i64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 689 | ; SIMD128-VM-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 690 | ; SIMD128-NEXT: .functype sub_v2i64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 691 | ; SIMD128-NEXT: i64x2.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 692 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 693 | define <2 x i64> @sub_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 694 | %a = sub <2 x i64> %x, %y |
| 695 | ret <2 x i64> %a |
| 696 | } |
| 697 | |
Thomas Lively | 2ee686d | 2018-08-22 23:06:27 +0000 | [diff] [blame] | 698 | ; v2i64.mul is not in spec |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 699 | ; CHECK-LABEL: mul_v2i64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 700 | ; NO-SIMD128-NOT: i64x2 |
Heejin Ahn | 5831e9c | 2018-08-09 23:58:51 +0000 | [diff] [blame] | 701 | ; SIMD128-VM-NOT: i64x2 |
Thomas Lively | 2ee686d | 2018-08-22 23:06:27 +0000 | [diff] [blame] | 702 | ; SIMD128-NOT: i64x2.mul |
| 703 | ; SIMD128: i64x2.extract_lane |
| 704 | ; SIMD128: i64.mul |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 705 | define <2 x i64> @mul_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 706 | %a = mul <2 x i64> %x, %y |
| 707 | ret <2 x i64> %a |
| 708 | } |
| 709 | |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 710 | ; CHECK-LABEL: neg_v2i64: |
| 711 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 712 | ; SIMD128-NEXT: .functype neg_v2i64 (v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 713 | ; SIMD128-NEXT: i64x2.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 714 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 715 | define <2 x i64> @neg_v2i64(<2 x i64> %x) { |
| 716 | %a = sub <2 x i64> <i64 0, i64 0>, %x |
| 717 | ret <2 x i64> %a |
| 718 | } |
| 719 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 720 | ; CHECK-LABEL: shl_v2i64: |
| 721 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 722 | ; SIMD128-NEXT: .functype shl_v2i64 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 723 | ; SIMD128-NEXT: i64x2.shl $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 724 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 725 | define <2 x i64> @shl_v2i64(<2 x i64> %v, i32 %x) { |
| 726 | %x2 = zext i32 %x to i64 |
| 727 | %t = insertelement <2 x i64> undef, i64 %x2, i32 0 |
| 728 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 729 | %a = shl <2 x i64> %v, %s |
| 730 | ret <2 x i64> %a |
| 731 | } |
| 732 | |
| 733 | ; CHECK-LABEL: shl_nozext_v2i64: |
| 734 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 735 | ; SIMD128-NEXT: .functype shl_nozext_v2i64 (v128, i64) -> (v128){{$}} |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 736 | ; SIMD128-NEXT: i32.wrap_i64 $push[[L0:[0-9]+]]=, $1{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 737 | ; SIMD128-NEXT: i64x2.shl $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 738 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 739 | define <2 x i64> @shl_nozext_v2i64(<2 x i64> %v, i64 %x) { |
| 740 | %t = insertelement <2 x i64> undef, i64 %x, i32 0 |
| 741 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 742 | %a = shl <2 x i64> %v, %s |
| 743 | ret <2 x i64> %a |
| 744 | } |
| 745 | |
| 746 | ; CHECK-LABEL: shl_const_v2i64: |
| 747 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 748 | ; SIMD128-NEXT: .functype shl_const_v2i64 (v128) -> (v128){{$}} |
Thomas Lively | 55735d5 | 2018-10-20 01:31:18 +0000 | [diff] [blame] | 749 | ; SIMD128-NEXT: i32.const $push[[L0:[0-9]+]]=, 5{{$}} |
| 750 | ; SIMD128-NEXT: i64x2.shl $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 751 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 752 | define <2 x i64> @shl_const_v2i64(<2 x i64> %v) { |
| 753 | %a = shl <2 x i64> %v, <i64 5, i64 5> |
| 754 | ret <2 x i64> %a |
| 755 | } |
| 756 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 757 | ; CHECK-LABEL: shl_vec_v2i64: |
| 758 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 759 | ; SIMD128-NEXT: .functype shl_vec_v2i64 (v128, v128) -> (v128){{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 760 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L0:[0-9]+]]=, $0, 0{{$}} |
| 761 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L1:[0-9]+]]=, $1, 0{{$}} |
| 762 | ; SIMD128-NEXT: i64.shl $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 763 | ; SIMD128-NEXT: i64x2.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 764 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L4:[0-9]+]]=, $0, 1{{$}} |
| 765 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L5:[0-9]+]]=, $1, 1{{$}} |
| 766 | ; SIMD128-NEXT: i64.shl $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 767 | ; SIMD128-NEXT: i64x2.replace_lane $push[[R:[0-9]+]]=, $pop[[L3]], 1, $pop[[L6]]{{$}} |
| 768 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 769 | define <2 x i64> @shl_vec_v2i64(<2 x i64> %v, <2 x i64> %x) { |
| 770 | %a = shl <2 x i64> %v, %x |
| 771 | ret <2 x i64> %a |
| 772 | } |
| 773 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 774 | ; CHECK-LABEL: shr_s_v2i64: |
| 775 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 776 | ; SIMD128-NEXT: .functype shr_s_v2i64 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 777 | ; SIMD128-NEXT: i64x2.shr_s $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 778 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 779 | define <2 x i64> @shr_s_v2i64(<2 x i64> %v, i32 %x) { |
| 780 | %x2 = zext i32 %x to i64 |
| 781 | %t = insertelement <2 x i64> undef, i64 %x2, i32 0 |
| 782 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 783 | %a = ashr <2 x i64> %v, %s |
| 784 | ret <2 x i64> %a |
| 785 | } |
| 786 | |
| 787 | ; CHECK-LABEL: shr_s_nozext_v2i64: |
| 788 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 789 | ; SIMD128-NEXT: .functype shr_s_nozext_v2i64 (v128, i64) -> (v128){{$}} |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 790 | ; SIMD128-NEXT: i32.wrap_i64 $push[[L0:[0-9]+]]=, $1{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 791 | ; SIMD128-NEXT: i64x2.shr_s $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 792 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 793 | define <2 x i64> @shr_s_nozext_v2i64(<2 x i64> %v, i64 %x) { |
| 794 | %t = insertelement <2 x i64> undef, i64 %x, i32 0 |
| 795 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 796 | %a = ashr <2 x i64> %v, %s |
| 797 | ret <2 x i64> %a |
| 798 | } |
| 799 | |
Thomas Lively | 55735d5 | 2018-10-20 01:31:18 +0000 | [diff] [blame] | 800 | ; CHECK-LABEL: shr_s_const_v2i64: |
| 801 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 802 | ; SIMD128-NEXT: .functype shr_s_const_v2i64 (v128) -> (v128){{$}} |
Thomas Lively | 55735d5 | 2018-10-20 01:31:18 +0000 | [diff] [blame] | 803 | ; SIMD128-NEXT: i32.const $push[[L0:[0-9]+]]=, 5{{$}} |
| 804 | ; SIMD128-NEXT: i64x2.shr_s $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 805 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 806 | define <2 x i64> @shr_s_const_v2i64(<2 x i64> %v) { |
| 807 | %a = ashr <2 x i64> %v, <i64 5, i64 5> |
| 808 | ret <2 x i64> %a |
| 809 | } |
| 810 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 811 | ; CHECK-LABEL: shr_s_vec_v2i64: |
| 812 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 813 | ; SIMD128-NEXT: .functype shr_s_vec_v2i64 (v128, v128) -> (v128){{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 814 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L0:[0-9]+]]=, $0, 0{{$}} |
| 815 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L1:[0-9]+]]=, $1, 0{{$}} |
| 816 | ; SIMD128-NEXT: i64.shr_s $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 817 | ; SIMD128-NEXT: i64x2.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 818 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L4:[0-9]+]]=, $0, 1{{$}} |
| 819 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L5:[0-9]+]]=, $1, 1{{$}} |
| 820 | ; SIMD128-NEXT: i64.shr_s $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 821 | ; SIMD128-NEXT: i64x2.replace_lane $push[[R:[0-9]+]]=, $pop[[L3]], 1, $pop[[L6]]{{$}} |
| 822 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 823 | define <2 x i64> @shr_s_vec_v2i64(<2 x i64> %v, <2 x i64> %x) { |
| 824 | %a = ashr <2 x i64> %v, %x |
| 825 | ret <2 x i64> %a |
| 826 | } |
| 827 | |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 828 | ; CHECK-LABEL: shr_u_v2i64: |
| 829 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 830 | ; SIMD128-NEXT: .functype shr_u_v2i64 (v128, i32) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 831 | ; SIMD128-NEXT: i64x2.shr_u $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 832 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 833 | define <2 x i64> @shr_u_v2i64(<2 x i64> %v, i32 %x) { |
| 834 | %x2 = zext i32 %x to i64 |
| 835 | %t = insertelement <2 x i64> undef, i64 %x2, i32 0 |
| 836 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 837 | %a = lshr <2 x i64> %v, %s |
| 838 | ret <2 x i64> %a |
| 839 | } |
| 840 | |
| 841 | ; CHECK-LABEL: shr_u_nozext_v2i64: |
| 842 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 843 | ; SIMD128-NEXT: .functype shr_u_nozext_v2i64 (v128, i64) -> (v128){{$}} |
Thomas Lively | 6a87dda | 2019-01-08 06:25:55 +0000 | [diff] [blame] | 844 | ; SIMD128-NEXT: i32.wrap_i64 $push[[L0:[0-9]+]]=, $1{{$}} |
Thomas Lively | f2550e0 | 2018-09-15 00:45:31 +0000 | [diff] [blame] | 845 | ; SIMD128-NEXT: i64x2.shr_u $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 846 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 847 | define <2 x i64> @shr_u_nozext_v2i64(<2 x i64> %v, i64 %x) { |
| 848 | %t = insertelement <2 x i64> undef, i64 %x, i32 0 |
| 849 | %s = shufflevector <2 x i64> %t, <2 x i64> undef, <2 x i32> <i32 0, i32 0> |
| 850 | %a = lshr <2 x i64> %v, %s |
| 851 | ret <2 x i64> %a |
| 852 | } |
| 853 | |
Thomas Lively | 55735d5 | 2018-10-20 01:31:18 +0000 | [diff] [blame] | 854 | ; CHECK-LABEL: shr_u_const_v2i64: |
| 855 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 856 | ; SIMD128-NEXT: .functype shr_u_const_v2i64 (v128) -> (v128){{$}} |
Thomas Lively | 55735d5 | 2018-10-20 01:31:18 +0000 | [diff] [blame] | 857 | ; SIMD128-NEXT: i32.const $push[[L0:[0-9]+]]=, 5{{$}} |
| 858 | ; SIMD128-NEXT: i64x2.shr_u $push[[R:[0-9]+]]=, $0, $pop[[L0]]{{$}} |
| 859 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 860 | define <2 x i64> @shr_u_const_v2i64(<2 x i64> %v) { |
| 861 | %a = lshr <2 x i64> %v, <i64 5, i64 5> |
| 862 | ret <2 x i64> %a |
| 863 | } |
| 864 | |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 865 | ; CHECK-LABEL: shr_u_vec_v2i64: |
| 866 | ; NO-SIMD128-NOT: i64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 867 | ; SIMD128-NEXT: .functype shr_u_vec_v2i64 (v128, v128) -> (v128){{$}} |
Thomas Lively | b2382c8 | 2018-11-02 00:39:57 +0000 | [diff] [blame] | 868 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L0:[0-9]+]]=, $0, 0{{$}} |
| 869 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L1:[0-9]+]]=, $1, 0{{$}} |
| 870 | ; SIMD128-NEXT: i64.shr_u $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} |
| 871 | ; SIMD128-NEXT: i64x2.splat $push[[L3:[0-9]+]]=, $pop[[L2]]{{$}} |
| 872 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L4:[0-9]+]]=, $0, 1{{$}} |
| 873 | ; SIMD128-NEXT: i64x2.extract_lane $push[[L5:[0-9]+]]=, $1, 1{{$}} |
| 874 | ; SIMD128-NEXT: i64.shr_u $push[[L6:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} |
| 875 | ; SIMD128-NEXT: i64x2.replace_lane $push[[R:[0-9]+]]=, $pop[[L3]], 1, $pop[[L6]]{{$}} |
| 876 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 877 | define <2 x i64> @shr_u_vec_v2i64(<2 x i64> %v, <2 x i64> %x) { |
| 878 | %a = lshr <2 x i64> %v, %x |
| 879 | ret <2 x i64> %a |
| 880 | } |
| 881 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 882 | ; CHECK-LABEL: and_v2i64: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 883 | ; NO-SIMD128-NOT: v128 |
| 884 | ; SIMD128-VM-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 885 | ; SIMD128-NEXT: .functype and_v2i64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 886 | ; SIMD128-NEXT: v128.and $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 887 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 888 | define <2 x i64> @and_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 889 | %a = and <2 x i64> %x, %y |
| 890 | ret <2 x i64> %a |
| 891 | } |
| 892 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 893 | ; CHECK-LABEL: or_v2i64: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 894 | ; NO-SIMD128-NOT: v128 |
| 895 | ; SIMD128-VM-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 896 | ; SIMD128-NEXT: .functype or_v2i64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 897 | ; SIMD128-NEXT: v128.or $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 898 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 899 | define <2 x i64> @or_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 900 | %a = or <2 x i64> %x, %y |
| 901 | ret <2 x i64> %a |
| 902 | } |
| 903 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 904 | ; CHECK-LABEL: xor_v2i64: |
Thomas Lively | ec71e01 | 2018-08-28 18:33:31 +0000 | [diff] [blame] | 905 | ; NO-SIMD128-NOT: v128 |
| 906 | ; SIMD128-VM-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 907 | ; SIMD128-NEXT: .functype xor_v2i64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 908 | ; SIMD128-NEXT: v128.xor $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 909 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | c174257 | 2018-08-23 00:48:37 +0000 | [diff] [blame] | 910 | define <2 x i64> @xor_v2i64(<2 x i64> %x, <2 x i64> %y) { |
| 911 | %a = xor <2 x i64> %x, %y |
| 912 | ret <2 x i64> %a |
| 913 | } |
| 914 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 915 | ; CHECK-LABEL: not_v2i64: |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 916 | ; NO-SIMD128-NOT: v128 |
| 917 | ; SIMD128-VM-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 918 | ; SIMD128-NEXT: .functype not_v2i64 (v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 919 | ; SIMD128-NEXT: v128.not $push[[R:[0-9]+]]=, $0{{$}} |
| 920 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 995ad61 | 2018-08-28 18:31:15 +0000 | [diff] [blame] | 921 | define <2 x i64> @not_v2i64(<2 x i64> %x) { |
| 922 | %a = xor <2 x i64> %x, <i64 -1, i64 -1> |
| 923 | ret <2 x i64> %a |
| 924 | } |
| 925 | |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 926 | ; CHECK-LABEL: bitselect_v2i64: |
| 927 | ; NO-SIMD128-NOT: v128 |
| 928 | ; SIMD128-VM-NOT: v128 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 929 | ; SIMD128-NEXT: .functype bitselect_v2i64 (v128, v128, v128) -> (v128){{$}} |
Thomas Lively | 5d461c9 | 2018-10-03 23:02:23 +0000 | [diff] [blame] | 930 | ; SIMD128-SLOW-NEXT: v128.bitselect $push[[R:[0-9]+]]=, $1, $2, $0{{$}} |
| 931 | ; SIMD128-SLOW-NEXT: return $pop[[R]]{{$}} |
| 932 | ; SIMD128-FAST-NEXT: v128.not |
| 933 | ; SIMD128-FAST-NEXT: v128.and |
| 934 | ; SIMD128-FAST-NEXT: v128.and |
| 935 | ; SIMD128-FAST-NEXT: v128.or |
| 936 | ; SIMD128-FAST-NEXT: return |
| 937 | define <2 x i64> @bitselect_v2i64(<2 x i64> %c, <2 x i64> %v1, <2 x i64> %v2) { |
| 938 | %masked_v1 = and <2 x i64> %v1, %c |
| 939 | %inv_mask = xor <2 x i64> <i64 -1, i64 -1>, %c |
| 940 | %masked_v2 = and <2 x i64> %v2, %inv_mask |
| 941 | %a = or <2 x i64> %masked_v2, %masked_v1 |
| 942 | ret <2 x i64> %a |
| 943 | } |
| 944 | |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 945 | ; ============================================================================== |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 946 | ; 4 x float |
| 947 | ; ============================================================================== |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 948 | ; CHECK-LABEL: neg_v4f32: |
| 949 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 950 | ; SIMD128-NEXT: .functype neg_v4f32 (v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 951 | ; SIMD128-NEXT: f32x4.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 952 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 953 | define <4 x float> @neg_v4f32(<4 x float> %x) { |
Thomas Lively | 108e98e | 2018-10-10 01:09:09 +0000 | [diff] [blame] | 954 | ; nsz makes this semantically equivalent to flipping sign bit |
| 955 | %a = fsub nsz <4 x float> <float 0.0, float 0.0, float 0.0, float 0.0>, %x |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 956 | ret <4 x float> %a |
| 957 | } |
| 958 | |
Thomas Lively | aaf4e2c | 2018-09-18 21:45:12 +0000 | [diff] [blame] | 959 | ; CHECK-LABEL: abs_v4f32: |
| 960 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 961 | ; SIMD128-NEXT: .functype abs_v4f32 (v128) -> (v128){{$}} |
Thomas Lively | 5861536 | 2018-09-24 23:42:07 +0000 | [diff] [blame] | 962 | ; SIMD128-NEXT: f32x4.abs $push[[R:[0-9]+]]=, $0{{$}} |
| 963 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | aaf4e2c | 2018-09-18 21:45:12 +0000 | [diff] [blame] | 964 | declare <4 x float> @llvm.fabs.v4f32(<4 x float>) nounwind readnone |
| 965 | define <4 x float> @abs_v4f32(<4 x float> %x) { |
| 966 | %a = call <4 x float> @llvm.fabs.v4f32(<4 x float> %x) |
| 967 | ret <4 x float> %a |
| 968 | } |
| 969 | |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 970 | ; CHECK-LABEL: min_unordered_v4f32: |
| 971 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 972 | ; SIMD128-NEXT: .functype min_unordered_v4f32 (v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 973 | ; SIMD128-NEXT: f32.const $push[[L0:[0-9]+]]=, 0x1.4p2 |
| 974 | ; SIMD128-NEXT: f32x4.splat $push[[L1:[0-9]+]]=, $pop[[L0]] |
| 975 | ; SIMD128-NEXT: f32x4.min $push[[R:[0-9]+]]=, $0, $pop[[L1]]{{$}} |
| 976 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 977 | define <4 x float> @min_unordered_v4f32(<4 x float> %x) { |
| 978 | %cmps = fcmp ule <4 x float> %x, <float 5., float 5., float 5., float 5.> |
| 979 | %a = select <4 x i1> %cmps, <4 x float> %x, |
| 980 | <4 x float> <float 5., float 5., float 5., float 5.> |
| 981 | ret <4 x float> %a |
| 982 | } |
| 983 | |
| 984 | ; CHECK-LABEL: max_unordered_v4f32: |
| 985 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 986 | ; SIMD128-NEXT: .functype max_unordered_v4f32 (v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 987 | ; SIMD128-NEXT: f32.const $push[[L0:[0-9]+]]=, 0x1.4p2 |
| 988 | ; SIMD128-NEXT: f32x4.splat $push[[L1:[0-9]+]]=, $pop[[L0]] |
| 989 | ; SIMD128-NEXT: f32x4.max $push[[R:[0-9]+]]=, $0, $pop[[L1]]{{$}} |
| 990 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 991 | define <4 x float> @max_unordered_v4f32(<4 x float> %x) { |
| 992 | %cmps = fcmp uge <4 x float> %x, <float 5., float 5., float 5., float 5.> |
| 993 | %a = select <4 x i1> %cmps, <4 x float> %x, |
| 994 | <4 x float> <float 5., float 5., float 5., float 5.> |
| 995 | ret <4 x float> %a |
| 996 | } |
| 997 | |
| 998 | ; CHECK-LABEL: min_ordered_v4f32: |
| 999 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1000 | ; SIMD128-NEXT: .functype min_ordered_v4f32 (v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1001 | ; SIMD128-NEXT: f32.const $push[[L0:[0-9]+]]=, 0x1.4p2 |
| 1002 | ; SIMD128-NEXT: f32x4.splat $push[[L1:[0-9]+]]=, $pop[[L0]] |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1003 | ; SIMD128-NEXT: f32x4.min $push[[R:[0-9]+]]=, $0, $pop[[L1]]{{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1004 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1005 | define <4 x float> @min_ordered_v4f32(<4 x float> %x) { |
| 1006 | %cmps = fcmp ole <4 x float> <float 5., float 5., float 5., float 5.>, %x |
| 1007 | %a = select <4 x i1> %cmps, |
| 1008 | <4 x float> <float 5., float 5., float 5., float 5.>, <4 x float> %x |
| 1009 | ret <4 x float> %a |
| 1010 | } |
| 1011 | |
| 1012 | ; CHECK-LABEL: max_ordered_v4f32: |
| 1013 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1014 | ; SIMD128-NEXT: .functype max_ordered_v4f32 (v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1015 | ; SIMD128-NEXT: f32.const $push[[L0:[0-9]+]]=, 0x1.4p2 |
| 1016 | ; SIMD128-NEXT: f32x4.splat $push[[L1:[0-9]+]]=, $pop[[L0]] |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1017 | ; SIMD128-NEXT: f32x4.max $push[[R:[0-9]+]]=, $0, $pop[[L1]]{{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1018 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1019 | define <4 x float> @max_ordered_v4f32(<4 x float> %x) { |
| 1020 | %cmps = fcmp oge <4 x float> <float 5., float 5., float 5., float 5.>, %x |
| 1021 | %a = select <4 x i1> %cmps, |
| 1022 | <4 x float> <float 5., float 5., float 5., float 5.>, <4 x float> %x |
| 1023 | ret <4 x float> %a |
| 1024 | } |
| 1025 | |
| 1026 | ; CHECK-LABEL: min_intrinsic_v4f32: |
| 1027 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1028 | ; SIMD128-NEXT: .functype min_intrinsic_v4f32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1029 | ; SIMD128-NEXT: f32x4.min $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1030 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1031 | declare <4 x float> @llvm.minimum.v4f32(<4 x float>, <4 x float>) |
| 1032 | define <4 x float> @min_intrinsic_v4f32(<4 x float> %x, <4 x float> %y) { |
| 1033 | %a = call <4 x float> @llvm.minimum.v4f32(<4 x float> %x, <4 x float> %y) |
| 1034 | ret <4 x float> %a |
| 1035 | } |
| 1036 | |
| 1037 | ; CHECK-LABEL: max_intrinsic_v4f32: |
| 1038 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1039 | ; SIMD128-NEXT: .functype max_intrinsic_v4f32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1040 | ; SIMD128-NEXT: f32x4.max $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1041 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1042 | declare <4 x float> @llvm.maximum.v4f32(<4 x float>, <4 x float>) |
| 1043 | define <4 x float> @max_intrinsic_v4f32(<4 x float> %x, <4 x float> %y) { |
| 1044 | %a = call <4 x float> @llvm.maximum.v4f32(<4 x float> %x, <4 x float> %y) |
| 1045 | ret <4 x float> %a |
| 1046 | } |
| 1047 | |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1048 | ; CHECK-LABEL: min_const_intrinsic_v4f32: |
| 1049 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1050 | ; SIMD128-NEXT: .functype min_const_intrinsic_v4f32 () -> (v128){{$}} |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1051 | ; SIMD128-NEXT: f32.const $push[[L:[0-9]+]]=, 0x1.4p2{{$}} |
| 1052 | ; SIMD128-NEXT: f32x4.splat $push[[R:[0-9]+]]=, $pop[[L]]{{$}} |
| 1053 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1054 | define <4 x float> @min_const_intrinsic_v4f32() { |
| 1055 | %a = call <4 x float> @llvm.minimum.v4f32( |
| 1056 | <4 x float> <float 42., float 42., float 42., float 42.>, |
| 1057 | <4 x float> <float 5., float 5., float 5., float 5.> |
| 1058 | ) |
| 1059 | ret <4 x float> %a |
| 1060 | } |
| 1061 | |
| 1062 | ; CHECK-LABEL: max_const_intrinsic_v4f32: |
| 1063 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1064 | ; SIMD128-NEXT: .functype max_const_intrinsic_v4f32 () -> (v128){{$}} |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1065 | ; SIMD128-NEXT: f32.const $push[[L:[0-9]+]]=, 0x1.5p5{{$}} |
| 1066 | ; SIMD128-NEXT: f32x4.splat $push[[R:[0-9]+]]=, $pop[[L]]{{$}} |
| 1067 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1068 | define <4 x float> @max_const_intrinsic_v4f32() { |
| 1069 | %a = call <4 x float> @llvm.maximum.v4f32( |
| 1070 | <4 x float> <float 42., float 42., float 42., float 42.>, |
| 1071 | <4 x float> <float 5., float 5., float 5., float 5.> |
| 1072 | ) |
| 1073 | ret <4 x float> %a |
| 1074 | } |
| 1075 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1076 | ; CHECK-LABEL: add_v4f32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 1077 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1078 | ; SIMD128-NEXT: .functype add_v4f32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 1079 | ; SIMD128-NEXT: f32x4.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1080 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 1081 | define <4 x float> @add_v4f32(<4 x float> %x, <4 x float> %y) { |
| 1082 | %a = fadd <4 x float> %x, %y |
| 1083 | ret <4 x float> %a |
| 1084 | } |
| 1085 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1086 | ; CHECK-LABEL: sub_v4f32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 1087 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1088 | ; SIMD128-NEXT: .functype sub_v4f32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 1089 | ; SIMD128-NEXT: f32x4.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1090 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 1091 | define <4 x float> @sub_v4f32(<4 x float> %x, <4 x float> %y) { |
| 1092 | %a = fsub <4 x float> %x, %y |
| 1093 | ret <4 x float> %a |
| 1094 | } |
| 1095 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1096 | ; CHECK-LABEL: div_v4f32: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1097 | ; NO-SIMD128-NOT: f32x4 |
Thomas Lively | 8dbf29af | 2018-12-20 02:10:22 +0000 | [diff] [blame] | 1098 | ; SIMD128-VM-NOT: f32x4.div |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1099 | ; SIMD128-NEXT: .functype div_v4f32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 1100 | ; SIMD128-NEXT: f32x4.div $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1101 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1102 | define <4 x float> @div_v4f32(<4 x float> %x, <4 x float> %y) { |
| 1103 | %a = fdiv <4 x float> %x, %y |
| 1104 | ret <4 x float> %a |
| 1105 | } |
| 1106 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1107 | ; CHECK-LABEL: mul_v4f32: |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 1108 | ; NO-SIMD128-NOT: f32x4 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1109 | ; SIMD128-NEXT: .functype mul_v4f32 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 1110 | ; SIMD128-NEXT: f32x4.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1111 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 39bf39f | 2016-08-02 23:16:09 +0000 | [diff] [blame] | 1112 | define <4 x float> @mul_v4f32(<4 x float> %x, <4 x float> %y) { |
| 1113 | %a = fmul <4 x float> %x, %y |
| 1114 | ret <4 x float> %a |
| 1115 | } |
| 1116 | |
Thomas Lively | 12da0f9 | 2018-09-25 03:39:28 +0000 | [diff] [blame] | 1117 | ; CHECK-LABEL: sqrt_v4f32: |
| 1118 | ; NO-SIMD128-NOT: f32x4 |
Thomas Lively | 8dbf29af | 2018-12-20 02:10:22 +0000 | [diff] [blame] | 1119 | ; SIMD128-VM-NOT: f32x4.sqrt |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1120 | ; SIMD128-NEXT: .functype sqrt_v4f32 (v128) -> (v128){{$}} |
Thomas Lively | 12da0f9 | 2018-09-25 03:39:28 +0000 | [diff] [blame] | 1121 | ; SIMD128-NEXT: f32x4.sqrt $push[[R:[0-9]+]]=, $0{{$}} |
| 1122 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1123 | declare <4 x float> @llvm.sqrt.v4f32(<4 x float> %x) |
| 1124 | define <4 x float> @sqrt_v4f32(<4 x float> %x) { |
| 1125 | %a = call <4 x float> @llvm.sqrt.v4f32(<4 x float> %x) |
| 1126 | ret <4 x float> %a |
| 1127 | } |
| 1128 | |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1129 | ; ============================================================================== |
| 1130 | ; 2 x double |
| 1131 | ; ============================================================================== |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 1132 | ; CHECK-LABEL: neg_v2f64: |
| 1133 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1134 | ; SIMD128-NEXT: .functype neg_v2f64 (v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 1135 | ; SIMD128-NEXT: f64x2.neg $push[[R:[0-9]+]]=, $0{{$}} |
| 1136 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 1137 | define <2 x double> @neg_v2f64(<2 x double> %x) { |
Thomas Lively | 108e98e | 2018-10-10 01:09:09 +0000 | [diff] [blame] | 1138 | ; nsz makes this semantically equivalent to flipping sign bit |
| 1139 | %a = fsub nsz <2 x double> <double 0., double 0.>, %x |
Thomas Lively | 88b7443 | 2018-09-14 22:35:12 +0000 | [diff] [blame] | 1140 | ret <2 x double> %a |
| 1141 | } |
| 1142 | |
Thomas Lively | aaf4e2c | 2018-09-18 21:45:12 +0000 | [diff] [blame] | 1143 | ; CHECK-LABEL: abs_v2f64: |
| 1144 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1145 | ; SIMD128-NEXT: .functype abs_v2f64 (v128) -> (v128){{$}} |
Thomas Lively | 5861536 | 2018-09-24 23:42:07 +0000 | [diff] [blame] | 1146 | ; SIMD128-NEXT: f64x2.abs $push[[R:[0-9]+]]=, $0{{$}} |
| 1147 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Thomas Lively | aaf4e2c | 2018-09-18 21:45:12 +0000 | [diff] [blame] | 1148 | declare <2 x double> @llvm.fabs.v2f64(<2 x double>) nounwind readnone |
| 1149 | define <2 x double> @abs_v2f64(<2 x double> %x) { |
| 1150 | %a = call <2 x double> @llvm.fabs.v2f64(<2 x double> %x) |
| 1151 | ret <2 x double> %a |
| 1152 | } |
| 1153 | |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1154 | ; CHECK-LABEL: min_unordered_v2f64: |
| 1155 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1156 | ; SIMD128-NEXT: .functype min_unordered_v2f64 (v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1157 | ; SIMD128-NEXT: f64.const $push[[L0:[0-9]+]]=, 0x1.4p2 |
| 1158 | ; SIMD128-NEXT: f64x2.splat $push[[L1:[0-9]+]]=, $pop[[L0]] |
| 1159 | ; SIMD128-NEXT: f64x2.min $push[[R:[0-9]+]]=, $0, $pop[[L1]]{{$}} |
| 1160 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1161 | define <2 x double> @min_unordered_v2f64(<2 x double> %x) { |
| 1162 | %cmps = fcmp ule <2 x double> %x, <double 5., double 5.> |
| 1163 | %a = select <2 x i1> %cmps, <2 x double> %x, |
| 1164 | <2 x double> <double 5., double 5.> |
| 1165 | ret <2 x double> %a |
| 1166 | } |
| 1167 | |
| 1168 | ; CHECK-LABEL: max_unordered_v2f64: |
| 1169 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1170 | ; SIMD128-NEXT: .functype max_unordered_v2f64 (v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1171 | ; SIMD128-NEXT: f64.const $push[[L0:[0-9]+]]=, 0x1.4p2 |
| 1172 | ; SIMD128-NEXT: f64x2.splat $push[[L1:[0-9]+]]=, $pop[[L0]] |
| 1173 | ; SIMD128-NEXT: f64x2.max $push[[R:[0-9]+]]=, $0, $pop[[L1]]{{$}} |
| 1174 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1175 | define <2 x double> @max_unordered_v2f64(<2 x double> %x) { |
| 1176 | %cmps = fcmp uge <2 x double> %x, <double 5., double 5.> |
| 1177 | %a = select <2 x i1> %cmps, <2 x double> %x, |
| 1178 | <2 x double> <double 5., double 5.> |
| 1179 | ret <2 x double> %a |
| 1180 | } |
| 1181 | |
| 1182 | ; CHECK-LABEL: min_ordered_v2f64: |
| 1183 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1184 | ; SIMD128-NEXT: .functype min_ordered_v2f64 (v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1185 | ; SIMD128-NEXT: f64.const $push[[L0:[0-9]+]]=, 0x1.4p2 |
| 1186 | ; SIMD128-NEXT: f64x2.splat $push[[L1:[0-9]+]]=, $pop[[L0]] |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1187 | ; SIMD128-NEXT: f64x2.min $push[[R:[0-9]+]]=, $0, $pop[[L1]]{{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1188 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1189 | define <2 x double> @min_ordered_v2f64(<2 x double> %x) { |
| 1190 | %cmps = fcmp ole <2 x double> <double 5., double 5.>, %x |
| 1191 | %a = select <2 x i1> %cmps, <2 x double> <double 5., double 5.>, |
| 1192 | <2 x double> %x |
| 1193 | ret <2 x double> %a |
| 1194 | } |
| 1195 | |
| 1196 | ; CHECK-LABEL: max_ordered_v2f64: |
| 1197 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1198 | ; SIMD128-NEXT: .functype max_ordered_v2f64 (v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1199 | ; SIMD128-NEXT: f64.const $push[[L0:[0-9]+]]=, 0x1.4p2 |
| 1200 | ; SIMD128-NEXT: f64x2.splat $push[[L1:[0-9]+]]=, $pop[[L0]] |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1201 | ; SIMD128-NEXT: f64x2.max $push[[R:[0-9]+]]=, $0, $pop[[L1]]{{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1202 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1203 | define <2 x double> @max_ordered_v2f64(<2 x double> %x) { |
| 1204 | %cmps = fcmp oge <2 x double> <double 5., double 5.>, %x |
| 1205 | %a = select <2 x i1> %cmps, <2 x double> <double 5., double 5.>, |
| 1206 | <2 x double> %x |
| 1207 | ret <2 x double> %a |
| 1208 | } |
| 1209 | |
| 1210 | ; CHECK-LABEL: min_intrinsic_v2f64: |
| 1211 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1212 | ; SIMD128-NEXT: .functype min_intrinsic_v2f64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1213 | ; SIMD128-NEXT: f64x2.min $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1214 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1215 | declare <2 x double> @llvm.minimum.v2f64(<2 x double>, <2 x double>) |
| 1216 | define <2 x double> @min_intrinsic_v2f64(<2 x double> %x, <2 x double> %y) { |
| 1217 | %a = call <2 x double> @llvm.minimum.v2f64(<2 x double> %x, <2 x double> %y) |
| 1218 | ret <2 x double> %a |
| 1219 | } |
| 1220 | |
| 1221 | ; CHECK-LABEL: max_intrinsic_v2f64: |
| 1222 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1223 | ; SIMD128-NEXT: .functype max_intrinsic_v2f64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 3afc346 | 2018-10-13 07:26:10 +0000 | [diff] [blame] | 1224 | ; SIMD128-NEXT: f64x2.max $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1225 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1226 | declare <2 x double> @llvm.maximum.v2f64(<2 x double>, <2 x double>) |
| 1227 | define <2 x double> @max_intrinsic_v2f64(<2 x double> %x, <2 x double> %y) { |
| 1228 | %a = call <2 x double> @llvm.maximum.v2f64(<2 x double> %x, <2 x double> %y) |
| 1229 | ret <2 x double> %a |
| 1230 | } |
| 1231 | |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1232 | ; CHECK-LABEL: min_const_intrinsic_v2f64: |
| 1233 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1234 | ; SIMD128-NEXT: .functype min_const_intrinsic_v2f64 () -> (v128){{$}} |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1235 | ; SIMD128-NEXT: f64.const $push[[L:[0-9]+]]=, 0x1.4p2{{$}} |
| 1236 | ; SIMD128-NEXT: f64x2.splat $push[[R:[0-9]+]]=, $pop[[L]]{{$}} |
| 1237 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1238 | define <2 x double> @min_const_intrinsic_v2f64() { |
| 1239 | %a = call <2 x double> @llvm.minimum.v2f64( |
| 1240 | <2 x double> <double 42., double 42.>, |
| 1241 | <2 x double> <double 5., double 5.> |
| 1242 | ) |
| 1243 | ret <2 x double> %a |
| 1244 | } |
| 1245 | |
| 1246 | ; CHECK-LABEL: max_const_intrinsic_v2f64: |
| 1247 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1248 | ; SIMD128-NEXT: .functype max_const_intrinsic_v2f64 () -> (v128){{$}} |
Thomas Lively | 43bc462 | 2018-10-24 22:18:54 +0000 | [diff] [blame] | 1249 | ; SIMD128-NEXT: f64.const $push[[L:[0-9]+]]=, 0x1.5p5{{$}} |
| 1250 | ; SIMD128-NEXT: f64x2.splat $push[[R:[0-9]+]]=, $pop[[L]]{{$}} |
| 1251 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1252 | define <2 x double> @max_const_intrinsic_v2f64() { |
| 1253 | %a = call <2 x double> @llvm.maximum.v2f64( |
| 1254 | <2 x double> <double 42., double 42.>, |
| 1255 | <2 x double> <double 5., double 5.> |
| 1256 | ) |
| 1257 | ret <2 x double> %a |
| 1258 | } |
| 1259 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1260 | ; CHECK-LABEL: add_v2f64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1261 | ; NO-SIMD128-NOT: f64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1262 | ; SIMD128-VM-NOT: f62x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1263 | ; SIMD128-NEXT: .functype add_v2f64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 1264 | ; SIMD128-NEXT: f64x2.add $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1265 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1266 | define <2 x double> @add_v2f64(<2 x double> %x, <2 x double> %y) { |
| 1267 | %a = fadd <2 x double> %x, %y |
| 1268 | ret <2 x double> %a |
| 1269 | } |
| 1270 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1271 | ; CHECK-LABEL: sub_v2f64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1272 | ; NO-SIMD128-NOT: f64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1273 | ; SIMD128-VM-NOT: f62x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1274 | ; SIMD128-NEXT: .functype sub_v2f64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 1275 | ; SIMD128-NEXT: f64x2.sub $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1276 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1277 | define <2 x double> @sub_v2f64(<2 x double> %x, <2 x double> %y) { |
| 1278 | %a = fsub <2 x double> %x, %y |
| 1279 | ret <2 x double> %a |
| 1280 | } |
| 1281 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1282 | ; CHECK-LABEL: div_v2f64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1283 | ; NO-SIMD128-NOT: f64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1284 | ; SIMD128-VM-NOT: f62x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1285 | ; SIMD128-NEXT: .functype div_v2f64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 1286 | ; SIMD128-NEXT: f64x2.div $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1287 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1288 | define <2 x double> @div_v2f64(<2 x double> %x, <2 x double> %y) { |
| 1289 | %a = fdiv <2 x double> %x, %y |
| 1290 | ret <2 x double> %a |
| 1291 | } |
| 1292 | |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1293 | ; CHECK-LABEL: mul_v2f64: |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1294 | ; NO-SIMD128-NOT: f64x2 |
Thomas Lively | a3937b2 | 2018-09-14 21:21:42 +0000 | [diff] [blame] | 1295 | ; SIMD128-VM-NOT: f62x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1296 | ; SIMD128-NEXT: .functype mul_v2f64 (v128, v128) -> (v128){{$}} |
Thomas Lively | 66f3dc0 | 2018-09-15 01:12:48 +0000 | [diff] [blame] | 1297 | ; SIMD128-NEXT: f64x2.mul $push[[R:[0-9]+]]=, $0, $1{{$}} |
| 1298 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
Derek Schuff | 51ed131 | 2018-08-07 21:24:01 +0000 | [diff] [blame] | 1299 | define <2 x double> @mul_v2f64(<2 x double> %x, <2 x double> %y) { |
| 1300 | %a = fmul <2 x double> %x, %y |
| 1301 | ret <2 x double> %a |
| 1302 | } |
Thomas Lively | 12da0f9 | 2018-09-25 03:39:28 +0000 | [diff] [blame] | 1303 | |
| 1304 | ; CHECK-LABEL: sqrt_v2f64: |
| 1305 | ; NO-SIMD128-NOT: f64x2 |
Wouter van Oortmerssen | 49482f8 | 2018-11-19 17:10:36 +0000 | [diff] [blame] | 1306 | ; SIMD128-NEXT: .functype sqrt_v2f64 (v128) -> (v128){{$}} |
Thomas Lively | 12da0f9 | 2018-09-25 03:39:28 +0000 | [diff] [blame] | 1307 | ; SIMD128-NEXT: f64x2.sqrt $push[[R:[0-9]+]]=, $0{{$}} |
| 1308 | ; SIMD128-NEXT: return $pop[[R]]{{$}} |
| 1309 | declare <2 x double> @llvm.sqrt.v2f64(<2 x double> %x) |
| 1310 | define <2 x double> @sqrt_v2f64(<2 x double> %x) { |
| 1311 | %a = call <2 x double> @llvm.sqrt.v2f64(<2 x double> %x) |
| 1312 | ret <2 x double> %a |
| 1313 | } |