Commit Graph

12 Commits

Author SHA1 Message Date
Bill Currie d9d0a80752 [gamecode] Add an extend instruction
The extend instruction is for loading narrower data types into wider
data types, eg, single element into 2, 3, or 4 element types, with a
small set of extension schemes: 0, 1, -1, copy (for 1->any and 2 -> 4).
Possibly most importantly, it works with unaligned data.

Progress towards #30
2022-08-18 18:18:19 +09:00
Bill Currie 78119aeb7a [gamecode] Clean up generated swizzle code 2022-04-01 02:14:05 +09:00
Bill Currie 7a6ca0ebcb [simd] Use portable swizzles
gcc and clang have rather different swizzle builtins, but both do a nice
job of optimizing the intuitive initializer swizzle (I think gcc 8(?)
didn't do such a good job thus my use of __builtin_shuffle).
2022-03-31 02:25:33 +09:00
Bill Currie fb83d87a0e Fix some distcheck issues
Just keeping up with myself.
2022-03-01 10:12:50 +09:00
Bill Currie 59044d3827 Fix a bunch of distcheck issues 2022-02-14 19:28:19 +09:00
Bill Currie 7ea12b3ff9 [gamecode] Implement the HOPS sub-instructions
In the end, I decided any/all/none should be separate from the other
horizontal ops, if I even do them (can be implemented by first
converting to bool, then using the appropriate horizontal operation (& |
etc).
2022-01-16 16:28:48 +09:00
Bill Currie 3587b13a40 [gamecode] Implement the conversion instructions
Not all possibilities are supported because converting between int and
uint, and long and ulong is essentially a no-op. However, thanks to
Deek's suggestion, not only are all reasonable conversions available,
conversions for all widths are available, so vector conversions are
supported.

The code for the conversions is generated.
2022-01-13 13:51:24 +09:00
Bill Currie 7d5c692313 [gamecode] Generate the new opcodes enum too
It turns out I'll be tweaking it more than I expected.
2022-01-09 01:04:51 +09:00
Bill Currie 0b92cd3a88 [gamecode] Generate the new opcode table
As I expect to be tweaking things for a while, it's part of the build
process. This will make it a lot easier to adjust mnemonics and argument
formats (tweaking the old table was a pain when conventions changed).

It's not quite done as it still needs arg widths and types.
2022-01-05 19:09:07 +09:00
Bill Currie 6d9c63999c [gamecode] Rename pr_opcode.c
Just to make way for new tables :)
2022-01-04 20:45:45 +09:00
Bill Currie bf604b99b3 [gamecode] Add automated tests for store ops
They even found a bug in the addressing mode functions :) (I'd forgotten
that I wanted signed offsets from the pointer and thus forgot to cast
st->b to short in order to get the sign extension)
2022-01-03 23:27:01 +09:00
Bill Currie 6d5ffa9f8e [build] Move to non-recursive make
There's still some cleanup to do, but everything seems to be working
nicely: `make -j` works, `make distcheck` passes. There is probably
plenty of bitrot in the package directories (RPM, debian), though.

The vc project files have been removed since those versions are way out
of date and quakeforge is pretty much dependent on gcc now anyway.

Most of the old Makefile.am files  are now Makemodule.am.  This should
allow for new Makefile.am files that allow local building (to be added
on an as-needed bases).  The current remaining Makefile.am files are for
standalone sub-projects.a

The installable bins are currently built in the top-level build
directory. This may change if the clutter gets to be too much.

While this does make a noticeable difference in build times, the main
reason for the switch was to take care of the growing dependency issues:
now it's possible to build tools for code generation (eg, using qfcc and
ruamoko programs for code-gen).
2020-06-25 11:35:37 +09:00