1 ; Test vector division. There is no native integer support for this,
2 ; so the integer cases are really a test of the operation legalization code.
4 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
6 ; Test a v16i8 division.
7 define <16 x i8> @f1(<16 x i8> %dummy, <16 x i8> %val1, <16 x i8> %val2) {
9 ; CHECK: vlvgp [[REG:%v[0-9]+]],
10 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 0
11 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 1
12 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 2
13 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 3
14 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 4
15 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 5
16 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 6
17 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 8
18 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 9
19 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 10
20 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 11
21 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 12
22 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 13
23 ; CHECK-DAG: vlvgb [[REG]], {{%r[0-9]+}}, 14
25 %ret = sdiv <16 x i8> %val1, %val2
29 ; Test a v8i16 division.
30 define <8 x i16> @f2(<8 x i16> %dummy, <8 x i16> %val1, <8 x i16> %val2) {
32 ; CHECK: vlvgp [[REG:%v[0-9]+]],
33 ; CHECK-DAG: vlvgh [[REG]], {{%r[0-9]+}}, 0
34 ; CHECK-DAG: vlvgh [[REG]], {{%r[0-9]+}}, 1
35 ; CHECK-DAG: vlvgh [[REG]], {{%r[0-9]+}}, 2
36 ; CHECK-DAG: vlvgh [[REG]], {{%r[0-9]+}}, 4
37 ; CHECK-DAG: vlvgh [[REG]], {{%r[0-9]+}}, 5
38 ; CHECK-DAG: vlvgh [[REG]], {{%r[0-9]+}}, 6
40 %ret = sdiv <8 x i16> %val1, %val2
44 ; Test a v4i32 division.
45 define <4 x i32> @f3(<4 x i32> %dummy, <4 x i32> %val1, <4 x i32> %val2) {
47 ; CHECK: vlvgp [[REG:%v[0-9]+]],
48 ; CHECK-DAG: vlvgf [[REG]], {{%r[0-9]+}}, 0
49 ; CHECK-DAG: vlvgf [[REG]], {{%r[0-9]+}}, 2
51 %ret = sdiv <4 x i32> %val1, %val2
55 ; Test a v2i64 division.
56 define <2 x i64> @f4(<2 x i64> %dummy, <2 x i64> %val1, <2 x i64> %val2) {
60 %ret = sdiv <2 x i64> %val1, %val2
64 ; Test a v2f64 division.
65 define <2 x double> @f5(<2 x double> %dummy, <2 x double> %val1,
68 ; CHECK: vfddb %v24, %v26, %v28
70 %ret = fdiv <2 x double> %val1, %val2
74 ; Test an f64 division that uses vector registers.
75 define double @f6(<2 x double> %val1, <2 x double> %val2) {
77 ; CHECK: wfddb %f0, %v24, %v26
79 %scalar1 = extractelement <2 x double> %val1, i32 0
80 %scalar2 = extractelement <2 x double> %val2, i32 0
81 %ret = fdiv double %scalar1, %scalar2