This was making sure that the overflow in some our opcode
implementations was visible to the C code so that overflow
detection would work in gcc and clang.
This is now handled on those compilers by using some built-ins
that detect overflow.
The `-fwrapv` should no longer be needed.
ClosesInterlisp/medley#90.
This no longer had anything to do with profiling and was
only doing some defines for the switch case block addresses,
which we no longer need since there's no longer optional
asm generated for them.
This feature was controlled by the compilation flag `OPDISP`
which would enable some bits of assembler on the x86 (ISC or DOS)
or some other specialized code on SPARC. On SPARC hardware, there
was a special compilation process that would preprocess the code
and generate dispatch tables.
We do this now when this feature is enabled using gcc's computed
gotos feature. This is available in clang and some other compilers.
Notably, it isn't present in Visual Studio.
This doesn't decrease our portability at all as this feature is
optional and it replaces specialized assembler code with C using
compiler extensions (making it cross-platform).
In doing this, we've removed a bunch of related code, however,
it is likely that other pieces yet remain and will be removed
in subsequent commits as we clean things up and refine them.
This feature remains disabled by default for now.
In the old build system, `ldeether` is built as follows:
```
$(OSARCHDIR)ldeether : $(SRCDIR)ldeether.c $(DLPIFILES)
$(CC) $(CFLAGS) -I$(INCDIR) $(SRCDIR)ldeether.c $(DLPIFILES) $(LDEETHERLDFLAGS) -o $(OSARCHDIR)ldeether
```
Instead of linking all of Maiko, it just links in the `src/dlpi.c`
object file.
This is the old way that releases were built and isn't relevant
today. It made a variety of assumptions about how things were
linked and allowed for the user to re-link an executable, but
that isn't something we need to do any longer.
This doesn't yet remove the checksum, ldechecksum, and related
scripts.
* Use gcc / clang overflow builtins.
This avoids expensive checks for overflow that employ undefined
behavior.
This is a step along the way towards replacing the old hand-written
assembler that did the same thing in terms of using the CPU's
overflow detection.
* Remove unimplemented SPARC asm for multiplication, divide, and remainder.
This wasn't implemented before, and for multiplication, it is now
implemented for gcc and friends using overflow detection.
* Remove USE_INLINE_ARITH.
Now that we have the compiler built-ins for detecting overflow,
we don't need custom assembly for it for each platform.
For now, we keep, but still don't use, the code that do a hot
path through the dispatch loop for some math. This code isn't
actually running or in use, but it is separate from how the
other inline arithmetic was being performed. These are the
`fast_op_*` functions that are implemented in assembler.
In commit 6f7ec059bc763d49c753adea70d5cc337f9e353c, we removed
some dead stores. This broke compilation when `STACKCHECK` was
enabled.
ClosesInterlisp/medley#162.
We now can handle these via `inc/maiko/platform.h` and the
constants defined there.
This doesn't change `OS5` for Solaris yet as that's a much wider
set of changes.
UNALIGNED_FETCH_OK shouldn't be set for an entire OS, but
based on the CPU architecture.
Some ARM systems don't allow unaligned reads. x86 and x86_64
do, so update how we configure this.
In the SunOS 4 days, the system cc apparently couldn't compile
the lp* files, so there was an arrangement to use an `ANSICC`,
which was just `gcc`, to build those files.
We no longer have this issue.
By adding `0.0` and not `0.0f` and by calling `fmod()` rather than
`fmodf()`, we were unintentionally coercing the value from a
`float` to a `double`.
This resulted in x86_64 assembler like this:
```
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
callq 403340 <fmod@plt>
cvtsd2ss %xmm0,%xmm0
```
which is now:
```
callq 403360 <fmodf@plt>
```
And for the `N_OP_equal` change:
```
cvtss2sd %xmm0,%xmm0
xorpd %xmm2,%xmm2
addsd %xmm2,%xmm0
cvtss2sd %xmm1,%xmm1
addsd %xmm2,%xmm1
xor %ecx,%ecx
ucomisd %xmm1,%xmm0
```
is now:
```
xorps %xmm2,%xmm2
addss %xmm2,%xmm0
addss %xmm2,%xmm1
xor %ecx,%ecx
ucomiss %xmm1,%xmm0
```
(Note `ss` rather than `sd`, along with the missing `cvtss2sd` calls.)
This wasn't actually hooked up any more, so it was pretty much
all dead code. The handling of this in the command line options
is gone.
In `bin/makefile-tail`, `DEVFILES` and `LIBFILES` became identical, so
`DEVFILES` went away.
* Delete code related to NATIVETRAN feature.
This was obsolete work that had been done for generating
native code from the bytecode.
ClosesInterlisp/medley#89.
* Remove unused SaveD6.
Previously, we were building as C89 and the new code required
the C99 flag on Solaris with Sun Studio. Now that we build as
C99, this should work now and we can remove the special case
code.
The predefined cursors (image and mask) are better represented
as arrays of const uint8_t rather than char. Likewise for the
window icon. Track this change in the functions that take the
image and mask as arguments, casting only when we get to the
X library functions that take char*.
* Bit of cleanup for Lisp_Xinitialized.
* Remove the `extern` from `xcursor.c`, where it was not used.
* Move the definition from `main.c` to `xinit.c` as it is
the only file using it.
* Use `stdbool.h` for it rather than an `int` with custom `TRUE`
and `FALSE` values.
* Add some asserts with Lisp_Xinitialized.