[Beignet] [PATCH 1/3] fix bswap bug.
xionghu.luo at intel.com
xionghu.luo at intel.com
Wed Aug 12 23:27:49 PDT 2015
From: Luo Xionghu <xionghu.luo at intel.com>
if the source is uniform and dst is non-uniform, no need to add the
indirect address index.
Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
backend/src/backend/gen8_context.cpp | 6 ++++--
backend/src/backend/gen_context.cpp | 9 ++++++---
2 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/backend/src/backend/gen8_context.cpp b/backend/src/backend/gen8_context.cpp
index b497ee5..eca8eeb 100644
--- a/backend/src/backend/gen8_context.cpp
+++ b/backend/src/backend/gen8_context.cpp
@@ -182,7 +182,8 @@ namespace gbe
p->MOV(GenRegister::offset(GenRegister::retype(tmp, GEN_TYPE_UB), 0, 16), ind_src);
if (simd == 16) {
for (int i = 0; i < 2; i++) {
- ind_src.addr_imm += 16;
+ if(!uniform_src)
+ ind_src.addr_imm += 16;
p->MOV(GenRegister::offset(GenRegister::retype(tmp, GEN_TYPE_UB), 1, 16*i), ind_src);
}
}
@@ -237,7 +238,8 @@ namespace gbe
GenRegister ind_src = GenRegister::to_indirect1xN(GenRegister::retype(src, GEN_TYPE_UB), new_a0[0], 0);
p->MOV(GenRegister::retype(tmp, GEN_TYPE_UB), ind_src);
if (simd == 16) {
- ind_src.addr_imm += 16;
+ if(!uniform_src)
+ ind_src.addr_imm += 16;
p->MOV(GenRegister::offset(GenRegister::retype(tmp, GEN_TYPE_UB), 0, 16), ind_src);
}
p->pop();
diff --git a/backend/src/backend/gen_context.cpp b/backend/src/backend/gen_context.cpp
index e16b0a9..8ee65ee 100644
--- a/backend/src/backend/gen_context.cpp
+++ b/backend/src/backend/gen_context.cpp
@@ -384,12 +384,14 @@ namespace gbe
GenRegister ind_src = GenRegister::to_indirect1xN(GenRegister::retype(src, GEN_TYPE_UB), new_a0[0], 0);
p->MOV(GenRegister::retype(tmp, GEN_TYPE_UB), ind_src);
for (int i = 1; i < 4; i++) {
- ind_src.addr_imm += 8;
+ if (!uniform_src)
+ ind_src.addr_imm += 8;
p->MOV(GenRegister::offset(GenRegister::retype(tmp, GEN_TYPE_UB), 0, 8*i), ind_src);
}
if (simd == 16) {
for (int i = 0; i < 4; i++) {
- ind_src.addr_imm += 8;
+ if (!uniform_src)
+ ind_src.addr_imm += 8;
p->MOV(GenRegister::offset(GenRegister::retype(tmp, GEN_TYPE_UB), 1, 8*i), ind_src);
}
}
@@ -428,7 +430,8 @@ namespace gbe
GenRegister ind_src = GenRegister::to_indirect1xN(GenRegister::retype(src, GEN_TYPE_UB), new_a0[0], 0);
p->MOV(GenRegister::retype(tmp, GEN_TYPE_UB), ind_src);
for (int i = 1; i < (simd == 8 ? 2 : 4); i++) {
- ind_src.addr_imm += 8;
+ if (!uniform_src)
+ ind_src.addr_imm += 8;
p->MOV(GenRegister::offset(GenRegister::retype(tmp, GEN_TYPE_UB), 0, 8*i), ind_src);
}
p->pop();
--
1.9.1
More information about the Beignet
mailing list