summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-11-25 19:33:42 +0000
committerBruno Cardoso Lopes <bruno.cardoso@gmail.com>2011-11-25 19:33:42 +0000
commit1b9b377975b3f437acef8c2ba90de582add52f65 (patch)
tree3b924903b539999e3fcba3bd52254b3331f6d4e7 /test
parent70aaf37c11bbfffc8d3e007556da46c810e822a3 (diff)
downloadllvm-1b9b377975b3f437acef8c2ba90de582add52f65.tar.gz
llvm-1b9b377975b3f437acef8c2ba90de582add52f65.tar.bz2
llvm-1b9b377975b3f437acef8c2ba90de582add52f65.tar.xz
This patch contains support for encoding FMA4 instructions and
tablegen patterns for scalar FMA4 operations and intrinsic. Also add tests for vfmaddsd. Patch by Jan Sjodin git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145133 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/CodeGen/X86/fma4-intrinsics-x86_64.ll9
-rw-r--r--test/MC/X86/x86_64-fma4-encoding.s13
2 files changed, 22 insertions, 0 deletions
diff --git a/test/CodeGen/X86/fma4-intrinsics-x86_64.ll b/test/CodeGen/X86/fma4-intrinsics-x86_64.ll
new file mode 100644
index 0000000000..39c2311eb5
--- /dev/null
+++ b/test/CodeGen/X86/fma4-intrinsics-x86_64.ll
@@ -0,0 +1,9 @@
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown -march=x86-64 -mattr=fma4 | FileCheck %s
+
+define < 2 x double > @test_x86_fma4_vfmadd_sd(< 2 x double > %a0, < 2 x double > %a1, < 2 x double > %a2) {
+ ; CHECK: vfmaddsd
+ %res = call < 2 x double > @llvm.x86.fma4.vfmadd.sd(< 2 x double > %a0, < 2 x double > %a1, < 2 x double > %a2) ; <i64> [#uses=1]
+ ret < 2 x double > %res
+}
+declare < 2 x double > @llvm.x86.fma4.vfmadd.sd(< 2 x double >, < 2 x double >, < 2 x double >) nounwind readnone
+
diff --git a/test/MC/X86/x86_64-fma4-encoding.s b/test/MC/X86/x86_64-fma4-encoding.s
new file mode 100644
index 0000000000..e0d2602901
--- /dev/null
+++ b/test/MC/X86/x86_64-fma4-encoding.s
@@ -0,0 +1,13 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown --show-encoding %s | FileCheck %s
+
+// CHECK: vfmaddsd (%rcx), %xmm1, %xmm0, %xmm0
+// CHECK: encoding: [0xc4,0xe3,0xf9,0x6b,0x01,0x10]
+ vfmaddsd (%rcx), %xmm1, %xmm0, %xmm0
+
+// CHECK: vfmaddsd %xmm1, (%rcx), %xmm0, %xmm0
+// CHECK: encoding: [0xc4,0xe3,0x79,0x6b,0x01,0x10]
+ vfmaddsd %xmm1, (%rcx),%xmm0, %xmm0
+
+// CHECK: vfmaddsd %xmm2, %xmm1, %xmm0, %xmm0
+// CHECK: encoding: [0xc4,0xe3,0xf9,0x6b,0xc2,0x10]
+ vfmaddsd %xmm2, %xmm1, %xmm0, %xmm0