1 ; Check VMX 64-bit integer operations
3 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 < %s | FileCheck %s
4 ; RUN: llc -verify-machineinstrs -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr8 -mattr=-vsx < %s | FileCheck %s
6 define <2 x i64> @test_add(<2 x i64> %x, <2 x i64> %y) nounwind {
7 %result = add <2 x i64> %x, %y
9 ; CHECK: vaddudm 2, 2, 3
12 define <2 x i64> @increment_by_one(<2 x i64> %x) nounwind {
13 %result = add <2 x i64> %x, <i64 1, i64 1>
15 ; CHECK: vaddudm 2, 2, 3
18 define <2 x i64> @increment_by_val(<2 x i64> %x, i64 %val) nounwind {
19 %tmpvec = insertelement <2 x i64> <i64 0, i64 0>, i64 %val, i32 0
20 %tmpvec2 = insertelement <2 x i64> %tmpvec, i64 %val, i32 1
21 %result = add <2 x i64> %x, %tmpvec2
23 ; CHECK: vaddudm 2, 2, 3
24 ; FIXME: This is currently generating the following instruction sequence
34 ; This will almost certainly cause a load-hit-store hazard.
35 ; Since val is a value parameter, it should not need to be
36 ; saved onto the stack at all (unless we're using this to set
37 ; up the vector register). Instead, it would be better to splat
38 ; the value into a vector register.
41 define <2 x i64> @test_sub(<2 x i64> %x, <2 x i64> %y) nounwind {
42 %result = sub <2 x i64> %x, %y
44 ; CHECK: vsubudm 2, 2, 3
47 define <2 x i64> @decrement_by_one(<2 x i64> %x) nounwind {
48 %result = sub <2 x i64> %x, <i64 -1, i64 -1>
50 ; CHECK: vsubudm 2, 2, 3
53 define <2 x i64> @decrement_by_val(<2 x i64> %x, i64 %val) nounwind {
54 %tmpvec = insertelement <2 x i64> <i64 0, i64 0>, i64 %val, i32 0
55 %tmpvec2 = insertelement <2 x i64> %tmpvec, i64 %val, i32 1
56 %result = sub <2 x i64> %x, %tmpvec2
58 ; CHECK: vsubudm 2, 2, 3