1 2(This documentation is related to the development of gf2x) 3 4This lowlevel/ subdirectory is the place where new code may be added to gf2x, 5in particular new code for lowlevel routines, so-called mul1, mul2, mul3, 6and so on. The steps for adding code are: 7 8* Choose a file name. Assuming you are coding a new version of mul3, for 9 instance, you might choose to name your file mul3foo.c. The file name 10 must match mul[0-9] because probably some scripts rely on it. 11 12* Write a skeleton for mul3foo.c based on pre-existing files. There are a 13 couple of very important things in writing this file: 14 - The file must be guarded by a #ifndef GF2X_MUL3_H_ / ... / #endif 15 construct. The name of the macro matters. 16 - The file must include gf2x-small.h 17 - The function included must be called gf2x_mul3, and match the 18 expected prototype. 19 20* For inserting this function in the tuning mechanism, edit Makefile.am ; 21 Since the tedious Makefile.am code is now generated by a perl script 22 (albeit not automatically), one just has to add a new line among those 23 starting with #* 24 Then, to regenerate the tedious section of Makefile.am, do: 25 perl -i ./generate-test-list.pl Makefile.am 26 Note that this edits Makefile.am in place, so you'd better quit your 27 text editing section on Makefil.am first. 28 29Generated code: 30 31It is more complicated to add a new code _generation_ mechanism, and 32requires the following steps. 33 34* Assuming the generator code is in C (but it does not matter much), then 35 it must be codded, and a rule for building the _generator_ must be 36 added to Makefile.am. There is not much to it, probably a matter of 37 adding only a simple line to Makefile.am 38 39* Your generator must accept arguments, and output its result to a file 40 whose name matches gen_mul3 (for a mul3 of course). Or possibly write 41 to stdout. Then you have to copy one of the very ugly paragraphs, e.g. 42 the one for tune_gen_mul1_w64k2. The same warnings as above apply. 43 44* The generation rule has to be told to generate-test-list.pl somehow. 45