Commit Graph

4 Commits

Author SHA1 Message Date
H. Peter Anvin (Intel)
41e9682efe preproc: massive cleanup of smacro expansion
The smacro expansion code was virtually impossible to understand, and
was leading to very strange failures. Clean it up, and do much better
handling of magic macros.  This should also allow for recursive
macros, but recursive macros are extremely tricky in that it is very
hard to keep them from recursing forever, unless there is at least one
argument which is never expanded. They are not currently implemented.

Even so, I believe token pasting makes it possible to create infinite
loops; e.g.:

%define foo foo %+

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
2019-04-25 18:00:32 -07:00
H. Peter Anvin
903ea54857 RAA: clean up the RAA infrastructure, make it support larger indicies
Make the RAA infrastructure a bit cleaner, make it support 64-bit
indicies, and reduce the memory overhead of a sparse or small RAA --
the old code would allocate a *minimum* of 256K for each RAA.  The new
code reduces that to 16K, and will not mandatorily allocate an entry
in the zero position.

The new shift, 11, was chosen so that a 32-bit RAA value will need 3
layers and a 64-bit value 6 layers, without excessive waste.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-06-14 20:23:49 -07:00
H. Peter Anvin
e39202c96a RAA: add functions for storing pointers in RAA's
RAAs can, and should be, usable for storing pointers as well as
integers. In reality it is exactly the same code, but make it explicit
by having different entry points.  In the actual RAA the data is
stored as a union, which in practice will not occupy any more space
than the existing code.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
2018-06-14 16:05:34 -07:00
H. Peter Anvin
e1f985c167 Reorganize the source code into subdirectories
Make the source code easier to understand and keep track of by
organizing it into subdirectories depending on the function.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2016-05-25 12:06:29 -07:00