Browse Source

Restore clang array checks

master
Johan Pascal 4 years ago
parent
commit
38284bca28
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      CMakeLists.txt
  2. +2
    -2
      src/p448/arch_x86_64/f_impl.c

+ 1
- 1
CMakeLists.txt View File

@@ -54,7 +54,7 @@ else()
set(STRICT_OPTIONS_C "${STRICT_OPTIONS_C} -std=c99 -O2 -Wstrict-prototypes -Wno-error=strict-prototypes -fvisibility=hidden")
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(STRICT_OPTIONS_CPP "${STRICT_OPTIONS_CPP} -Wno-error=unknown-warning-option -Qunused-arguments -Wno-tautological-compare")
set(STRICT_OPTIONS_CPP "${STRICT_OPTIONS_CPP} -Wno-unused-function -Wno-array-bounds -Wno-pass-failed -Wno-error=sizeof-array-div")
set(STRICT_OPTIONS_CPP "${STRICT_OPTIONS_CPP} -Wno-unused-function -Wno-pass-failed")
endif()
if(ENABLE_STRICT)
set(STRICT_OPTIONS_CPP "${STRICT_OPTIONS_CPP} -Werror -Wextra -Wno-unused-parameter -fno-strict-aliasing")


+ 2
- 2
src/p448/arch_x86_64/f_impl.c View File

@@ -15,7 +15,7 @@ void gf_mul (gf_s *__restrict__ cs, const gf as, const gf bs) {

/* For some reason clang doesn't vectorize this without prompting? */
unsigned int i;
for (i=0; i<sizeof(aa)/sizeof(uint64xn_t); i++) {
for (i=0; i<sizeof(aa)/(sizeof(uint64xn_t)); i++) {
((uint64xn_t*)aa)[i] = ((const uint64xn_t*)a)[i] + ((const uint64xn_t*)(&a[4]))[i];
((uint64xn_t*)bb)[i] = ((const uint64xn_t*)b)[i] + ((const uint64xn_t*)(&b[4]))[i];
((uint64xn_t*)bbb)[i] = ((const uint64xn_t*)bb)[i] + ((const uint64xn_t*)(&b[4]))[i];
@@ -190,7 +190,7 @@ void gf_sqr (gf_s *__restrict__ cs, const gf as) {

/* For some reason clang doesn't vectorize this without prompting? */
unsigned int i;
for (i=0; i<sizeof(aa)/sizeof(uint64xn_t); i++) {
for (i=0; i<sizeof(aa)/(sizeof(uint64xn_t)); i++) {
((uint64xn_t*)aa)[i] = ((const uint64xn_t*)a)[i] + ((const uint64xn_t*)(&a[4]))[i];
}



Loading…
Cancel
Save