Commit graph

91 commits

Author SHA1 Message Date
Bill Currie
bbc97079e0 pr_comp.h:
define PROG_ID_VERSION as 6 and redefine PROG_VERSION as 0x00fff001
	(0.fff.001) for the new qc features.
pr_edict.c:
	support version 6 and version 0.fff.001 progs
qfcc.h:
	add version field to options_t
	add min_version field to opcode_t
pr_opcode.c:
	set the minumum version of each opcode (gee, that table is getting ugly)
	filter out opcodes with too high a min_version when initializing the opcode
	hash tables.
qfcc.c:
	update help output.
	accept --id to limit code generation to id compatable (ver 6) progs.
	default progs generation to 0.fff.001
2001-06-09 06:25:33 +00:00
Bill Currie
e61884fefb add a test for initialized locals 2001-06-08 22:54:34 +00:00
Bill Currie
0186732130 make initialized local variables work /properly/
local float urk = 0;
STORE_F    46(IMMEDIATE)  0.0   55(?)
2001-06-08 20:13:10 +00:00
Bill Currie
7ef4c2776e Immidiate sharing now /works/ (shaved off two pr_globals from CustomTF, too:).
Detect assignments to initialized globals and give an error, unless the --cow
(copy on write) option is given, and then allocate a new global for the var,
clear its initialized flag.
Relocate all globals.
2001-06-08 06:32:15 +00:00
Bill Currie
8656eb998a add ChangeLog 2001-06-08 00:18:53 +00:00
Bill Currie
ef99ad24b0 const merge testing. qfcc is currently borked in that dept. 2001-06-08 00:14:11 +00:00
Bill Currie
bddf7069a2 might as well return the result of the main in the progs 2001-06-06 21:30:58 +00:00
Bill Currie
e349ed3013 implement file io for qwaq (and cat in qc }:> ) 2001-06-06 20:05:08 +00:00
Bill Currie
3d566d47e3 more testing 2001-06-06 00:38:24 +00:00
Bill Currie
867260d27d report the size of the locals pool 2001-06-06 00:34:35 +00:00
Bill Currie
c3cdfce12b don't bother writing out local defs as they mess up progs dumping now that
they overlap
2001-06-06 00:12:10 +00:00
Bill Currie
1e6d69e2be main.c:
allow dumping to work with entities
main.qc:
	more tests
2001-06-05 23:53:55 +00:00
Bill Currie
d86ed9a3b9 relocate the locals defs as well as their references 2001-06-05 23:52:34 +00:00
Bill Currie
bbb37d0080 customTF is now down to 4989 pr_globals. all parameters, local veriables and
termporary variables sit in one pool of memory (at the end of the globals)
thus drasticly reducing globals requirements. This works because the whole
lot is declared to be in the function's local variable space which is copied
to the locals stack in the progs engine.
2001-06-05 08:09:12 +00:00
Bill Currie
a26f799de4 allocate temps based on size rather than type (get better re-usage this way)
put temps onto the local scope.
2001-06-05 05:22:11 +00:00
Bill Currie
17e19f3892 regain about 5000 globals for customTF, but this fixes possible breakage with
premature temp var re-usage (ie, it puts the temps back into the locals space).
2001-06-04 22:35:54 +00:00
Bill Currie
55d58f8d46 ignore .vimrc 2001-06-04 18:33:50 +00:00
Bill Currie
42c880ab8a formatting cleanup 2001-06-04 18:33:32 +00:00
Bill Currie
1b930b73d1 execute qfcc on completion for that one stop shopping experience 2001-06-04 18:20:14 +00:00
Bill Currie
e090f3c9e3 do proper temp def handling so we don'e use any where near as many defs for
temporary variables (customTF went from 35941 to 12587 pr_globals).
2001-06-04 17:52:50 +00:00
Bill Currie
53e9fb65d1 prepare PR_Statement for proper temporary usage 2001-06-04 05:45:51 +00:00
Bill Currie
e339e82c01 hash.h is now const correct as is a lot of qfcc 2001-06-04 04:52:14 +00:00
Bill Currie
4aa47d728a use the correct STORE_ op for function arges, rather than STORE_V. Should
speed up progs in general.
2001-06-04 03:57:15 +00:00
Bill Currie
275e74161b string comparison operators 2001-06-04 03:36:35 +00:00
Bill Currie
7178824ee6 put ADD_S up where it belongs :) 2001-06-04 02:49:59 +00:00
Bill Currie
ddcd172a03 re-write the opcode selection to be a hash table lookup and statment generation
to get the opcode from the table record rather than the location within the
table (ewww). gives a nice speed boost /and/ makes the opcode table easier to
maintain.
2001-06-04 02:41:45 +00:00
Bill Currie
09118bc01e pr_comp.h:
add OP_ADD_S. WARNING!!! this /will/ move.
progs.h:
	add prototype for PR_PrintStatement
