brintos

brintos / llvm-project-archived public Read only

0
0
Text · 9.1 KiB · 7736e78 Raw
228 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 52 3; RUN: llc < %s -mtriple=wasm32 -verify-machineinstrs -disable-wasm-fallthrough-return-opt -wasm-disable-explicit-locals -wasm-keep-registers -mattr=+simd128 | FileCheck %s --check-prefix=SIMD1284 5target datalayout = "e-m:e-p:32:32-p10:8:8-p20:8:8-i64:64-i128:128-n32:64-S128-ni:1:10:20"6target triple = "wasm32"7 8define <4 x i32> @sext_high_v4i8(<8 x i8> %in) {9; SIMD128-LABEL: sext_high_v4i8:10; SIMD128:         .functype sext_high_v4i8 (v128) -> (v128)11; SIMD128-NEXT:  # %bb.0:12; SIMD128-NEXT:    i8x16.shuffle $push0=, $0, $0, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 013; SIMD128-NEXT:    i16x8.extend_low_i8x16_s $push1=, $pop014; SIMD128-NEXT:    i32x4.extend_low_i16x8_s $push2=, $pop115; SIMD128-NEXT:    return $pop216 %shuffle = shufflevector <8 x i8> %in, <8 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>17 %res = sext <4 x i8> %shuffle to <4 x i32>18 ret <4 x i32> %res19}20 21define <4 x i32> @zext_high_v4i8(<8 x i8> %in) {22; SIMD128-LABEL: zext_high_v4i8:23; SIMD128:         .functype zext_high_v4i8 (v128) -> (v128)24; SIMD128-NEXT:  # %bb.0:25; SIMD128-NEXT:    i8x16.shuffle $push0=, $0, $0, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 026; SIMD128-NEXT:    i16x8.extend_low_i8x16_u $push1=, $pop027; SIMD128-NEXT:    i32x4.extend_low_i16x8_u $push2=, $pop128; SIMD128-NEXT:    return $pop229 %shuffle = shufflevector <8 x i8> %in, <8 x i8> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>30 %res = zext <4 x i8> %shuffle to <4 x i32>31 ret <4 x i32> %res32}33 34define <8 x i16> @sext_high_v8i8(<16 x i8> %in) {35; SIMD128-LABEL: sext_high_v8i8:36; SIMD128:         .functype sext_high_v8i8 (v128) -> (v128)37; SIMD128-NEXT:  # %bb.0:38; SIMD128-NEXT:    i16x8.extend_high_i8x16_s $push0=, $039; SIMD128-NEXT:    return $pop040 %shuffle = shufflevector <16 x i8> %in, <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>41 %res = sext <8 x i8> %shuffle to <8 x i16>42 ret <8 x i16> %res43}44 45define <8 x i16> @zext_high_v8i8(<16 x i8> %in) {46; SIMD128-LABEL: zext_high_v8i8:47; SIMD128:         .functype zext_high_v8i8 (v128) -> (v128)48; SIMD128-NEXT:  # %bb.0:49; SIMD128-NEXT:    i16x8.extend_high_i8x16_u $push0=, $050; SIMD128-NEXT:    return $pop051 %shuffle = shufflevector <16 x i8> %in, <16 x i8> poison, <8 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15>52 %res = zext <8 x i8> %shuffle to <8 x i16>53 ret <8 x i16> %res54}55 56define <2 x i32> @sext_high_v2i16(<4 x i16> %in) {57; SIMD128-LABEL: sext_high_v2i16:58; SIMD128:         .functype sext_high_v2i16 (v128) -> (v128)59; SIMD128-NEXT:  # %bb.0:60; SIMD128-NEXT:    i8x16.shuffle $push0=, $0, $0, 4, 5, 6, 7, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 161; SIMD128-NEXT:    i32x4.extend_low_i16x8_s $push1=, $pop062; SIMD128-NEXT:    return $pop163 %shuffle = shufflevector <4 x i16> %in, <4 x i16> poison, <2 x i32> <i32 2, i32 3>64 %res = sext <2 x i16> %shuffle to <2 x i32>65 ret <2 x i32> %res66}67 68define <2 x i32> @zext_high_v2i16(<4 x i16> %in) {69; SIMD128-LABEL: zext_high_v2i16:70; SIMD128:         .functype zext_high_v2i16 (v128) -> (v128)71; SIMD128-NEXT:  # %bb.0:72; SIMD128-NEXT:    i8x16.shuffle $push0=, $0, $0, 4, 5, 6, 7, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 173; SIMD128-NEXT:    i32x4.extend_low_i16x8_u $push1=, $pop074; SIMD128-NEXT:    return $pop175 %shuffle = shufflevector <4 x i16> %in, <4 x i16> poison, <2 x i32> <i32 2, i32 3>76 %res = zext <2 x i16> %shuffle to <2 x i32>77 ret <2 x i32> %res78}79 80define <4 x i32> @sext_high_v4i16(<8 x i16> %in) {81; SIMD128-LABEL: sext_high_v4i16:82; SIMD128:         .functype sext_high_v4i16 (v128) -> (v128)83; SIMD128-NEXT:  # %bb.0:84; SIMD128-NEXT:    i32x4.extend_high_i16x8_s $push0=, $085; SIMD128-NEXT:    return $pop086 %shuffle = shufflevector <8 x i16> %in, <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>87 %res = sext <4 x i16> %shuffle to <4 x i32>88 ret <4 x i32> %res89}90 91define <4 x i32> @zext_high_v4i16(<8 x i16> %in) {92; SIMD128-LABEL: zext_high_v4i16:93; SIMD128:         .functype zext_high_v4i16 (v128) -> (v128)94; SIMD128-NEXT:  # %bb.0:95; SIMD128-NEXT:    i32x4.extend_high_i16x8_u $push0=, $096; SIMD128-NEXT:    return $pop097 %shuffle = shufflevector <8 x i16> %in, <8 x i16> poison, <4 x i32> <i32 4, i32 5, i32 6, i32 7>98 %res = zext <4 x i16> %shuffle to <4 x i32>99 ret <4 x i32> %res100}101 102define <2 x i64> @sext_high_v2i32(<4 x i32> %in) {103; SIMD128-LABEL: sext_high_v2i32:104; SIMD128:         .functype sext_high_v2i32 (v128) -> (v128)105; SIMD128-NEXT:  # %bb.0:106; SIMD128-NEXT:    i64x2.extend_high_i32x4_s $push0=, $0107; SIMD128-NEXT:    return $pop0108 %shuffle = shufflevector <4 x i32> %in, <4 x i32> poison, <2 x i32> <i32 2, i32 3>109 %res = sext <2 x i32> %shuffle to <2 x i64>110 ret <2 x i64> %res111}112 113define <2 x i64> @zext_high_v2i32(<4 x i32> %in) {114; SIMD128-LABEL: zext_high_v2i32:115; SIMD128:         .functype zext_high_v2i32 (v128) -> (v128)116; SIMD128-NEXT:  # %bb.0:117; SIMD128-NEXT:    i64x2.extend_high_i32x4_u $push0=, $0118; SIMD128-NEXT:    return $pop0119 %shuffle = shufflevector <4 x i32> %in, <4 x i32> poison, <2 x i32> <i32 2, i32 3>120 %res = zext <2 x i32> %shuffle to <2 x i64>121 ret <2 x i64> %res122}123 124define <4 x i32> @sext_low_v4i8(<8 x i8> %in) {125; SIMD128-LABEL: sext_low_v4i8:126; SIMD128:         .functype sext_low_v4i8 (v128) -> (v128)127; SIMD128-NEXT:  # %bb.0:128; SIMD128-NEXT:    i16x8.extend_low_i8x16_s $push0=, $0129; SIMD128-NEXT:    i32x4.extend_low_i16x8_s $push1=, $pop0130; SIMD128-NEXT:    return $pop1131 %shuffle = shufflevector <8 x i8> %in, <8 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>132 %res = sext <4 x i8> %shuffle to <4 x i32>133 ret <4 x i32> %res134}135 136define <4 x i32> @zext_low_v4i8(<8 x i8> %in) {137; SIMD128-LABEL: zext_low_v4i8:138; SIMD128:         .functype zext_low_v4i8 (v128) -> (v128)139; SIMD128-NEXT:  # %bb.0:140; SIMD128-NEXT:    i16x8.extend_low_i8x16_u $push0=, $0141; SIMD128-NEXT:    i32x4.extend_low_i16x8_u $push1=, $pop0142; SIMD128-NEXT:    return $pop1143 %shuffle = shufflevector <8 x i8> %in, <8 x i8> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>144 %res = zext <4 x i8> %shuffle to <4 x i32>145 ret <4 x i32> %res146}147 148define <8 x i16> @sext_low_v8i8(<16 x i8> %in) {149; SIMD128-LABEL: sext_low_v8i8:150; SIMD128:         .functype sext_low_v8i8 (v128) -> (v128)151; SIMD128-NEXT:  # %bb.0:152; SIMD128-NEXT:    i16x8.extend_low_i8x16_s $push0=, $0153; SIMD128-NEXT:    return $pop0154 %shuffle = shufflevector <16 x i8> %in, <16 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>155 %res = sext <8 x i8> %shuffle to <8 x i16>156 ret <8 x i16> %res157}158 159define <8 x i16> @zext_low_v8i8(<16 x i8> %in) {160; SIMD128-LABEL: zext_low_v8i8:161; SIMD128:         .functype zext_low_v8i8 (v128) -> (v128)162; SIMD128-NEXT:  # %bb.0:163; SIMD128-NEXT:    i16x8.extend_low_i8x16_u $push0=, $0164; SIMD128-NEXT:    return $pop0165 %shuffle = shufflevector <16 x i8> %in, <16 x i8> poison, <8 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>166 %res = zext <8 x i8> %shuffle to <8 x i16>167 ret <8 x i16> %res168}169 170define <4 x i32> @sext_low_v4i16(<8 x i16> %in) {171; SIMD128-LABEL: sext_low_v4i16:172; SIMD128:         .functype sext_low_v4i16 (v128) -> (v128)173; SIMD128-NEXT:  # %bb.0:174; SIMD128-NEXT:    i32x4.extend_low_i16x8_s $push0=, $0175; SIMD128-NEXT:    return $pop0176 %shuffle = shufflevector <8 x i16> %in, <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>177 %res = sext <4 x i16> %shuffle to <4 x i32>178 ret <4 x i32> %res179}180 181define <4 x i32> @zext_low_v4i16(<8 x i16> %in) {182; SIMD128-LABEL: zext_low_v4i16:183; SIMD128:         .functype zext_low_v4i16 (v128) -> (v128)184; SIMD128-NEXT:  # %bb.0:185; SIMD128-NEXT:    i32x4.extend_low_i16x8_u $push0=, $0186; SIMD128-NEXT:    return $pop0187 %shuffle = shufflevector <8 x i16> %in, <8 x i16> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 3>188 %res = zext <4 x i16> %shuffle to <4 x i32>189 ret <4 x i32> %res190}191 192define <2 x i64> @sext_low_v2i32(<4 x i32> %in) {193; SIMD128-LABEL: sext_low_v2i32:194; SIMD128:         .functype sext_low_v2i32 (v128) -> (v128)195; SIMD128-NEXT:  # %bb.0:196; SIMD128-NEXT:    i64x2.extend_low_i32x4_s $push0=, $0197; SIMD128-NEXT:    return $pop0198 %shuffle = shufflevector <4 x i32> %in, <4 x i32> poison, <2 x i32> <i32 0, i32 1>199 %res = sext <2 x i32> %shuffle to <2 x i64>200 ret <2 x i64> %res201}202 203define <2 x i64> @zext_low_v2i32(<4 x i32> %in) {204; SIMD128-LABEL: zext_low_v2i32:205; SIMD128:         .functype zext_low_v2i32 (v128) -> (v128)206; SIMD128-NEXT:  # %bb.0:207; SIMD128-NEXT:    i64x2.extend_low_i32x4_u $push0=, $0208; SIMD128-NEXT:    return $pop0209 %shuffle = shufflevector <4 x i32> %in, <4 x i32> poison, <2 x i32> <i32 0, i32 1>210 %res = zext <2 x i32> %shuffle to <2 x i64>211 ret <2 x i64> %res212}213 214define <2 x i64> @multi_use_ext_v2i32(<4 x i32> %in) {215; SIMD128-LABEL: multi_use_ext_v2i32:216; SIMD128:         .functype multi_use_ext_v2i32 (v128) -> (v128)217; SIMD128-NEXT:  # %bb.0:218; SIMD128-NEXT:    i64x2.extend_high_i32x4_u $push1=, $0219; SIMD128-NEXT:    i64x2.extend_high_i32x4_s $push0=, $0220; SIMD128-NEXT:    i64x2.add $push2=, $pop1, $pop0221; SIMD128-NEXT:    return $pop2222 %shuffle = shufflevector <4 x i32> %in, <4 x i32> poison, <2 x i32> <i32 2, i32 3>223 %zext = zext <2 x i32> %shuffle to <2 x i64>224 %sext = sext <2 x i32> %shuffle to <2 x i64>225 %res = add <2 x i64> %zext, %sext226 ret <2 x i64> %res227}228