|
| 1 | +; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5 |
| 2 | +; RUN: llc < %s -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+simd128 | FileCheck %s |
| 3 | + |
| 4 | +target triple = "wasm64" |
| 5 | + |
| 6 | +define i32 @all_true_16_i8(<16 x i8> %v) { |
| 7 | +; CHECK-LABEL: all_true_16_i8: |
| 8 | +; CHECK: .functype all_true_16_i8 (v128) -> (i32) |
| 9 | +; CHECK-NEXT: # %bb.0: |
| 10 | +; CHECK-NEXT: v128.const $push0=, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 |
| 11 | +; CHECK-NEXT: i8x16.eq $push1=, $0, $pop0 |
| 12 | +; CHECK-NEXT: v128.any_true $push2=, $pop1 |
| 13 | +; CHECK-NEXT: i32.const $push3=, -1 |
| 14 | +; CHECK-NEXT: i32.xor $push4=, $pop2, $pop3 |
| 15 | +; CHECK-NEXT: i32.const $push5=, 1 |
| 16 | +; CHECK-NEXT: i32.and $push6=, $pop4, $pop5 |
| 17 | +; CHECK-NEXT: return $pop6 |
| 18 | + %1 = icmp eq <16 x i8> %v, zeroinitializer |
| 19 | + %2 = bitcast <16 x i1> %1 to i16 |
| 20 | + %3 = icmp eq i16 %2, 0 |
| 21 | + %conv3 = zext i1 %3 to i32 |
| 22 | + ret i32 %conv3 |
| 23 | +} |
| 24 | + |
| 25 | + |
| 26 | +define i32 @all_true_4_i32(<4 x i32> %v) { |
| 27 | +; CHECK-LABEL: all_true_4_i32: |
| 28 | +; CHECK: .functype all_true_4_i32 (v128) -> (i32) |
| 29 | +; CHECK-NEXT: # %bb.0: |
| 30 | +; CHECK-NEXT: v128.const $push0=, 0, 0, 0, 0 |
| 31 | +; CHECK-NEXT: i32x4.eq $push1=, $0, $pop0 |
| 32 | +; CHECK-NEXT: v128.any_true $push2=, $pop1 |
| 33 | +; CHECK-NEXT: i32.const $push3=, -1 |
| 34 | +; CHECK-NEXT: i32.xor $push4=, $pop2, $pop3 |
| 35 | +; CHECK-NEXT: i32.const $push5=, 1 |
| 36 | +; CHECK-NEXT: i32.and $push6=, $pop4, $pop5 |
| 37 | +; CHECK-NEXT: return $pop6 |
| 38 | + %1 = icmp eq <4 x i32> %v, zeroinitializer |
| 39 | + %2 = bitcast <4 x i1> %1 to i4 |
| 40 | + %3 = icmp eq i4 %2, 0 |
| 41 | + %conv3 = zext i1 %3 to i32 |
| 42 | + ret i32 %conv3 |
| 43 | +} |
| 44 | + |
| 45 | + |
| 46 | +define i32 @all_true_8_i16(<8 x i16> %v) { |
| 47 | +; CHECK-LABEL: all_true_8_i16: |
| 48 | +; CHECK: .functype all_true_8_i16 (v128) -> (i32) |
| 49 | +; CHECK-NEXT: # %bb.0: |
| 50 | +; CHECK-NEXT: v128.const $push0=, 0, 0, 0, 0, 0, 0, 0, 0 |
| 51 | +; CHECK-NEXT: i16x8.eq $push1=, $0, $pop0 |
| 52 | +; CHECK-NEXT: v128.any_true $push2=, $pop1 |
| 53 | +; CHECK-NEXT: i32.const $push3=, -1 |
| 54 | +; CHECK-NEXT: i32.xor $push4=, $pop2, $pop3 |
| 55 | +; CHECK-NEXT: i32.const $push5=, 1 |
| 56 | +; CHECK-NEXT: i32.and $push6=, $pop4, $pop5 |
| 57 | +; CHECK-NEXT: return $pop6 |
| 58 | + %1 = icmp eq <8 x i16> %v, zeroinitializer |
| 59 | + %2 = bitcast <8 x i1> %1 to i8 |
| 60 | + %3 = icmp eq i8 %2, 0 |
| 61 | + %conv3 = zext i1 %3 to i32 |
| 62 | + ret i32 %conv3 |
| 63 | +} |
| 64 | + |
| 65 | + |
| 66 | +define i32 @all_true_2_i64(<2 x i64> %v) { |
| 67 | +; CHECK-LABEL: all_true_2_i64: |
| 68 | +; CHECK: .functype all_true_2_i64 (v128) -> (i32) |
| 69 | +; CHECK-NEXT: # %bb.0: |
| 70 | +; CHECK-NEXT: v128.const $push0=, 0, 0 |
| 71 | +; CHECK-NEXT: i64x2.eq $push1=, $0, $pop0 |
| 72 | +; CHECK-NEXT: v128.any_true $push2=, $pop1 |
| 73 | +; CHECK-NEXT: i32.const $push3=, -1 |
| 74 | +; CHECK-NEXT: i32.xor $push4=, $pop2, $pop3 |
| 75 | +; CHECK-NEXT: i32.const $push5=, 1 |
| 76 | +; CHECK-NEXT: i32.and $push6=, $pop4, $pop5 |
| 77 | +; CHECK-NEXT: return $pop6 |
| 78 | + %1 = icmp eq <2 x i64> %v, zeroinitializer |
| 79 | + %2 = bitcast <2 x i1> %1 to i2 |
| 80 | + %3 = icmp eq i2 %2, 0 |
| 81 | + %conv3 = zext i1 %3 to i32 |
| 82 | + ret i32 %conv3 |
| 83 | +} |
0 commit comments