Skip to content

Commit

Permalink
Remove __restrict
Browse files Browse the repository at this point in the history
  • Loading branch information
lamphamsy committed Dec 10, 2018
1 parent e4a56b2 commit 814ae26
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
18 changes: 9 additions & 9 deletions src/simd_basic.h
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ inline void mul_coef_to_buf(const T a, T* src, T* dest, size_t len, T card)
{
const VecType coef = set_one(a);

VecType* __restrict _src = reinterpret_cast<VecType*>(src);
VecType* __restrict _dest = reinterpret_cast<VecType*>(dest);
VecType* _src = reinterpret_cast<VecType*>(src);
VecType* _dest = reinterpret_cast<VecType*>(dest);
const unsigned ratio = sizeof(*_src) / sizeof(*src);
const size_t _len = len / ratio;
const size_t _last_len = len - _len * ratio;
Expand Down Expand Up @@ -239,8 +239,8 @@ inline void mul_coef_to_buf(const T a, T* src, T* dest, size_t len, T card)
template <typename T>
inline void add_two_bufs(T* src, T* dest, size_t len, T card)
{
VecType* __restrict _src = reinterpret_cast<VecType*>(src);
VecType* __restrict _dest = reinterpret_cast<VecType*>(dest);
VecType* _src = reinterpret_cast<VecType*>(src);
VecType* _dest = reinterpret_cast<VecType*>(dest);
const unsigned ratio = sizeof(*_src) / sizeof(*src);
const size_t _len = len / ratio;
const size_t _last_len = len - _len * ratio;
Expand All @@ -260,9 +260,9 @@ inline void add_two_bufs(T* src, T* dest, size_t len, T card)
template <typename T>
inline void sub_two_bufs(T* bufa, T* bufb, T* res, size_t len, T card)
{
VecType* __restrict _bufa = reinterpret_cast<VecType*>(bufa);
VecType* __restrict _bufb = reinterpret_cast<VecType*>(bufb);
VecType* __restrict _res = reinterpret_cast<VecType*>(res);
VecType* _bufa = reinterpret_cast<VecType*>(bufa);
VecType* _bufb = reinterpret_cast<VecType*>(bufb);
VecType* _res = reinterpret_cast<VecType*>(res);
const unsigned ratio = sizeof(*_bufa) / sizeof(*bufa);
const size_t _len = len / ratio;
const size_t _last_len = len - _len * ratio;
Expand All @@ -287,8 +287,8 @@ inline void sub_two_bufs(T* bufa, T* bufb, T* res, size_t len, T card)
template <typename T>
inline void mul_two_bufs(T* src, T* dest, size_t len, T card)
{
VecType* __restrict _src = reinterpret_cast<VecType*>(src);
VecType* __restrict _dest = reinterpret_cast<VecType*>(dest);
VecType* _src = reinterpret_cast<VecType*>(src);
VecType* _dest = reinterpret_cast<VecType*>(dest);
const unsigned ratio = sizeof(*_src) / sizeof(*src);
const size_t _len = len / ratio;
const size_t _last_len = len - _len * ratio;
Expand Down
22 changes: 11 additions & 11 deletions src/simd_fnt.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ inline void butterfly_ct_step(
for (unsigned i = start; i < bufs_nb; i += step) {
VecType x1, y1;
VecType x2, y2;
VecType* __restrict p = reinterpret_cast<VecType*>(mem[i]);
VecType* __restrict q = reinterpret_cast<VecType*>(mem[i + m]);
VecType* p = reinterpret_cast<VecType*>(mem[i]);
VecType* q = reinterpret_cast<VecType*>(mem[i + m]);

size_t j = 0;
for (; j < end; j += 2) {
Expand Down Expand Up @@ -204,10 +204,10 @@ inline static void do_butterfly_ct_2_layers(
VecType c2 = set_one(r2);
VecType c3 = set_one(r3);

VecType* __restrict p = reinterpret_cast<VecType*>(mem[start]);
VecType* __restrict q = reinterpret_cast<VecType*>(mem[start + m]);
VecType* __restrict r = reinterpret_cast<VecType*>(mem[start + 2 * m]);
VecType* __restrict s = reinterpret_cast<VecType*>(mem[start + 3 * m]);
VecType* p = reinterpret_cast<VecType*>(mem[start]);
VecType* q = reinterpret_cast<VecType*>(mem[start + m]);
VecType* r = reinterpret_cast<VecType*>(mem[start + 2 * m]);
VecType* s = reinterpret_cast<VecType*>(mem[start + 3 * m]);

size_t j = 0;
const size_t end = (len > 1) ? len - 1 : 0;
Expand Down Expand Up @@ -361,8 +361,8 @@ inline void butterfly_gs_step(
for (unsigned i = start; i < bufs_nb; i += step) {
VecType x1, x2, x3, x4;
VecType y1, y2, y3, y4;
VecType* __restrict p = reinterpret_cast<VecType*>(mem[i]);
VecType* __restrict q = reinterpret_cast<VecType*>(mem[i + m]);
VecType* p = reinterpret_cast<VecType*>(mem[i]);
VecType* q = reinterpret_cast<VecType*>(mem[i + m]);

size_t j = 0;
for (; j < end; j += 4) {
Expand Down Expand Up @@ -438,8 +438,8 @@ inline void butterfly_gs_step_simple(
for (unsigned i = start; i < bufs_nb; i += step) {
VecType x1, y1;
VecType x2, y2;
VecType* __restrict p = reinterpret_cast<VecType*>(mem[i]);
VecType* __restrict q = reinterpret_cast<VecType*>(mem[i + m]);
VecType* p = reinterpret_cast<VecType*>(mem[i]);
VecType* q = reinterpret_cast<VecType*>(mem[i + m]);

size_t j = 0;
for (; j < end; j += 2) {
Expand Down Expand Up @@ -481,7 +481,7 @@ inline void encode_post_process(

const std::vector<T*>& mem = output.get_mem();
for (unsigned frag_id = 0; frag_id < code_len; ++frag_id) {
VecType* __restrict buf = reinterpret_cast<VecType*>(mem[frag_id]);
VecType* buf = reinterpret_cast<VecType*>(mem[frag_id]);

size_t vec_id = 0;
size_t end = (vecs_nb > 3) ? vecs_nb - 3 : 0;
Expand Down

0 comments on commit 814ae26

Please sign in to comment.