mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-21 03:29:40 +00:00
This update was done with the following bash script: find test/CodeGen -name "*.ll" | \ while read NAME; do echo "$NAME" if ! grep -q "^; *RUN: *llc.*debug" $NAME; then TEMP=`mktemp -t temp` cp $NAME $TEMP sed -n "s/^define [^@]*@\([A-Za-z0-9_]*\)(.*$/\1/p" < $NAME | \ while read FUNC; do sed -i '' "s/;\(.*\)\([A-Za-z0-9_-]*\):\( *\)$FUNC: *\$/;\1\2-LABEL:\3$FUNC:/g" $TEMP done sed -i '' "s/;\(.*\)-LABEL-LABEL:/;\1-LABEL:/" $TEMP sed -i '' "s/;\(.*\)-NEXT-LABEL:/;\1-NEXT:/" $TEMP sed -i '' "s/;\(.*\)-NOT-LABEL:/;\1-NOT:/" $TEMP sed -i '' "s/;\(.*\)-DAG-LABEL:/;\1-DAG:/" $TEMP mv $TEMP $NAME fi done git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186280 91177308-0d34-0410-b5e6-96231b3b80d8
86 lines
2.2 KiB
LLVM
86 lines
2.2 KiB
LLVM
; RUN: llc < %s -march=x86 -mcpu=corei7-avx | FileCheck %s
|
|
; RUN: opt -instsimplify -disable-output < %s
|
|
|
|
;CHECK-LABEL: AGEP0:
|
|
define <4 x i32*> @AGEP0(i32* %ptr) nounwind {
|
|
entry:
|
|
%vecinit.i = insertelement <4 x i32*> undef, i32* %ptr, i32 0
|
|
%vecinit2.i = insertelement <4 x i32*> %vecinit.i, i32* %ptr, i32 1
|
|
%vecinit4.i = insertelement <4 x i32*> %vecinit2.i, i32* %ptr, i32 2
|
|
%vecinit6.i = insertelement <4 x i32*> %vecinit4.i, i32* %ptr, i32 3
|
|
;CHECK: padd
|
|
%A2 = getelementptr <4 x i32*> %vecinit6.i, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
|
|
;CHECK: padd
|
|
%A3 = getelementptr <4 x i32*> %A2, <4 x i32> <i32 10, i32 14, i32 19, i32 233>
|
|
ret <4 x i32*> %A3
|
|
;CHECK: ret
|
|
}
|
|
|
|
;CHECK-LABEL: AGEP1:
|
|
define i32 @AGEP1(<4 x i32*> %param) nounwind {
|
|
entry:
|
|
;CHECK: padd
|
|
%A2 = getelementptr <4 x i32*> %param, <4 x i32> <i32 1, i32 2, i32 3, i32 4>
|
|
%k = extractelement <4 x i32*> %A2, i32 3
|
|
%v = load i32* %k
|
|
ret i32 %v
|
|
;CHECK: ret
|
|
}
|
|
|
|
;CHECK-LABEL: AGEP2:
|
|
define i32 @AGEP2(<4 x i32*> %param, <4 x i32> %off) nounwind {
|
|
entry:
|
|
;CHECK: pslld $2
|
|
;CHECK: padd
|
|
%A2 = getelementptr <4 x i32*> %param, <4 x i32> %off
|
|
%k = extractelement <4 x i32*> %A2, i32 3
|
|
%v = load i32* %k
|
|
ret i32 %v
|
|
;CHECK: ret
|
|
}
|
|
|
|
;CHECK-LABEL: AGEP3:
|
|
define <4 x i32*> @AGEP3(<4 x i32*> %param, <4 x i32> %off) nounwind {
|
|
entry:
|
|
;CHECK: pslld $2
|
|
;CHECK: padd
|
|
%A2 = getelementptr <4 x i32*> %param, <4 x i32> %off
|
|
%v = alloca i32
|
|
%k = insertelement <4 x i32*> %A2, i32* %v, i32 3
|
|
ret <4 x i32*> %k
|
|
;CHECK: ret
|
|
}
|
|
|
|
;CHECK-LABEL: AGEP4:
|
|
define <4 x i16*> @AGEP4(<4 x i16*> %param, <4 x i32> %off) nounwind {
|
|
entry:
|
|
; Multiply offset by two (add it to itself).
|
|
;CHECK: padd
|
|
; add the base to the offset
|
|
;CHECK: padd
|
|
%A = getelementptr <4 x i16*> %param, <4 x i32> %off
|
|
ret <4 x i16*> %A
|
|
;CHECK: ret
|
|
}
|
|
|
|
;CHECK-LABEL: AGEP5:
|
|
define <4 x i8*> @AGEP5(<4 x i8*> %param, <4 x i8> %off) nounwind {
|
|
entry:
|
|
;CHECK: paddd
|
|
%A = getelementptr <4 x i8*> %param, <4 x i8> %off
|
|
ret <4 x i8*> %A
|
|
;CHECK: ret
|
|
}
|
|
|
|
|
|
; The size of each element is 1 byte. No need to multiply by element size.
|
|
;CHECK-LABEL: AGEP6:
|
|
define <4 x i8*> @AGEP6(<4 x i8*> %param, <4 x i32> %off) nounwind {
|
|
entry:
|
|
;CHECK-NOT: pslld
|
|
%A = getelementptr <4 x i8*> %param, <4 x i32> %off
|
|
ret <4 x i8*> %A
|
|
;CHECK: ret
|
|
}
|
|
|