diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-08-02 17:39:17 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2009-08-02 17:39:17 +0000 |
commit | b052972a5884717b19ee95d50c117ef13f116404 (patch) | |
tree | 3899495cee81e72e4a107d5212898586febb8b72 /llvm/test/CodeGen/Blackfin/inline-asm.ll | |
parent | 526e803f6a9fa0ccc867d5a289175aa1fc9c378e (diff) | |
download | bcm5719-llvm-b052972a5884717b19ee95d50c117ef13f116404.tar.gz bcm5719-llvm-b052972a5884717b19ee95d50c117ef13f116404.zip |
Inline assembly support for Blackfin.
We use the same constraints as GCC, including those that are slightly insane for inline assembler.
llvm-svn: 77899
Diffstat (limited to 'llvm/test/CodeGen/Blackfin/inline-asm.ll')
-rw-r--r-- | llvm/test/CodeGen/Blackfin/inline-asm.ll | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/Blackfin/inline-asm.ll b/llvm/test/CodeGen/Blackfin/inline-asm.ll new file mode 100644 index 00000000000..ee8fbb01604 --- /dev/null +++ b/llvm/test/CodeGen/Blackfin/inline-asm.ll @@ -0,0 +1,38 @@ +; RUN: llvm-as < %s | llc -march=bfin | FileCheck %s + +; Standard "r" +; CHECK: r0 = r0 + r1; +define i32 @add_r(i32 %A, i32 %B) { + %R = call i32 asm "$0 = $1 + $2;", "=r,r,r"( i32 %A, i32 %B ) nounwind + ret i32 %R +} + +; Target "d" +; CHECK: r0 = r0 - r1; +define i32 @add_d(i32 %A, i32 %B) { + %R = call i32 asm "$0 = $1 - $2;", "=d,d,d"( i32 %A, i32 %B ) nounwind + ret i32 %R +} + +; Target "a" for P-regs +; CHECK: p0 = (p0 + p1) << 1; +define i32 @add_a(i32 %A, i32 %B) { + %R = call i32 asm "$0 = ($1 + $2) << 1;", "=a,a,a"( i32 %A, i32 %B ) nounwind + ret i32 %R +} + +; Target "z" for P0, P1, P2. This is not a real regclass +; CHECK: p0 = (p0 + p1) << 2; +define i32 @add_Z(i32 %A, i32 %B) { + %R = call i32 asm "$0 = ($1 + $2) << 2;", "=z,z,z"( i32 %A, i32 %B ) nounwind + ret i32 %R +} + +; Target "C" for CC. This is a single register +; CHECK: cc = p0 < p1; +; CHECK: r0 = cc; +define i32 @add_C(i32 %A, i32 %B) { + %R = call i32 asm "$0 = $1 < $2;", "=C,z,z"( i32 %A, i32 %B ) nounwind + ret i32 %R +} + |