mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-05 13:09:10 +00:00
1ce9e00f8b
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49970 91177308-0d34-0410-b5e6-96231b3b80d8
26 lines
823 B
LLVM
26 lines
823 B
LLVM
; RUN: llvm-as < %s | llc -march=x86 -mtriple=i686-pc-linux-gnu | grep movs | count 3
|
|
|
|
@A = global [32 x i32] zeroinitializer
|
|
@B = global [32 x i32] zeroinitializer
|
|
|
|
declare void @llvm.memcpy.i32(i8*, i8*, i32, i32)
|
|
|
|
define void @main() {
|
|
; dword copy
|
|
call void @llvm.memcpy.i32(i8* bitcast ([32 x i32]* @A to i8*),
|
|
i8* bitcast ([32 x i32]* @B to i8*),
|
|
i32 128, i32 4 )
|
|
|
|
; word copy
|
|
call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*),
|
|
i8* bitcast ([32 x i32]* @B to i8*),
|
|
i32 128, i32 2 )
|
|
|
|
; byte copy
|
|
call void @llvm.memcpy.i32( i8* bitcast ([32 x i32]* @A to i8*),
|
|
i8* bitcast ([32 x i32]* @B to i8*),
|
|
i32 128, i32 1 )
|
|
|
|
ret void
|
|
}
|