add usz option to build/build

This commit is contained in:
dzaima 2023-04-06 17:47:31 +03:00
parent 5492eae8c5
commit cba6ef505a
3 changed files with 13 additions and 7 deletions

@ -1 +1 @@
Subproject commit 0cb33ab7a747c4e7a22f7c5a54321e6136e2d688 Subproject commit 38e0714974c29291118040b783b69229f653717b

View File

@ -51,10 +51,11 @@ opts ← ⟨
1, "singeli", 0, "Enable compilation with Singeli" 1, "singeli", 0, "Enable compilation with Singeli"
1, "replxx", 0, "Enable REPLXX"@+10 1, "replxx", 0, "Enable REPLXX"@+10
1, "c", 0, "Disable some default flags" 0, "usz", "32", "Size of array length fields in bits; default 32, can be 32 or 64"
1, "O3", @, "Use '-O3'; On by default unless 'c=1'" 1, "c", 0, "Disable some default flags"
1, "native", @, "Use '-march=native'" 1, "O3", @, "Use '-O3'; On by default unless 'c=1'"
2, "has", , "Assume specific arch features; options: AVX2, BMI2, slow-pdep"@+10 1, "native", @, "Use '-march=native'"
2, "has", , "Assume specific arch features; options: AVX2, BMI2, slow-pdep"@+10
1, "debug", 0, "Debug: '-DDEBUG -g'; enables various sanity checks" 1, "debug", 0, "Debug: '-DDEBUG -g'; enables various sanity checks"
1, "g", @, "Debug: '-g'; enable debug symbols" 1, "g", @, "Debug: '-g'; enable debug symbols"
@ -149,7 +150,7 @@ po ← { # parsed options
verbose, J, rebuildAll, rebuildSingeli, tui, output, clangd, versionName, verbose, J, rebuildAll, rebuildSingeli, tui, output, clangd, versionName,
os, arch, native, has, avx2 os, arch, native, has, avx2
emcc, wasm, replxx, singeli, emcc, wasm, replxx, singeli,
ffi, o3, debug, rtverify, heapverify, usz, ffi, o3, debug, rtverify, heapverify,
bytecodeDir, replxxDir, singeliDir, bytecodeDir, replxxDir, singeliDir,
CBQNc, ccColor, singeliFlags, REPLXXc, Linker CBQNc, ccColor, singeliFlags, REPLXXc, Linker
@ -172,6 +173,8 @@ po ← { # parsed options
native 0 DOpt "native" native 0 DOpt "native"
emcc GetOpt "emcc" emcc GetOpt "emcc"
wasi GetOpt "wasi" wasi GetOpt "wasi"
usz •ParseFloat GetOpt "usz"
{𝕊: "Error: usz can only be 32 or 64"}_assert_ usz3264
versionName {compat shared? @; "0"@ GetOpt "v"} versionName {compat shared? @; "0"@ GetOpt "v"}
{𝕊: "Error: Specifying version for shared build is useless"}_assert_¬ shared versionName@ {𝕊: "Error: Specifying version for shared build is useless"}_assert_¬ shared versionName@
wasm wasiemcc wasm wasiemcc
@ -284,6 +287,7 @@ po ← { # parsed options
args ( windows) / "-DNO_MMAP" args ( windows) / "-DNO_MMAP"
args (replxx windows) / "-DUSE_REPLXX_IO" args (replxx windows) / "-DUSE_REPLXX_IO"
args ( @versionName) / "-DHAS_VERSION" args ( @versionName) / "-DHAS_VERSION"
args ( usz64) / "-DUSZ_64"
args {"slow-pdep": "-DSLOW_PDEP"; "-m"𝕩}¨ has args {"slow-pdep": "-DSLOW_PDEP"; "-m"𝕩}¨ has
args args (¬/) GetOpt "rm_f" args args (¬/) GetOpt "rm_f"
{"CBQN C compiler: "•Repr 𝕩} _verboseLog args {"CBQN C compiler: "•Repr 𝕩} _verboseLog args
@ -631,7 +635,7 @@ cachedBin‿linkerCache ← {
•file.Name ga, •file.Name ga,
singeliArgs po.singeliFlags"-l", "gen="AtRoot singeliCache.folder{ singeliArgs po.singeliFlags"-l", "gen="AtRoot singeliCache.folder, "-c", "usz=u"•Repr po.usz{
po.native? ; po.native? ;
"-a" ({"x86-64":"X86_64"; "aarch64":"AARCH64"; "none"} po.arch) ','¨ Uppercase "avx2""bmi2"/po.has "-a" ({"x86-64":"X86_64"; "aarch64":"AARCH64"; "none"} po.arch) ','¨ Uppercase "avx2""bmi2"/po.has
} }

View File

@ -10,6 +10,8 @@ def reinterpret{T, x:X & T==X} = x
def exportN{f, ...ns} = each{{n} => export{n, f}, ns} def exportN{f, ...ns} = each{{n} => export{n, f}, ns}
def exportT{name, fs} = { v:*type{tupsel{0,fs}} = fs; export{name, v} } def exportT{name, fs} = { v:*type{tupsel{0,fs}} = fs; export{name, v} }
config usz = u32
def elwidth{T} = width{eltype{T}} def elwidth{T} = width{eltype{T}}
# more arith # more arith