Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

libzahl - big integer library

Name: Anonymous 2016-03-05 22:05

http://git.suckless.org/libzahl/tree/
The rationale for its creation can be found on the README file.
What do you think?

Name: suigin 2016-10-05 6:50

>>80
Forgot to delete it.
STOKE will never defeat a hardened zen master.
I haven't watched the slcon videos, my apologies. Time is limited.

Broke my wrist 2 months ago, and had surgery, was out for a few weeks. It's still soar as fug. Carpal tunnel 4 lyfe.

Now I'm just used up junk.

Name: Anonymous 2016-10-05 7:56

>>81
You're not junk Suigin, we all love you! I hope you get to feeling better about yourself and your injuries heal :3.

Name: Anonymous 2016-10-05 14:19

I like the suigin and his software.
Get better soon.

STOKE will never defeat a hardened zen master.

Does this mean you will abandon it and keep asm in hebimath forever?
Is the speed gain from it really needed?

Name: suigin 2016-10-06 3:48

>>83
Thanks.

Not abandoned, I'm back to working on it. Why would I want to get rid of the assembly code? STOKE doesn't eliminate assembly source files, it just helps automate writing the assembly files.

Name: Anonymous 2016-10-06 8:27

C doesn't eliminate assembly files, it just helps automate writing the assembly files.

Name: Anonymous 2016-10-06 8:30

assembly doesn't eliminate electric signal, it just helps automate manipulating electric signal.

Name: Anonymous 2016-10-06 9:21

>>86
Circuits are physics, dolt.

Name: Anonymous 2016-10-06 21:07

☝ 👌

Name: Anonymous 2016-10-07 13:01

On runtests.sh you use backticks instead of cipher.
You should read this http://stackoverflow.com/a/33301370
In your case it shouldn't matter because it's so simple, but it's a good idea to always use ciphers instead for ``best practice''.

I also get errors from ar and ranlib when compiling.
``plugin needed to handle lto object''

Name: Anonymous 2016-10-07 13:12

I usually like Suckless stuff and a simple, easily auditable bigint library is sorely needed, but this is hardly an improvement over the current state. libzahl still allocates during operations, for which there is no reason — provide a thin wrapper API if you think providing memory manually is a concern. This is particularly crucial because as soon as you begin to allocate during operations, you must handle allocation failures everywhere: GNU MP does the utterly insane and calls abort while libzahl appears to use a globally saved longjmp instead, sacrificing thread-safety.

Name: Anonymous 2016-10-07 13:14

>>90
if you think providing memory manually is a concern inconvenient
Always double-check your posts after making quick changes in the middle, kids.

Name: suigin 2016-10-08 6:09

>>89
Thanks for trying it out.

I recall someone mentioning the perils of backticks on the suckless mailing list. They also mentioned a linting tool that checks shell scripts for compliance. Can't find the email now though.

As for the problem with LTO, in GCC 4.9 they introduced a new slim LTO format which broke backward compatibility with the traditional tool chain. I think Clang/LLVM 3.9 just added support for it as well. Anyway, new tool front-ends were introduced for working with slim LTO objects, gcc-ar, gcc-ranlib, gcc-nm which all call ar, ranlib, and nm with the addition LTO plugin arguments.

Fix it locally by modifying the AR and RANLIB variables to use gcc-ar and gcc-ranlib in config.mk or on the command line or remove -flto from the CFLAGS variable.

The reason I haven't changed this to be the default yet is that it breaks things on FreeBSD 10 and one of my other build machines running an old Ubuntu 14.10 LTS install. Not sure of the best way to go forward here. Multiple config.mk files? Dynamically detect if gcc-ar and gcc-ranlib are accessible form PATH in the Makefile using the shell assignment operator?

I don't care about POSIX compliance for the makefiles, just GNU make and bmake cross compatibility.

Name: suigin 2016-10-08 8:20

>>92
Found it. shellcheck.

Name: Anonymous 2016-10-08 21:02

Why doesn't C have built-in bignum support?

Name: Anonymous 2016-10-09 19:59

>>94
1.That would increase C size. C runs on everything from toasters to supercomputers.
2.It would mandate a rigid standard where arch/compiler optimization would be important.
3.It would have no benefit, since bignum libraries update faster and have the most features at best speed.

Name: Anonymous 2016-10-10 21:44

Check em

Name: Anonymous 2016-10-11 0:05

check em

Name: Anonymous 2017-01-01 23:56

tried running ``make bench'' on hebimath.

CC bench/bench.c
AR bench/libbench.a
CC bench/p/padd.c
CC bench/p/paddu.c
CC bench/p/pclz.c
CC bench/p/pctz.c
CC bench/p/pcmp.c
CC bench/p/pcopy.c
CC bench/p/pdivrem.c
/usr/lib/gcc/x86_64-alpine-linux-musl/6.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: libhebimath.a(recipu2x1.o): relocation R_X86_64_32S against hidden symbol `hebi_recipu64_v0lut__' can not be used when making a shared object
/usr/lib/gcc/x86_64-alpine-linux-musl/6.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: libhebimath.a(pmove.o): relocation R_X86_64_32S against `.rodata' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-alpine-linux-musl/6.3.0/../../../../x86_64-alpine-linux-musl/bin/ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
make: *** [Makefile:354: bench/p/pdivrem] Error 1

