mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +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
		
	
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
| ; RUN: llc < %s -march=arm -mattr=+v6 | FileCheck %s -check-prefix=V6
 | |
| ; RUN: llc < %s -march=arm | FileCheck %s -check-prefix=V4
 | |
| ; RUN: llc < %s -march=thumb -mcpu=cortex-m3 | FileCheck %s -check-prefix=M3
 | |
| 
 | |
| define i32 @smulhi(i32 %x, i32 %y) nounwind {
 | |
| ; V6-LABEL: smulhi:
 | |
| ; V6: smmul
 | |
| 
 | |
| ; V4-LABEL: smulhi:
 | |
| ; V4: smull
 | |
| 
 | |
| ; M3-LABEL: smulhi:
 | |
| ; M3: smull
 | |
|         %tmp = sext i32 %x to i64               ; <i64> [#uses=1]
 | |
|         %tmp1 = sext i32 %y to i64              ; <i64> [#uses=1]
 | |
|         %tmp2 = mul i64 %tmp1, %tmp             ; <i64> [#uses=1]
 | |
|         %tmp3 = lshr i64 %tmp2, 32              ; <i64> [#uses=1]
 | |
|         %tmp3.upgrd.1 = trunc i64 %tmp3 to i32          ; <i32> [#uses=1]
 | |
|         ret i32 %tmp3.upgrd.1
 | |
| }
 | |
| 
 | |
| define i32 @umulhi(i32 %x, i32 %y) nounwind {
 | |
| ; V6-LABEL: umulhi:
 | |
| ; V6: umull
 | |
| 
 | |
| ; V4-LABEL: umulhi:
 | |
| ; V4: umull
 | |
| 
 | |
| ; M3-LABEL: umulhi:
 | |
| ; M3: umull
 | |
|         %tmp = zext i32 %x to i64               ; <i64> [#uses=1]
 | |
|         %tmp1 = zext i32 %y to i64              ; <i64> [#uses=1]
 | |
|         %tmp2 = mul i64 %tmp1, %tmp             ; <i64> [#uses=1]
 | |
|         %tmp3 = lshr i64 %tmp2, 32              ; <i64> [#uses=1]
 | |
|         %tmp3.upgrd.2 = trunc i64 %tmp3 to i32          ; <i32> [#uses=1]
 | |
|         ret i32 %tmp3.upgrd.2
 | |
| }
 | |
| 
 | |
| ; rdar://r10152911
 | |
| define i32 @t3(i32 %a) nounwind {
 | |
| ; V6-LABEL: t3:
 | |
| ; V6: smmla
 | |
| 
 | |
| ; V4-LABEL: t3:
 | |
| ; V4: smull
 | |
| 
 | |
| ; M3-LABEL: t3:
 | |
| ; M3-NOT: smmla
 | |
| ; M3: smull
 | |
| entry:
 | |
|   %tmp1 = mul nsw i32 %a, 3
 | |
|   %tmp2 = sdiv i32 %tmp1, 23
 | |
|   ret i32 %tmp2
 | |
| }
 |