mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
626236d9bc
Older Book-E cores, such as the PPC 440, support only msync (which has the same encoding as sync 0), but not any of the other sync forms. Newer Book-E cores, however, do support sync, and for performance reasons we should allow the use of the more-general form. This refactors msync use into its own feature group so that it applies by default only to older Book-E cores (of the relevant cores, we only have definitions for the PPC440/450 currently). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@218923 91177308-0d34-0410-b5e6-96231b3b80d8
29 lines
525 B
LLVM
29 lines
525 B
LLVM
; RUN: llc < %s -march=ppc32 | FileCheck %s
|
|
; RUN: llc < %s -march=ppc64 -mcpu=a2 | FileCheck %s
|
|
; RUN: llc < %s -march=ppc32 -mcpu=440 | FileCheck %s -check-prefix=BE-CHK
|
|
|
|
define i32 @has_a_fence(i32 %a, i32 %b) nounwind {
|
|
entry:
|
|
fence acquire
|
|
%cond = icmp eq i32 %a, %b
|
|
br i1 %cond, label %IfEqual, label %IfUnequal
|
|
|
|
IfEqual:
|
|
fence release
|
|
; CHECK: sync
|
|
; CHECK-NOT: msync
|
|
; BE-CHK: msync
|
|
br label %end
|
|
|
|
IfUnequal:
|
|
fence release
|
|
; CHECK: sync
|
|
; CHECK-NOT: msync
|
|
; BE-CHK: msync
|
|
ret i32 0
|
|
|
|
end:
|
|
ret i32 1
|
|
}
|
|
|