mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-19 04:32:19 +00:00
72062f5744
This patch adds support for AArch64 (ARM's 64-bit architecture) to LLVM in the "experimental" category. Currently, it won't be built unless requested explicitly. This initial commit should have support for: + Assembly of all scalar (i.e. non-NEON, non-Crypto) instructions (except the late addition CRC instructions). + CodeGen features required for C++03 and C99. + Compilation for the "small" memory model: code+static data < 4GB. + Absolute and position-independent code. + GNU-style (i.e. "__thread") TLS. + Debugging information. The principal omission, currently, is performance tuning. This patch excludes the NEON support also reviewed due to an outbreak of batshit insanity in our legal department. That will be committed soon bringing the changes to precisely what has been approved. Further reviews would be gratefully received. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174054 91177308-0d34-0410-b5e6-96231b3b80d8
58 lines
1.4 KiB
LLVM
58 lines
1.4 KiB
LLVM
; RUN: llc -verify-machineinstrs < %s -march=aarch64 -O0 | FileCheck %s
|
|
; RUN: llc -verify-machineinstrs < %s -march=aarch64 -O0 -disable-fp-elim | FileCheck -check-prefix CHECK-WITHFP %s
|
|
|
|
; Make sure a reasonably sane prologue and epilogue are
|
|
; generated. This test is not robust in the face of an frame-handling
|
|
; evolving, but still has value for unrelated changes, I
|
|
; believe.
|
|
;
|
|
; In particular, it will fail when ldp/stp are used for frame setup,
|
|
; when FP-elim is implemented, and when addressing from FP is
|
|
; implemented.
|
|
|
|
@var = global i64 0
|
|
@local_addr = global i64* null
|
|
|
|
declare void @foo()
|
|
|
|
define void @trivial_func() nounwind {
|
|
; CHECK: trivial_func: // @trivial_func
|
|
; CHECK-NEXT: // BB#0
|
|
; CHECK-NEXT: ret
|
|
|
|
ret void
|
|
}
|
|
|
|
define void @trivial_fp_func() {
|
|
; CHECK-WITHFP: trivial_fp_func:
|
|
|
|
; CHECK-WITHFP: sub sp, sp, #16
|
|
; CHECK-WITHFP: stp x29, x30, [sp]
|
|
; CHECK-WITHFP-NEXT: mov x29, sp
|
|
|
|
; Dont't really care, but it would be a Bad Thing if this came after the epilogue.
|
|
; CHECK: bl foo
|
|
call void @foo()
|
|
ret void
|
|
|
|
; CHECK-WITHFP: ldp x29, x30, [sp]
|
|
; CHECK-WITHFP: add sp, sp, #16
|
|
|
|
; CHECK-WITHFP: ret
|
|
}
|
|
|
|
define void @stack_local() {
|
|
%local_var = alloca i64
|
|
; CHECK: stack_local:
|
|
; CHECK: sub sp, sp, #16
|
|
|
|
%val = load i64* @var
|
|
store i64 %val, i64* %local_var
|
|
; CHECK: str {{x[0-9]+}}, [sp, #{{[0-9]+}}]
|
|
|
|
store i64* %local_var, i64** @local_addr
|
|
; CHECK: add {{x[0-9]+}}, sp, #{{[0-9]+}}
|
|
|
|
ret void
|
|
}
|