Skip to content
This repository has been archived by the owner on Feb 2, 2023. It is now read-only.

Commit

Permalink
Added no AVX option for code generation
Browse files Browse the repository at this point in the history
  • Loading branch information
DomenicoCacace committed Dec 31, 2020
1 parent 773e3ae commit 4184a91
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions scripts/djb_generator/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,14 @@ def main():
argParser = argparse.ArgumentParser()
argParser.add_argument("-ws", "--wordsize", help="The number of bits addressable by the CPU at once (default: 256)", default=256, type=int, dest="ws")
argParser.add_argument("-s", "--digit-size", help="The number of bits per digit (default: 64)", default=64, type=int, dest="size")
argParser.add_argument("-n", "--no-avx", help="Generates code for machines not supporting AVX intrinsics", action="store_false", dest="AVX")
args = argParser.parse_args()

# Setting memory word size related parameters
if not args.AVX:
args.ws = args.size
k.AVX = False

k.WS = args.ws
k.DIGIT_SIZE_b = args.size
k.DIGIT_SIZE_B = k.DIGIT_SIZE_b >> 3
Expand Down
1 change: 1 addition & 0 deletions scripts/djb_generator/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
DIGIT_SIZE_B = 0
DIGIT_SIZE_b =0
WS = 0
AVX = True

# Maximum size for direct multiplications
CHUNK_SIZE = 9
Expand Down
2 changes: 1 addition & 1 deletion scripts/djb_generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ def scalarprod(nr, res, na, a0, a1, nb, b0, b1, offset=0):

# Generates the code for a base multiplication
def GF2X_MUL(nr, res, na, a, nb, b):
if na < k.CHUNK_SIZE:
if k.AVX and na < k.CHUNK_SIZE:
return "gf2x_mul_" + str(na) + "_avx(" + res + ", " + a + ", " + b +");"

return "GF2X_MUL(" + str(nr) + ", " + res + ", " + str(na) + ", " + a + ", " + str(nb) + ", " + b + ");"
Expand Down
2 changes: 1 addition & 1 deletion src/benchmarking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set(OPTIMIZATION_FLAGS "-O2 -fipa-cp-clone -floop-interchange -fgcse-after-reloa
-fsplit-loops -fsplit-paths -ftree-loop-distribution -ftree-loop-vectorize \
-ftree-partial-pre -funswitch-loops -fvect-cost-model -fvect-cost-model=dynamic -fversion-loops-for-strides")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wuninitialized -fno-var-tracking-assignments -march=native -O0 -g3 -Wno-unused-function")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -pedantic -Wuninitialized -fno-var-tracking-assignments -march=native -O3 -g3 -Wno-unused-function")

set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -Wall -pedantic -Wuninitialized -march=native -g3")
message("FLAGS" ${CMAKE_C_FLAGS})
Expand Down

0 comments on commit 4184a91

Please sign in to comment.