llvm-6502/test/CodeGen/X86/add_shl_constant.ll
Matt Arsenault e7d5fc9e53 Add triple to test to fix bots
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217612 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-11 17:50:20 +00:00

50 lines
1.5 KiB
LLVM

; RUN: llc -march=x86-64 -mtriple=x86_64-apple-darwin < %s | FileCheck %s
; CHECK-LABEL: add_shl_add_constant_1_i32
; CHECK: leal 984(%rsi,%rdi,8), %eax
; CHECK-NEXT: retq
define i32 @add_shl_add_constant_1_i32(i32 %x, i32 %y) nounwind {
%add.0 = add i32 %x, 123
%shl = shl i32 %add.0, 3
%add.1 = add i32 %shl, %y
ret i32 %add.1
}
; CHECK-LABEL: add_shl_add_constant_2_i32
; CHECK: leal 984(%rsi,%rdi,8), %eax
; CHECK-NEXT: retq
define i32 @add_shl_add_constant_2_i32(i32 %x, i32 %y) nounwind {
%add.0 = add i32 %x, 123
%shl = shl i32 %add.0, 3
%add.1 = add i32 %y, %shl
ret i32 %add.1
}
; CHECK: LCPI2_0:
; CHECK: .long 984
; CHECK: _add_shl_add_constant_1_v4i32
; CHECK: pslld $3, %[[REG:xmm[0-9]+]]
; CHECK: paddd %xmm1, %[[REG]]
; CHECK: paddd LCPI2_0(%rip), %[[REG:xmm[0-9]+]]
; CHECK: retq
define <4 x i32> @add_shl_add_constant_1_v4i32(<4 x i32> %x, <4 x i32> %y) nounwind {
%add.0 = add <4 x i32> %x, <i32 123, i32 123, i32 123, i32 123>
%shl = shl <4 x i32> %add.0, <i32 3, i32 3, i32 3, i32 3>
%add.1 = add <4 x i32> %shl, %y
ret <4 x i32> %add.1
}
; CHECK: LCPI3_0:
; CHECK: .long 984
; CHECK: _add_shl_add_constant_2_v4i32
; CHECK: pslld $3, %[[REG:xmm[0-9]+]]
; CHECK: paddd %xmm1, %[[REG]]
; CHECK: paddd LCPI3_0(%rip), %[[REG:xmm[0-9]+]]
; CHECK: retq
define <4 x i32> @add_shl_add_constant_2_v4i32(<4 x i32> %x, <4 x i32> %y) nounwind {
%add.0 = add <4 x i32> %x, <i32 123, i32 123, i32 123, i32 123>
%shl = shl <4 x i32> %add.0, <i32 3, i32 3, i32 3, i32 3>
%add.1 = add <4 x i32> %y, %shl
ret <4 x i32> %add.1
}