170 lines · plain
1; Test vector replicates, v2i64 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 <2 x i64> @f1() {7; CHECK-LABEL: f1:8; CHECK: vrepib %v24, 19; CHECK: br %r1410 ret <2 x i64> <i64 72340172838076673, i64 72340172838076673>11}12 13; Test a byte-granularity replicate with an arbitrary value.14define <2 x i64> @f2() {15; CHECK-LABEL: f2:16; CHECK: vrepib %v24, -5517; CHECK: br %r1418 ret <2 x i64> <i64 -3906369333256140343, i64 -3906369333256140343>19}20 21; Test a byte-granularity replicate with the highest useful value.22define <2 x i64> @f3() {23; CHECK-LABEL: f3:24; CHECK: vrepib %v24, -225; CHECK: br %r1426 ret <2 x i64> <i64 -72340172838076674, i64 -72340172838076674>27}28 29; Test a halfword-granularity replicate with the lowest useful value.30define <2 x i64> @f4() {31; CHECK-LABEL: f4:32; CHECK: vrepih %v24, 133; CHECK: br %r1434 ret <2 x i64> <i64 281479271743489, i64 281479271743489>35}36 37; Test a halfword-granularity replicate with an arbitrary value.38define <2 x i64> @f5() {39; CHECK-LABEL: f5:40; CHECK: vrepih %v24, 2565041; CHECK: br %r1442 ret <2 x i64> <i64 7219943320220492850, i64 7219943320220492850>43}44 45; Test a halfword-granularity replicate with the highest useful value.46define <2 x i64> @f6() {47; CHECK-LABEL: f6:48; CHECK: vrepih %v24, -249; CHECK: br %r1450 ret <2 x i64> <i64 -281479271743490, i64 -281479271743490>51}52 53; Test a word-granularity replicate with the lowest useful positive value.54define <2 x i64> @f7() {55; CHECK-LABEL: f7:56; CHECK: vrepif %v24, 157; CHECK: br %r1458 ret <2 x i64> <i64 4294967297, i64 4294967297>59}60 61; Test a word-granularity replicate with the highest in-range value.62define <2 x i64> @f8() {63; CHECK-LABEL: f8:64; CHECK: vrepif %v24, 3276765; CHECK: br %r1466 ret <2 x i64> <i64 140733193420799, i64 140733193420799>67}68 69; Test a word-granularity replicate with the next highest value.70; This cannot use VREPIF.71define <2 x i64> @f9() {72; CHECK-LABEL: f9:73; CHECK-NOT: vrepif74; CHECK: br %r1475 ret <2 x i64> <i64 140737488388096, i64 140737488388096>76}77 78; Test a word-granularity replicate with the lowest in-range value.79define <2 x i64> @f10() {80; CHECK-LABEL: f10:81; CHECK: vrepif %v24, -3276882; CHECK: br %r1483 ret <2 x i64> <i64 -140733193420800, i64 -140733193420800>84}85 86; Test a word-granularity replicate with the next lowest value.87; This cannot use VREPIF.88define <2 x i64> @f11() {89; CHECK-LABEL: f11:90; CHECK-NOT: vrepif91; CHECK: br %r1492 ret <2 x i64> <i64 -140737488388097, i64 -140737488388097>93}94 95; Test a word-granularity replicate with the highest useful negative value.96define <2 x i64> @f12() {97; CHECK-LABEL: f12:98; CHECK: vrepif %v24, -299; CHECK: br %r14100 ret <2 x i64> <i64 -4294967298, i64 -4294967298>101}102 103; Test a doubleword-granularity replicate with the lowest useful positive104; value.105define <2 x i64> @f13() {106; CHECK-LABEL: f13:107; CHECK: vrepig %v24, 1108; CHECK: br %r14109 ret <2 x i64> <i64 1, i64 1>110}111 112; Test a doubleword-granularity replicate with the highest in-range value.113define <2 x i64> @f14() {114; CHECK-LABEL: f14:115; CHECK: vrepig %v24, 32767116; CHECK: br %r14117 ret <2 x i64> <i64 32767, i64 32767>118}119 120; Test a doubleword-granularity replicate with the next highest value.121; This cannot use VREPIG.122define <2 x i64> @f15() {123; CHECK-LABEL: f15:124; CHECK-NOT: vrepig125; CHECK: br %r14126 ret <2 x i64> <i64 32768, i64 32768>127}128 129; Test a doubleword-granularity replicate with the lowest in-range value.130define <2 x i64> @f16() {131; CHECK-LABEL: f16:132; CHECK: vrepig %v24, -32768133; CHECK: br %r14134 ret <2 x i64> <i64 -32768, i64 -32768>135}136 137; Test a doubleword-granularity replicate with the next lowest value.138; This cannot use VREPIG.139define <2 x i64> @f17() {140; CHECK-LABEL: f17:141; CHECK-NOT: vrepig142; CHECK: br %r14143 ret <2 x i64> <i64 -32769, i64 -32769>144}145 146; Test a doubleword-granularity replicate with the highest useful negative147; value.148define <2 x i64> @f18() {149; CHECK-LABEL: f18:150; CHECK: vrepig %v24, -2151; CHECK: br %r14152 ret <2 x i64> <i64 -2, i64 -2>153}154 155; Repeat f14 with undefs optimistically treated as 32767.156define <2 x i64> @f19() {157; CHECK-LABEL: f19:158; CHECK: vrepig %v24, 32767159; CHECK: br %r14160 ret <2 x i64> <i64 undef, i64 32767>161}162 163; Repeat f18 with undefs optimistically treated as -2.164define <2 x i64> @f20() {165; CHECK-LABEL: f20:166; CHECK: vrepig %v24, -2167; CHECK: br %r14168 ret <2 x i64> <i64 undef, i64 -2>169}170