Name: Anonymous 2017-01-02 1:32

>>98
Try harder.

Name: Anonymous 2017-01-02 1:48

>>99
it appears that the error is because my distro makes use of PIE (position-independent executable) by default.

Name: Anonymous 2017-01-02 2:02

>>100-99
nice dubs

Name: Anonymous 2017-01-02 15:02

>>100
Sorry, but PIE means Proto-Indo-European. Does your distro use Proto-Indo-European language by default?

Name: suigin 2017-01-03 5:06

>>98,100
Thanks for diagnosing the problem, you just need to add -fpic to your CFLAGS when building and linking against the static library.

Don't think I'll be changing the default config.mk though.

Name: Anonymous 2017-01-03 14:22

>>103
Adding -fpic didn't work, but -no-pie did. But I lose the benefits of PIE if I use that flag...
Also ran the tests. pdivrem and pshl gave ``Illegal instruction''.
Full report.

running bench tests
=============================================
bench/p/padd
1.11092342 seconds 2807320549 cycles
bench/p/paddu
0.61399935 seconds 1551585089 cycles
bench/p/pclz
0.38591482 seconds 975212322 cycles
bench/p/pctz
0.04113274 seconds 103942455 cycles
bench/p/pcmp
0.25936612 seconds 655420130 cycles
bench/p/pcopy
0.62378001 seconds 1576300554 cycles
bench/p/pdivrem
Illegal instruction
bench/p/pdivremu
4.67800991 seconds 11821408959 cycles
bench/p/pmove
0.82385516 seconds 2081893366 cycles
bench/p/pmul
11.81116410 seconds 29847010724 cycles
bench/p/pmul_karatsuba
4.05948106 seconds 10258375022 cycles
bench/p/pmulu
1.12860501 seconds 2852001229 cycles
bench/p/pnorm
0.27017547 seconds 682734816 cycles
bench/p/pshl
Illegal instruction
bench/p/pshr
0.91286878 seconds 2306832982 cycles
bench/p/psqr
12.04847466 seconds 30446699611 cycles
bench/p/psqr_karatsuba
3.78380911 seconds 9561747711 cycles
bench/p/psub
1.22896880 seconds 3105622042 cycles
bench/p/psubu
0.59403863 seconds 1501143056 cycles
bench/p/pzero
0.34930230 seconds 882689481 cycles
=============================================
all done

Name: Anonymous 2017-01-03 14:26

>>104
be careful when talking about 'benefits of PIE'. suckless guys are static linking zealots. it's one of the things they're wrong about - especially when they stop talking shit about ASLR - but you can't reason with them

Name: Anonymous 2017-01-03 15:38

Static linking considered harmful

Name: suigin 2017-01-03 16:24

>>104
Thanks. I must be incorrectly detecting support for something.

Mind running lscpu(1) (should be a part of the util-linux package) and giving me the output? Particularly interested in your CPUID flags.

Name: Anonymous 2017-01-03 16:36

suigin what do you think about the collapse of the suckless org?

Name: Anonymous 2017-01-03 16:53

>>107
np, glad to help.

Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm pcid sse4_1 sse4_2 popcnt lahf_lm ida arat dtherm tpr_shadow vnmi flexpriority ept vpid

Name: suigin 2017-01-04 3:33

>>108
Collapse? I heard that Christoph Lohmann left for reasons unknown (or perhaps it's obvious, just look at what's happening to Germany right now). But other than that, I was not aware the community was in a state of collapse.

>>109
Thanks, I'll look into it when I wake up in a few hours, was my first day back to work after the break, need to crash.

Name: Anonymous 2017-01-04 3:35

☝   ✌

Name: Anonymous 2017-01-04 5:38

>>108
suckless didn't collapse. 20h just left to bitreich, but apart from that I don't see much change. I'm still sad that Christoph left, his work was always great.

>>110
Too bad your vacations are already over. Good luck going back to your job. I hope it's not so dull. Have a nice night of sleep. Have a nice 2017.

Name: suigin 2017-01-04 9:18

>>109
Should be fixed in the following commit, let me know.

https://github.com/suiginsoft/hebimath/commit/667591f9716f316d2e7efa5f5dc212e05fe66123

>>112
Thanks, hope everyone has a good year as well.

Name: Anonymous 2017-01-04 14:47

>>113
It's fixed, good job.

Name: Anonymous 2017-01-04 15:06

suigin and maandree: why not work on unifying a benchmarking suite?
It could be an independent project that benchmarks hebimath against libzahl against gmp against libtommath.
In the end generates a nice graphic showing which one is better where (R? Gnuplot? Julia?).

Name: Anonymous 2017-01-04 17:51

Name: Anonymous 2017-01-04 20:13

It's very cool that suigin is adapting hebimath for strict MISRA C and CERT C compliance.
More software should follow this.

Name: Anonymous 2017-01-04 20:32

suigin: you should look into automatic benchmark reports between commits ( for example https://github.com/JuliaCI/BaseBenchmarkReports/ ).
After every commit, it automatically runs benchmarks between before-commit and after-commit and upload a full report with possible regressions on speed.
For hebimath it'd be good addition, since it's numerical software.

Name: Anonymous 2017-01-04 23:08

>>116
So... suckless with GPL?
I don't get it.

Name: Anonymous 2017-01-05 13:33


Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List