pr_edict.c:
	add OP_ADD_S support in the progs checker
pr_exec.c:
	implement OP_ADD_S
tools/qfcc/include/.gitignore:
	add config.h.in
qfcc.h:
	nuke PR_NameImmediate and change PR_ParseImmediate's prototype (see
	pr_imm.c)
pr_comp.c:
	add ADD_S, adjust for PR_ParseImmediate's prototype, make
	PR_ParseExpression work with non-sequential opcodes (slow, will work on
	that next). Fix up initialised global parsing.
pr_imm.c:
	nuke PR_NameImmediate. didn't work well and wasn't such a good idea anyway.
	PR_ParseImmediate now accepts a def_t * arg. if null, will allocate a
	new global def, otherwise it will initialize the def passed in.
qwaq/main.c:
	sports some debugging code (dumps info about the progs it's running)
qwaq/main.qc:
	better ADD_S testing
2001-06-03 17:36:49 +00:00
Jeff Teunissen
b60efa59f4 Bunch of changes. Project has been almost completely rewritten, and now
compiles. The rest are just the results of a simple conversion script I
wrote.
2001-06-03 04:52:36 +00:00
Bill Currie
297f7c0567 this shouldn't be here 2001-06-02 05:23:00 +00:00
Bill Currie
25b02984b8 fix nested else statements 2001-06-02 03:37:06 +00:00
Bill Currie
02003cf229 build the progs automaticly 2001-06-01 22:05:36 +00:00
Bill Currie
6c0791e4f4 d'oh 2001-06-01 22:00:35 +00:00
Bill Currie
e3e4915c03 s/qctest/qwaq/ and update .gitignore 2001-06-01 21:59:46 +00:00
Bill Currie
8a23ae0a48 stand alone qc interpreter. So I'm on some serious qwaq :) (actuallly, its
main purpose is language extention testing)
2001-06-01 21:57:59 +00:00
Bill Currie
351e70b3bd replace a missing / when producing files.dat 2001-05-22 18:23:29 +00:00
Jeff Teunissen
ef5fd0ed6d New Preferences class -- it may not seem like it, but this is a Big
Deal. :)
2001-05-08 08:38:34 +00:00
Bill Currie
461ce64685 white space 2001-05-07 21:10:45 +00:00
Bill Currie
1205401b38 Finally, a preqcc with source :) Seems to work ok, but it's far from
complete. It does, however, build customTF without any appearent problems.
2001-05-07 20:53:50 +00:00
Jeff Teunissen
e943e13eb2 Autoconf support for Forge. It's incomplete, but it's mostly working. 2001-05-07 09:44:17 +00:00
Jeff Teunissen
a45dd9b289 Forge: Map and PopScrollView build now. 2001-05-07 09:43:25 +00:00
Bill Currie
fa3851b11f ignore the results of building mingw in here 2001-04-11 03:39:32 +00:00
Bill Currie
659eb45e96 tools to help with cross copiling QF under mingw in linux 2001-04-10 23:31:50 +00:00
Bill Currie
2f2ba28bb7 pr_lex.c:
rewrite PR_LexPunctuation to avoid looping. 6x speedup for that function
	according to gprof on customTF
configure.in:
	--enable-profile
2001-04-03 16:50:31 +00:00
Bill Currie
f896506835 heh, seem to have forgotten this 2001-04-02 21:30:16 +00:00
Bill Currie
b7aba0b643 allow named constants to be checked for immediate constants. qfcc now produces
the same number of globals etc as it used to
2001-04-02 18:43:10 +00:00
Bill Currie
f517dc6ce6 fix a silly bug and an incorrect interpretation of the old code 2001-04-02 18:10:43 +00:00
Bill Currie
02b09f4e5c no more redundant strings. costs ~7ms, though, but HALVING the strofs size
in frikbot seems worth it.
2001-04-01 06:40:51 +00:00
Bill Currie
59e55834ed Another massive speadup caused by using hash tables to lookup already
generated immediate values. frikbot now compiles in just over 1s on my
machine.
2001-04-01 06:01:02 +00:00
Bill Currie
43ea8f4fc0 Rip out I_FloatTime from cmdlib.
Use Sys_DoubleTime instead of I_FloatTime and print out ms for compilation
2001-04-01 03:33:11 +00:00
Bill Currie
ec16ffaa65 move to using hash tables for variable lookups.
WARNING: this fixes a scope bug in qcc and thus you WILL get different (but
now correct) code for the following:

float foo;

void () bar =
{
	local float foo;
	foo = 0;
}

ie, the local foo will, as is correct, now be a separate var to the global
foo.
2001-04-01 02:12:57 +00:00