Commit graph

13 commits

Author SHA1 Message Date
Bill Currie
09a10f80e1 [util] Add basic SIMD implemented vector functions
They take advantage of gcc's vector_size attribute and so only cross,
dot, qmul, qvmul and qrot (create rotation quaternion from two vectors)
are needed at this stage as basic (per-component) math is supported
natively by gcc.

The provided functions work on horizontal (array-of-structs) data, ie a
vec4d_t or vec4f_t represents a single vector, or traditional vector
layout. Vertical layout (struct-of-arrays) does not need any special
functions as the regular math can be used to operate on four vectors at
a time.

Functions are provided for loading a vec4 from a vec3 (4th element set
to 0) and storing a vec4 into a vec3 (discarding the 4th element).

With this, QF will require AVX2 support (needed for vec4d_t). Without
support for doubles, SSE is possible, but may not be worthwhile for
horizontal data.

Fused-multiply-add is NOT used because it alters the results between
unoptimized and optimized code, resulting in -mfma really meaning
-mfast-math-anyway. I really do not want to have to debug issues that
occur only in optimized code.
2020-12-30 18:20:11 +09:00
Bill Currie
34bcf7faab Do a pure/const/noreturn/format attribute pass.
I always wanted these, but as gcc now provides warnings for functions that
could do with such attributes, finding all the functions is much easier.
2018-10-09 12:42:21 +09:00
Bill Currie
f0dc995c67 Handle c99 inline vs gnu89 inline.
The meaning of "extern inline" and "inline" swaps between the two, and
gcc-5 uses c99 inline.
2015-08-18 00:11:03 +09:00
Bill Currie
9028cda24b Add -fno-unsafe-math-optimizations to CFLAGS.
It seems -ffast-math is not necessarily faster, and the errors it causes
may not be worth the gains, but I'm not sure I want to nuke it completely,
so instead disabling the worst offender of it
(-fno-unsafe-math-optimizations) seems to be the best option. qfbsp now
produces identical text output between optimized and unoptimized builds,
and may be slightly faster than before the change (1.9s for start.map vs
2.0s)
2013-01-11 11:17:31 +09:00
Bill Currie
6eb6b6c0ba Change pointer_t to unsigned and clean up the mess.
It doesn't make sense to have negative pointers. The size of the commit is
from enabling gcc's -Wtype-limits warning and cleaning up that mess too.
2012-12-21 21:53:13 +09:00
Bill Currie
ef7678fcec Use DWARF debugging with recent gcc.
Oh, wow, I wish I'd known about it before. C macro evaluation in gdb!!!
*sob*
2012-11-14 14:51:23 +09:00
Bill Currie
df47dd31f1 Clean up the excessive makefile vars generated by AC_SUBST.
While it further breaks RPM building, all AC_SUBST(HAVE_*) have been nuked.
When AM_SUBST_NOTMAKE, tell automake to not generate var = @var@ in
Makefile.in for qf specific vars (QF_SUBST is a wrapper for AC_SUBST that
also calls AM_SUBST_NOTMAKE).
2012-02-13 15:49:55 +09:00
Bill Currie
b7e5ad6306 Clean up plugin_ldadd and plugin_ldflags 2012-02-07 12:52:12 +09:00
Bill Currie
b812c0e235 Disable -Wlogical-op for gcc 4.4 or lower.
It seems to be broken before 4.5.
2011-03-21 21:54:00 +09:00
Bill Currie
01144d23cf Add a new gcc warning option and fix the two bugs it found. 2011-03-17 19:58:56 +09:00
Jeff Teunissen
02068f7092 Don't override a pre-set CFLAGS
Debian has optimization/debug requirements, so allow dpkg-buildpackage to
set CFLAGS and have it be respected.
2010-12-24 05:03:31 -05:00
Bill Currie
abf3972c84 get --disable-optimize and --disable-debug working again
LT_INIT messes with CFLAGS, so do a save/restore around the invocation
2010-08-20 11:31:59 +09:00
Bill Currie
669771681a split up and modernize configure.ac
Most of the guts of configure.ac have been moved to config.d and are then
brought in by m4_include. This will make maintaining configure.ac much easier.

Also drop use of PROGRAM and VERSION, using PACKAGE_NAME, PACKAGE_VERSION, and
on occasion, PACKAGE_STRING instead, and clean out some old files we no longer
need.
2010-08-19 15:01:43 +09:00