xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/vec_minmax.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; Test the vector min/max doubleword instructions added for P8
2*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker; RUN: llc -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdeclare <2 x i64> @llvm.ppc.altivec.vmaxsd(<2 x i64>, <2 x i64>) nounwind readnone
6*9880d681SAndroid Build Coastguard Workerdeclare <2 x i64> @llvm.ppc.altivec.vmaxud(<2 x i64>, <2 x i64>) nounwind readnone
7*9880d681SAndroid Build Coastguard Workerdeclare <2 x i64> @llvm.ppc.altivec.vminsd(<2 x i64>, <2 x i64>) nounwind readnone
8*9880d681SAndroid Build Coastguard Workerdeclare <2 x i64> @llvm.ppc.altivec.vminud(<2 x i64>, <2 x i64>) nounwind readnone
9*9880d681SAndroid Build Coastguard Worker
10*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @test_vmaxsd(<2 x i64> %x, <2 x i64> %y) {
11*9880d681SAndroid Build Coastguard Worker       %tmp = tail call <2 x i64> @llvm.ppc.altivec.vmaxsd(<2 x i64> %x, <2 x i64> %y)
12*9880d681SAndroid Build Coastguard Worker       ret <2 x i64> %tmp
13*9880d681SAndroid Build Coastguard Worker; CHECK: vmaxsd 2, 2, 3
14*9880d681SAndroid Build Coastguard Worker}
15*9880d681SAndroid Build Coastguard Worker
16*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @test_vmaxud(<2 x i64> %x, <2 x i64> %y) {
17*9880d681SAndroid Build Coastguard Worker       %tmp = tail call <2 x i64> @llvm.ppc.altivec.vmaxud(<2 x i64> %x, <2 x i64> %y)
18*9880d681SAndroid Build Coastguard Worker       ret <2 x i64> %tmp
19*9880d681SAndroid Build Coastguard Worker; CHECK: vmaxud 2, 2, 3
20*9880d681SAndroid Build Coastguard Worker}
21*9880d681SAndroid Build Coastguard Worker
22*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @test_vminsd(<2 x i64> %x, <2 x i64> %y) {
23*9880d681SAndroid Build Coastguard Worker       %tmp = tail call <2 x i64> @llvm.ppc.altivec.vminsd(<2 x i64> %x, <2 x i64> %y)
24*9880d681SAndroid Build Coastguard Worker       ret <2 x i64> %tmp
25*9880d681SAndroid Build Coastguard Worker; CHECK: vminsd 2, 2, 3
26*9880d681SAndroid Build Coastguard Worker}
27*9880d681SAndroid Build Coastguard Worker
28*9880d681SAndroid Build Coastguard Workerdefine <2 x i64> @test_vminud(<2 x i64> %x, <2 x i64> %y) {
29*9880d681SAndroid Build Coastguard Worker       %tmp = tail call <2 x i64> @llvm.ppc.altivec.vminud(<2 x i64> %x, <2 x i64> %y)
30*9880d681SAndroid Build Coastguard Worker       ret <2 x i64> %tmp
31*9880d681SAndroid Build Coastguard Worker; CHECK: vminud 2, 2, 3
32*9880d681SAndroid Build Coastguard Worker}
33*9880d681SAndroid Build Coastguard Worker
34*9880d681SAndroid Build Coastguard Worker
35