brintos

brintos / llvm-project-archived public Read only

0
0
Text · 5.4 KiB · 5ab6947 Raw
190 lines · plain
1; Test vector replicates, v8i16 version.2;3; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s4 5; Test a byte-granularity replicate with the lowest useful value.6define <8 x i16> @f1() {7; CHECK-LABEL: f1:8; CHECK: vrepib %v24, 19; CHECK: br %r1410  ret <8 x i16> <i16 257, i16 257, i16 257, i16 257,11                 i16 257, i16 257, i16 257, i16 257>12}13 14; Test a byte-granularity replicate with an arbitrary value.15define <8 x i16> @f2() {16; CHECK-LABEL: f2:17; CHECK: vrepib %v24, -5518; CHECK: br %r1419  ret <8 x i16> <i16 51657, i16 51657, i16 51657, i16 51657,20                 i16 51657, i16 51657, i16 51657, i16 51657>21}22 23; Test a byte-granularity replicate with the highest useful value.24define <8 x i16> @f3() {25; CHECK-LABEL: f3:26; CHECK: vrepib %v24, -227; CHECK: br %r1428  ret <8 x i16> <i16 -258, i16 -258, i16 -258, i16 -258,29                 i16 -258, i16 -258, i16 -258, i16 -258>30}31 32; Test a halfword-granularity replicate with the lowest useful value.33define <8 x i16> @f4() {34; CHECK-LABEL: f4:35; CHECK: vrepih %v24, 136; CHECK: br %r1437  ret <8 x i16> <i16 1, i16 1, i16 1, i16 1,38                 i16 1, i16 1, i16 1, i16 1>39}40 41; Test a halfword-granularity replicate with an arbitrary value.42define <8 x i16> @f5() {43; CHECK-LABEL: f5:44; CHECK: vrepih %v24, 2565045; CHECK: br %r1446  ret <8 x i16> <i16 25650, i16 25650, i16 25650, i16 25650,47                 i16 25650, i16 25650, i16 25650, i16 25650>48}49 50; Test a halfword-granularity replicate with the highest useful value.51define <8 x i16> @f6() {52; CHECK-LABEL: f6:53; CHECK: vrepih %v24, -254; CHECK: br %r1455  ret <8 x i16> <i16 65534, i16 65534, i16 65534, i16 65534,56                 i16 65534, i16 65534, i16 65534, i16 65534>57}58 59; Test a word-granularity replicate with the lowest useful positive value.60define <8 x i16> @f7() {61; CHECK-LABEL: f7:62; CHECK: vrepif %v24, 163; CHECK: br %r1464  ret <8 x i16> <i16 0, i16 1, i16 0, i16 1,65                 i16 0, i16 1, i16 0, i16 1>66}67 68; Test a word-granularity replicate with the highest in-range value.69define <8 x i16> @f8() {70; CHECK-LABEL: f8:71; CHECK: vrepif %v24, 3276772; CHECK: br %r1473  ret <8 x i16> <i16 0, i16 32767, i16 0, i16 32767,74                 i16 0, i16 32767, i16 0, i16 32767>75}76 77; Test a word-granularity replicate with the next highest value.78; This cannot use VREPIF.79define <8 x i16> @f9() {80; CHECK-LABEL: f9:81; CHECK-NOT: vrepif82; CHECK: br %r1483  ret <8 x i16> <i16 0, i16 32768, i16 0, i16 32768,84                 i16 0, i16 32768, i16 0, i16 32768>85}86 87; Test a word-granularity replicate with the lowest in-range value.88define <8 x i16> @f10() {89; CHECK-LABEL: f10:90; CHECK: vrepif %v24, -3276891; CHECK: br %r1492  ret <8 x i16> <i16 -1, i16 -32768, i16 -1, i16 -32768,93                 i16 -1, i16 -32768, i16 -1, i16 -32768>94}95 96; Test a word-granularity replicate with the next lowest value.97; This cannot use VREPIF.98define <8 x i16> @f11() {99; CHECK-LABEL: f11:100; CHECK-NOT: vrepif101; CHECK: br %r14102  ret <8 x i16> <i16 -1, i16 -32769, i16 -1, i16 -32769,103                 i16 -1, i16 -32769, i16 -1, i16 -32769>104}105 106; Test a word-granularity replicate with the highest useful negative value.107define <8 x i16> @f12() {108; CHECK-LABEL: f12:109; CHECK: vrepif %v24, -2110; CHECK: br %r14111  ret <8 x i16> <i16 -1, i16 -2, i16 -1, i16 -2,112                 i16 -1, i16 -2, i16 -1, i16 -2>113}114 115; Test a doubleword-granularity replicate with the lowest useful positive116; value.117define <8 x i16> @f13() {118; CHECK-LABEL: f13:119; CHECK: vrepig %v24, 1120; CHECK: br %r14121  ret <8 x i16> <i16 0, i16 0, i16 0, i16 1,122                 i16 0, i16 0, i16 0, i16 1>123}124 125; Test a doubleword-granularity replicate with the highest in-range value.126define <8 x i16> @f14() {127; CHECK-LABEL: f14:128; CHECK: vrepig %v24, 32767129; CHECK: br %r14130  ret <8 x i16> <i16 0, i16 0, i16 0, i16 32767,131                 i16 0, i16 0, i16 0, i16 32767>132}133 134; Test a doubleword-granularity replicate with the next highest value.135; This cannot use VREPIG.136define <8 x i16> @f15() {137; CHECK-LABEL: f15:138; CHECK-NOT: vrepig139; CHECK: br %r14140  ret <8 x i16> <i16 0, i16 0, i16 0, i16 32768,141                 i16 0, i16 0, i16 0, i16 32768>142}143 144; Test a doubleword-granularity replicate with the lowest in-range value.145define <8 x i16> @f16() {146; CHECK-LABEL: f16:147; CHECK: vrepig %v24, -32768148; CHECK: br %r14149  ret <8 x i16> <i16 -1, i16 -1, i16 -1, i16 -32768,150                 i16 -1, i16 -1, i16 -1, i16 -32768>151}152 153; Test a doubleword-granularity replicate with the next lowest value.154; This cannot use VREPIG.155define <8 x i16> @f17() {156; CHECK-LABEL: f17:157; CHECK-NOT: vrepig158; CHECK: br %r14159  ret <8 x i16> <i16 -1, i16 -1, i16 -1, i16 -32769,160                 i16 -1, i16 -1, i16 -1, i16 -32769>161}162 163; Test a doubleword-granularity replicate with the highest useful negative164; value.165define <8 x i16> @f18() {166; CHECK-LABEL: f18:167; CHECK: vrepig %v24, -2168; CHECK: br %r14169  ret <8 x i16> <i16 -1, i16 -1, i16 -1, i16 -2,170                 i16 -1, i16 -1, i16 -1, i16 -2>171}172 173; Repeat f14 with undefs optimistically treated as 0.174define <8 x i16> @f19() {175; CHECK-LABEL: f19:176; CHECK: vrepig %v24, 32767177; CHECK: br %r14178  ret <8 x i16> <i16 0, i16 undef, i16 0, i16 32767,179                 i16 undef, i16 0, i16 undef, i16 32767>180}181 182; Repeat f18 with undefs optimistically treated as -1.183define <8 x i16> @f20() {184; CHECK-LABEL: f20:185; CHECK: vrepig %v24, -2186; CHECK: br %r14187  ret <8 x i16> <i16 -1, i16 -1, i16 undef, i16 -2,188                 i16 undef, i16 undef, i16 -1, i16 -2>189}190