mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-22 07:32:48 +00:00
8b2b8a1835
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
115 lines
5.3 KiB
LLVM
115 lines
5.3 KiB
LLVM
; RUN: llc < %s | FileCheck %s
|
|
target datalayout = "e-p:16:8:8-i8:8:8-i16:8:8-i32:8:8"
|
|
target triple = "msp430"
|
|
|
|
define zeroext i16 @add(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
|
|
entry:
|
|
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
|
|
br i1 %cmp8, label %for.end, label %for.body
|
|
|
|
for.body: ; preds = %for.body, %entry
|
|
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
|
|
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
%arrayidx = getelementptr i16* %a, i16 %i.010 ; <i16*> [#uses=1]
|
|
; CHECK-LABEL: add:
|
|
; CHECK: add.w @r{{[0-9]+}}+, r{{[0-9]+}}
|
|
%tmp4 = load i16* %arrayidx ; <i16> [#uses=1]
|
|
%add = add i16 %tmp4, %sum.09 ; <i16> [#uses=2]
|
|
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
|
|
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
|
|
br i1 %exitcond, label %for.end, label %for.body
|
|
|
|
for.end: ; preds = %for.body, %entry
|
|
%sum.0.lcssa = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
ret i16 %sum.0.lcssa
|
|
}
|
|
|
|
define zeroext i16 @sub(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
|
|
entry:
|
|
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
|
|
br i1 %cmp8, label %for.end, label %for.body
|
|
|
|
for.body: ; preds = %for.body, %entry
|
|
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
|
|
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
%arrayidx = getelementptr i16* %a, i16 %i.010 ; <i16*> [#uses=1]
|
|
; CHECK-LABEL: sub:
|
|
; CHECK: sub.w @r{{[0-9]+}}+, r{{[0-9]+}}
|
|
%tmp4 = load i16* %arrayidx ; <i16> [#uses=1]
|
|
%add = sub i16 %tmp4, %sum.09 ; <i16> [#uses=2]
|
|
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
|
|
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
|
|
br i1 %exitcond, label %for.end, label %for.body
|
|
|
|
for.end: ; preds = %for.body, %entry
|
|
%sum.0.lcssa = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
ret i16 %sum.0.lcssa
|
|
}
|
|
|
|
define zeroext i16 @or(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
|
|
entry:
|
|
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
|
|
br i1 %cmp8, label %for.end, label %for.body
|
|
|
|
for.body: ; preds = %for.body, %entry
|
|
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
|
|
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
%arrayidx = getelementptr i16* %a, i16 %i.010 ; <i16*> [#uses=1]
|
|
; CHECK-LABEL: or:
|
|
; CHECK: bis.w @r{{[0-9]+}}+, r{{[0-9]+}}
|
|
%tmp4 = load i16* %arrayidx ; <i16> [#uses=1]
|
|
%add = or i16 %tmp4, %sum.09 ; <i16> [#uses=2]
|
|
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
|
|
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
|
|
br i1 %exitcond, label %for.end, label %for.body
|
|
|
|
for.end: ; preds = %for.body, %entry
|
|
%sum.0.lcssa = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
ret i16 %sum.0.lcssa
|
|
}
|
|
|
|
define zeroext i16 @xor(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
|
|
entry:
|
|
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
|
|
br i1 %cmp8, label %for.end, label %for.body
|
|
|
|
for.body: ; preds = %for.body, %entry
|
|
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
|
|
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
%arrayidx = getelementptr i16* %a, i16 %i.010 ; <i16*> [#uses=1]
|
|
; CHECK-LABEL: xor:
|
|
; CHECK: xor.w @r{{[0-9]+}}+, r{{[0-9]+}}
|
|
%tmp4 = load i16* %arrayidx ; <i16> [#uses=1]
|
|
%add = xor i16 %tmp4, %sum.09 ; <i16> [#uses=2]
|
|
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
|
|
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
|
|
br i1 %exitcond, label %for.end, label %for.body
|
|
|
|
for.end: ; preds = %for.body, %entry
|
|
%sum.0.lcssa = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
ret i16 %sum.0.lcssa
|
|
}
|
|
|
|
define zeroext i16 @and(i16* nocapture %a, i16 zeroext %n) nounwind readonly {
|
|
entry:
|
|
%cmp8 = icmp eq i16 %n, 0 ; <i1> [#uses=1]
|
|
br i1 %cmp8, label %for.end, label %for.body
|
|
|
|
for.body: ; preds = %for.body, %entry
|
|
%i.010 = phi i16 [ 0, %entry ], [ %inc, %for.body ] ; <i16> [#uses=2]
|
|
%sum.09 = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
%arrayidx = getelementptr i16* %a, i16 %i.010 ; <i16*> [#uses=1]
|
|
; CHECK-LABEL: and:
|
|
; CHECK: and.w @r{{[0-9]+}}+, r{{[0-9]+}}
|
|
%tmp4 = load i16* %arrayidx ; <i16> [#uses=1]
|
|
%add = and i16 %tmp4, %sum.09 ; <i16> [#uses=2]
|
|
%inc = add i16 %i.010, 1 ; <i16> [#uses=2]
|
|
%exitcond = icmp eq i16 %inc, %n ; <i1> [#uses=1]
|
|
br i1 %exitcond, label %for.end, label %for.body
|
|
|
|
for.end: ; preds = %for.body, %entry
|
|
%sum.0.lcssa = phi i16 [ 0, %entry ], [ %add, %for.body ] ; <i16> [#uses=1]
|
|
ret i16 %sum.0.lcssa
|
|
}
|
|
|