summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-12-03 07:39:04 +0000
committerBill Wendling <isanbard@gmail.com>2013-12-03 07:39:04 +0000
commit751c7caf0d8863bf5fc37486ce0aa3cec00591ac (patch)
treebd1700518637872910ac5b7ac9ba8673d912c223
parent5fc0070c015443745ea4705765d4332079a0f95e (diff)
downloadclang-751c7caf0d8863bf5fc37486ce0aa3cec00591ac.tar.gz
clang-751c7caf0d8863bf5fc37486ce0aa3cec00591ac.tar.bz2
clang-751c7caf0d8863bf5fc37486ce0aa3cec00591ac.tar.xz
Merging r196153:
------------------------------------------------------------------------ r196153 | mcrosier | 2013-12-02 13:07:27 -0800 (Mon, 02 Dec 2013) | 2 lines [AArch64] Implemented vcopy_lane patterns using scalar DUP instruction. Patch by Ana Pazos! ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_34@196232 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/Basic/arm_neon.td6
-rw-r--r--test/CodeGen/aarch64-neon-copy.c53
2 files changed, 56 insertions, 3 deletions
diff --git a/include/clang/Basic/arm_neon.td b/include/clang/Basic/arm_neon.td
index 300ca036fc..c559945c2c 100644
--- a/include/clang/Basic/arm_neon.td
+++ b/include/clang/Basic/arm_neon.td
@@ -835,13 +835,13 @@ def GET_LANE : IInst<"vget_lane", "sdi",
def SET_LANE : IInst<"vset_lane", "dsdi",
"csilPcPsUcUsUiUlQcQsQiQlQUcQUsQUiQUlPcPsQPcQPsfdQfQdPlQPl">;
def COPY_LANE : IOpInst<"vcopy_lane", "ddidi",
- "csiPcPsUcUsUiPcPsfPl", OP_COPY_LN>;
+ "csilPcPsUcUsUiUlPcPsPlfd", OP_COPY_LN>;
def COPYQ_LANE : IOpInst<"vcopy_lane", "ddigi",
"QcQsQiQlQUcQUsQUiQUlQPcQPsQfQdQPl", OP_COPYQ_LN>;
def COPY_LANEQ : IOpInst<"vcopy_laneq", "ddiki",
- "csiPcPsUcUsUif", OP_COPY_LNQ>;
+ "csilPcPsPlUcUsUiUlf", OP_COPY_LNQ>;
def COPYQ_LANEQ : IOpInst<"vcopy_laneq", "ddidi",
- "QcQsQiQlQUcQUsQUiQUlQPcQPsQfdQPl", OP_COPY_LN>;
+ "QcQsQiQlQUcQUsQUiQUlQPcQPsQfdQdQPl", OP_COPY_LN>;
////////////////////////////////////////////////////////////////////////////////
// Set all lanes to same value
diff --git a/test/CodeGen/aarch64-neon-copy.c b/test/CodeGen/aarch64-neon-copy.c
index 7c77b177af..6bc6f005f3 100644
--- a/test/CodeGen/aarch64-neon-copy.c
+++ b/test/CodeGen/aarch64-neon-copy.c
@@ -1192,3 +1192,56 @@ float64x2_t test_vmovq_n_f64(float64_t v1) {
return vmovq_n_f64(v1);
// CHECK: dup {{v[0-9]+}}.2d, {{v[0-9]+}}.d[0]
}
+
+// CHECK: test_vcopy_lane_s64
+int64x1_t test_vcopy_lane_s64(int64x1_t a, int64x1_t c) {
+ return vcopy_lane_s64(a, 0, c, 0);
+// CHECK: fmov {{d[0-9]+}}, {{d[0-9]+}}
+// CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vcopy_lane_u64
+uint64x1_t test_vcopy_lane_u64(uint64x1_t a, uint64x1_t c) {
+ return vcopy_lane_u64(a, 0, c, 0);
+// CHECK: fmov {{d[0-9]+}}, {{d[0-9]+}}
+// CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vcopy_lane_f64
+float64x1_t test_vcopy_lane_f64(float64x1_t a, float64x1_t c) {
+ return vcopy_lane_f64(a, 0, c, 0);
+// CHECK: fmov {{d[0-9]+}}, {{d[0-9]+}}
+// CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vcopy_laneq_s64
+int64x1_t test_vcopy_laneq_s64(int64x1_t a, int64x2_t c) {
+ return vcopy_laneq_s64(a, 0, c, 1);
+// CHECK: dup {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vcopy_laneq_u64
+uint64x1_t test_vcopy_laneq_u64(uint64x1_t a, uint64x2_t c) {
+ return vcopy_laneq_u64(a, 0, c, 1);
+// CHECK: dup {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vcopy_laneq_f64
+float64x1_t test_vcopy_laneq_f64(float64x1_t a, float64x1_t c) {
+ return vcopy_laneq_f64(a, 0, c, 0);
+// CHECK: fmov {{d[0-9]+}}, {{d[0-9]+}}
+// CHECK-NOT: dup {{d[0-9]+}}, {{v[0-9]+}}.d[0]
+}
+
+// CHECK: test_vcopy_laneq_p64
+poly64x1_t test_vcopy_laneq_p64(poly64x1_t a, poly64x2_t c) {
+ return vcopy_laneq_p64(a, 0, c, 1);
+// CHECK: dup {{d[0-9]+}}, {{v[0-9]+}}.d[1]
+}
+
+// CHECK: test_vcopyq_laneq_f64
+float64x2_t test_vcopyq_laneq_f64(float64x2_t a, float64x2_t c) {
+// CHECK: ins {{v[0-9]+}}.d[1], {{v[0-9]+}}.d[1]
+ return vcopyq_laneq_f64(a, 1, c, 1);
+}
+