Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This patch adds support for __builtin_dcbf for PPC. __builtin_dcbf copies the contents of a modified block from the data cache to main memory and flushes the copy from the data cache. Differential revision: https://reviews.llvm.org/D59843 llvm-svn: 359517
- Loading branch information
1 parent
efba22c
commit 3962d6d
Showing
5 changed files
with
92 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -emit-llvm \ | ||
// RUN: -o - %s | FileCheck %s | ||
|
||
int A; | ||
int B[5]; | ||
float C; | ||
float D[5]; | ||
double E; | ||
double F[5]; | ||
|
||
void func(int a, int b[], float c, float d[], double e, double f[]) { | ||
__builtin_dcbf (&a); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&A); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&b[2]); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&B[2]); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&c); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&C); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&d[2]); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&D[2]); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&e); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&E); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&f[0]); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
|
||
__builtin_dcbf (&F[0]); | ||
// CHECK: @llvm.ppc.dcbf(i8* | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
; RUN: llc -mtriple=powerpc64le-unknown-linux-gnu < %s \ | ||
; RUN: -verify-machineinstrs -ppc-asm-full-reg-names \ | ||
; RUN: -ppc-vsr-nums-as-vr | FileCheck %s | ||
|
||
; Function Attrs: nounwind | ||
define void @dcbf_test(i8* %a) { | ||
entry: | ||
tail call void @llvm.ppc.dcbf(i8* %a) | ||
; CHECK-LABEL: @dcbf_test | ||
; CHECK: dcbf 0, r3 | ||
; CHECK-NEXT: blr | ||
ret void | ||
} | ||
|
||
declare void @llvm.ppc.dcbf(i8*) |