]> git.xonotic.org Git - xonotic/gmqcc.git/log
xonotic/gmqcc.git
11 years agoUpdated readme
Dale Weiler [Sun, 6 May 2012 20:58:30 +0000 (16:58 -0400)]
Updated readme

11 years agoMerge branch 'master' of github.com:graphitemaster/gmqcc
Dale Weiler [Sat, 5 May 2012 02:01:26 +0000 (22:01 -0400)]
Merge branch 'master' of github.com:graphitemaster/gmqcc

11 years agoutil_strncmpexact
Dale Weiler [Sat, 5 May 2012 02:01:02 +0000 (22:01 -0400)]
util_strncmpexact

11 years agoremoving ast-test macro concept
Wolfgang (Blub) Bumiller [Fri, 4 May 2012 11:04:06 +0000 (13:04 +0200)]
removing ast-test macro concept

11 years agoA new ast-test, now using some macros to make them easier to write...
Wolfgang (Blub) Bumiller [Fri, 4 May 2012 10:28:35 +0000 (12:28 +0200)]
A new ast-test, now using some macros to make them easier to write...

11 years agoFixed some dangling '}', it compiles again now
Wolfgang (Blub) Bumiller [Fri, 4 May 2012 10:26:24 +0000 (12:26 +0200)]
Fixed some dangling '}', it compiles again now

11 years agoWhat was I thinking... fixing loop's jump creation so it doesn't try creating multipl...
Wolfgang (Blub) Bumiller [Fri, 4 May 2012 10:24:44 +0000 (12:24 +0200)]
What was I thinking... fixing loop's jump creation so it doesn't try creating multiple jumps... this code is also much more readable

11 years agoast_loop must end by entering the outgoing block
Wolfgang (Blub) Bumiller [Fri, 4 May 2012 10:01:53 +0000 (12:01 +0200)]
ast_loop must end by entering the outgoing block

11 years agoChanging life-range calculation to include the last read because then it doesn't...
Wolfgang (Blub) Bumiller [Fri, 4 May 2012 08:20:04 +0000 (10:20 +0200)]
Changing life-range calculation to include the last read because then it doesn't need another vector to keep elements in. In order for this to make sense, the life-range overlap test now returns false if the end of one range _equals_ the beginning of the other, since that's not truly overlapping anymore

11 years agoMove the output block of a loop to after the loop, otherwise IR dumps looks just...
Wolfgang (Blub) Bumiller [Fri, 4 May 2012 08:01:38 +0000 (10:01 +0200)]
Move the output block of a loop to after the loop, otherwise IR dumps looks just messy... note that this is merely a cosmetic change

11 years agoMore assembly parsing (function call stuff)
Dale Weiler [Thu, 3 May 2012 23:45:59 +0000 (19:45 -0400)]
More assembly parsing (function call stuff)

11 years agoast_function gets 'breakblock' and 'continueblock' for break and continue support...
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 22:16:51 +0000 (00:16 +0200)]
ast_function gets 'breakblock' and 'continueblock' for break and continue support; fixed some typos; added huge ast_loop_codegen implementation... need to go through it and check

11 years agoMore assembler code (less allocations too)
Dale Weiler [Thu, 3 May 2012 20:54:34 +0000 (16:54 -0400)]
More assembler code (less allocations too)

11 years agoSame for ternary: reordered a bit, and fixing ontrue->onfalse at the jump back to...
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 20:07:58 +0000 (22:07 +0200)]
Same for ternary: reordered a bit, and fixing ontrue->onfalse at the jump back to the merge block

11 years agoreorder ifthen codegen and fix a jump generation where I used ontrue instead of onfalse
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 20:05:20 +0000 (22:05 +0200)]
reorder ifthen codegen and fix a jump generation where I used ontrue instead of onfalse

11 years agoast_loop - codegen dummied
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 19:57:13 +0000 (21:57 +0200)]
ast_loop - codegen dummied

11 years agoIf-protect on_true and on_false in ast_ifthen since they can be NULL (contrary to...
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 19:56:05 +0000 (21:56 +0200)]
If-protect on_true and on_false in ast_ifthen since they can be NULL (contrary to ast_ternary where they can't)

11 years agoRemoving TODO-comment since it's done
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 16:38:29 +0000 (18:38 +0200)]
Removing TODO-comment since it's done

11 years agoDump should print a warning if lifepasses don't match...
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 12:17:00 +0000 (14:17 +0200)]
Dump should print a warning if lifepasses don't match...

11 years agoast_function_codegen: Add a return instruction if it is missing, or error if we're...
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 12:15:02 +0000 (14:15 +0200)]
ast_function_codegen: Add a return instruction if it is missing, or error if we're not in a void-function

11 years agoast-test should also finalize functions directly
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 12:04:35 +0000 (14:04 +0200)]
ast-test should also finalize functions directly

11 years agonaive_phi now recognizes both store_local and store_value as non-global, create_store...
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 12:01:56 +0000 (14:01 +0200)]
naive_phi now recognizes both store_local and store_value as non-global, create_store prints the operand names on an invalid store to a value of store-type store_value

11 years agoir-test.c to use assertions, abort alone creates an ugly output
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 12:00:38 +0000 (14:00 +0200)]
ir-test.c to use assertions, abort alone creates an ugly output

11 years agosprintf with length modifiers is annoying...
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 11:45:24 +0000 (13:45 +0200)]
sprintf with length modifiers is annoying...

11 years agoast_test to build an IR
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 11:26:49 +0000 (13:26 +0200)]
ast_test to build an IR

11 years agoast_ternary_codegen - beware, it's almost a spaghetti... almost...
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 11:02:29 +0000 (13:02 +0200)]
ast_ternary_codegen - beware, it's almost a spaghetti... almost...

11 years agoast_function_label now takes a labelname to prefix the id with
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 10:40:49 +0000 (12:40 +0200)]
ast_function_label now takes a labelname to prefix the id with

11 years agoast_ifthen_codegen
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 10:38:43 +0000 (12:38 +0200)]
ast_ifthen_codegen

11 years agoast_entfield_codegen
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 10:19:33 +0000 (12:19 +0200)]
ast_entfield_codegen

11 years agoType information moved to ast_expression from ast_value, every ast node should in...
Wolfgang (Blub) Bumiller [Thu, 3 May 2012 10:12:22 +0000 (12:12 +0200)]
Type information moved to ast_expression from ast_value, every ast node should in theory know its type - it is important for dereferencing pointers or entity fields, to figure out the output type. Eg. so that ast_entfield knows what kind of OP_LOAD it needs to use

11 years agoTrailing whitespace was imminent, pending editor configuration change to accomodate...
Dale Weiler [Wed, 2 May 2012 22:03:17 +0000 (18:03 -0400)]
Trailing whitespace was imminent, pending editor configuration change to accomodate insanity.

11 years agosupress attribute warnings
Dale Weiler [Wed, 2 May 2012 21:57:45 +0000 (17:57 -0400)]
supress attribute warnings

11 years agoMerge remote-tracking branch 'origin/ast-and-ir'
Dale Weiler [Wed, 2 May 2012 21:46:21 +0000 (17:46 -0400)]
Merge remote-tracking branch 'origin/ast-and-ir'

11 years agoast_binary_codegen, ast_function_label (no I don't like sprintf...)
Wolfgang (Blub) Bumiller [Wed, 2 May 2012 21:11:39 +0000 (23:11 +0200)]
ast_binary_codegen, ast_function_label (no I don't like sprintf...)

11 years agoMerge branch 'master' into ast-and-ir
Dale Weiler [Wed, 2 May 2012 19:50:50 +0000 (15:50 -0400)]
Merge branch 'master' into ast-and-ir

11 years agoargsize parsing for assembler
Dale Weiler [Wed, 2 May 2012 19:48:00 +0000 (15:48 -0400)]
argsize parsing for assembler

11 years agoast_store_codegen and its l/rvalue handling
Wolfgang (Blub) Bumiller [Wed, 2 May 2012 18:36:11 +0000 (20:36 +0200)]
ast_store_codegen and its l/rvalue handling

11 years agoA note to clarify the ast_block/ir_block difference
Wolfgang (Blub) Bumiller [Wed, 2 May 2012 17:46:27 +0000 (19:46 +0200)]
A note to clarify the ast_block/ir_block difference

11 years agoast_block_codegen - as you can see, an ast_block doesn't actually care about ir_blocks
Wolfgang (Blub) Bumiller [Wed, 2 May 2012 17:45:16 +0000 (19:45 +0200)]
ast_block_codegen - as you can see, an ast_block doesn't actually care about ir_blocks

11 years agocreate the ir_function in ast_function_codegen, keep the current ir_block stored...
Wolfgang (Blub) Bumiller [Wed, 2 May 2012 17:25:25 +0000 (19:25 +0200)]
create the ir_function in ast_function_codegen, keep the current ir_block stored in ast_function so inner codegens can use it

11 years agogoing through function blocks in ast_function_codegen
Wolfgang (Blub) Bumiller [Wed, 2 May 2012 17:21:25 +0000 (19:21 +0200)]
going through function blocks in ast_function_codegen

11 years agoast_local/global_codegen exposed through the header for now
Wolfgang (Blub) Bumiller [Wed, 2 May 2012 16:36:11 +0000 (18:36 +0200)]
ast_local/global_codegen exposed through the header for now

11 years agoast_local_codegen - similar structure to global_codegen obviously...
Wolfgang (Blub) Bumiller [Wed, 2 May 2012 16:34:24 +0000 (18:34 +0200)]
ast_local_codegen - similar structure to global_codegen obviously...

11 years agofor ast_value_codegen this should be enough, since the actual generation happens...
Wolfgang (Blub) Bumiller [Wed, 2 May 2012 16:25:59 +0000 (18:25 +0200)]
for ast_value_codegen this should be enough, since the actual generation happens in other functions

11 years agoMore function parsing for assembler
Dale Weiler [Wed, 2 May 2012 15:48:46 +0000 (11:48 -0400)]
More function parsing for assembler

11 years agoassembly statement operand parsing. Now all we need is tables and state to generate...
Dale Weiler [Wed, 2 May 2012 00:36:37 +0000 (20:36 -0400)]
assembly statement operand parsing.  Now all we need is tables and state to generate some valid code.

11 years agotest.qs update
Dale Weiler [Tue, 1 May 2012 22:05:41 +0000 (18:05 -0400)]
test.qs update

11 years agoAssembly statement parsing
Dale Weiler [Tue, 1 May 2012 22:05:11 +0000 (18:05 -0400)]
Assembly statement parsing

11 years agoFunction parsing for the assembler now works, and adds the function to the function...
Dale Weiler [Tue, 1 May 2012 20:42:11 +0000 (16:42 -0400)]
Function parsing for the assembler now works, and adds the function to the function table for the code writer, quake and darkplaces can see it as well (since a def is also created)

11 years agoast_ternary - contrary to ast_ifthen neither ontrue nor onfalse can be NULL, and...
Wolfgang Bumiller [Tue, 1 May 2012 15:02:45 +0000 (17:02 +0200)]
ast_ternary - contrary to ast_ifthen neither ontrue nor onfalse can be NULL, and it does output a value

11 years agoif-then-else AST node - this one is not for ternary expressions
Wolfgang Bumiller [Tue, 1 May 2012 14:55:02 +0000 (16:55 +0200)]
if-then-else AST node - this one is not for ternary expressions

11 years agoRemove 2 unused variables in create_binop - unused since create_general_instruction
Wolfgang Bumiller [Tue, 1 May 2012 14:45:15 +0000 (16:45 +0200)]
Remove 2 unused variables in create_binop - unused since create_general_instruction

11 years agoFix missing 'int op;' in load_from_end, accidently removed it together with the other...
Wolfgang Bumiller [Tue, 1 May 2012 14:44:36 +0000 (16:44 +0200)]
Fix missing 'int op;' in load_from_end, accidently removed it together with the other vars whil making it use general_instruction

11 years agoComment about the form of instruction general_instr is used for
Wolfgang Bumiller [Tue, 1 May 2012 14:29:29 +0000 (16:29 +0200)]
Comment about the form of instruction general_instr is used for

11 years agocreate_phi -> store_value, not store_local... phi output cannot be overwritten
Wolfgang Bumiller [Tue, 1 May 2012 14:27:36 +0000 (16:27 +0200)]
create_phi -> store_value, not store_local... phi output cannot be overwritten

11 years agoReuse general_instr to shorten create_binop
Wolfgang Bumiller [Tue, 1 May 2012 14:26:25 +0000 (16:26 +0200)]
Reuse general_instr to shorten create_binop

11 years agoexpose create_general_instr in ir.h for now...
Wolfgang Bumiller [Tue, 1 May 2012 14:24:16 +0000 (16:24 +0200)]
expose create_general_instr in ir.h for now...

11 years agoGet rid of duplicate code by adding an ir_block_create_general_instr
Wolfgang Bumiller [Tue, 1 May 2012 14:23:45 +0000 (16:23 +0200)]
Get rid of duplicate code by adding an ir_block_create_general_instr

11 years agoir_block_create_fieldaddress - and fixing operand-numbering in load_from_ent
Wolfgang Bumiller [Tue, 1 May 2012 14:20:44 +0000 (16:20 +0200)]
ir_block_create_fieldaddress - and fixing operand-numbering in load_from_ent

11 years agoCommenting on future lvalue use in ast_store
Wolfgang Bumiller [Tue, 1 May 2012 13:15:19 +0000 (15:15 +0200)]
Commenting on future lvalue use in ast_store

11 years agocodegen gets an lvalue flag now
Wolfgang Bumiller [Tue, 1 May 2012 13:14:44 +0000 (15:14 +0200)]
codegen gets an lvalue flag now

11 years agoast_instantiate should check return value of mem_a and return NULL on error
Wolfgang Bumiller [Tue, 1 May 2012 13:09:17 +0000 (15:09 +0200)]
ast_instantiate should check return value of mem_a and return NULL on error

11 years agoast_entfield node
Wolfgang Bumiller [Tue, 1 May 2012 13:08:54 +0000 (15:08 +0200)]
ast_entfield node

11 years agoalignment fix
Wolfgang Bumiller [Tue, 1 May 2012 10:43:10 +0000 (12:43 +0200)]
alignment fix

11 years agoImplementation of liferange overlap test
Wolfgang Bumiller [Tue, 1 May 2012 10:40:37 +0000 (12:40 +0200)]
Implementation of liferange overlap test

11 years agoCheck for TYPE_FIELD in load_from_ent
Wolfgang Bumiller [Tue, 1 May 2012 10:14:07 +0000 (12:14 +0200)]
Check for TYPE_FIELD in load_from_ent

11 years agostyle fix
Wolfgang Bumiller [Tue, 1 May 2012 10:13:04 +0000 (12:13 +0200)]
style fix

11 years agoir_block_create_load_from_ent - long name, I know, but we need to be able to load...
Wolfgang Bumiller [Tue, 1 May 2012 10:12:53 +0000 (12:12 +0200)]
ir_block_create_load_from_ent - long name, I know, but we need to be able to load from pointers too at some point...

11 years agosupport TYPE_FIELD in stores; storeP to do a different kind of type checking
Wolfgang Bumiller [Tue, 1 May 2012 10:05:47 +0000 (12:05 +0200)]
support TYPE_FIELD in stores; storeP to do a different kind of type checking

11 years agoir_block_create_storep for storing through pointers, the IR does not implicitly creat...
Wolfgang Bumiller [Tue, 1 May 2012 09:58:52 +0000 (11:58 +0200)]
ir_block_create_storep for storing through pointers, the IR does not implicitly create conversions for now when using pointers, but it could

11 years agoVECTOR_PROT
Dale Weiler [Sun, 29 Apr 2012 23:08:20 +0000 (19:08 -0400)]
VECTOR_PROT

11 years agoParse vector constants and add them to the constants table now for the assembler.
Dale Weiler [Sun, 29 Apr 2012 23:03:06 +0000 (19:03 -0400)]
Parse vector constants and add them to the constants table now for the assembler.

11 years agoInvoke tests
Dale Weiler [Sun, 29 Apr 2012 21:28:01 +0000 (17:28 -0400)]
Invoke tests

11 years agoadded test_ast, test_ir, and test, as well as default, and all to the Makefile target...
Dale Weiler [Sun, 29 Apr 2012 20:54:05 +0000 (16:54 -0400)]
added test_ast, test_ir, and test, as well as default, and all to the Makefile target list. Also made all tests C90 conformant code.

11 years agoMerge branch 'master' into ast-and-ir
Dale Weiler [Sun, 29 Apr 2012 20:39:43 +0000 (16:39 -0400)]
Merge branch 'master' into ast-and-ir

11 years agoRemove Makefile_win (useless)
Dale Weiler [Sun, 29 Apr 2012 20:38:38 +0000 (16:38 -0400)]
Remove Makefile_win (useless)

11 years agoparams should be deleted, not unref()d
Wolfgang Bumiller [Sun, 29 Apr 2012 17:45:14 +0000 (19:45 +0200)]
params should be deleted, not unref()d

11 years ago64bit signed/unsigned integer support from the compiler if LONG_MAX != 0x7FFFFFFF
Dale Weiler [Sun, 29 Apr 2012 16:09:30 +0000 (12:09 -0400)]
64bit signed/unsigned integer support from the compiler if LONG_MAX != 0x7FFFFFFF

11 years agoRemove trailing whitespace
Dale Weiler [Sat, 28 Apr 2012 23:03:16 +0000 (19:03 -0400)]
Remove trailing whitespace

11 years agoAfter moving ast_instantiate up, the checks which return NULL now must mem_d(self)
Wolfgang Bumiller [Sat, 28 Apr 2012 22:41:35 +0000 (00:41 +0200)]
After moving ast_instantiate up, the checks which return NULL now must mem_d(self)

11 years agoFix macro spacing
Dale Weiler [Sat, 28 Apr 2012 22:56:44 +0000 (18:56 -0400)]
Fix macro spacing

11 years agoAll code is now C89/C90 compat
Dale Weiler [Sat, 28 Apr 2012 22:56:09 +0000 (18:56 -0400)]
All code is now C89/C90 compat

11 years agoMerge branch 'master' into ast-and-ir
Dale Weiler [Sat, 28 Apr 2012 20:45:02 +0000 (16:45 -0400)]
Merge branch 'master' into ast-and-ir

11 years agoRemove trailing whitespace from everything
Dale Weiler [Sat, 28 Apr 2012 20:43:39 +0000 (16:43 -0400)]
Remove trailing whitespace from everything

11 years agogitattributes for whitespace
Dale Weiler [Sat, 28 Apr 2012 20:40:03 +0000 (16:40 -0400)]
gitattributes for whitespace

11 years agolex.c -> lex_init s/lex->line = 0/lex->line = 1/
Dale Weiler [Sat, 28 Apr 2012 20:31:30 +0000 (16:31 -0400)]
lex.c -> lex_init s/lex->line = 0/lex->line = 1/

11 years agoThis should fix line counting issues with the lexer
Dale Weiler [Sat, 28 Apr 2012 20:30:44 +0000 (16:30 -0400)]
This should fix line counting issues with the lexer

11 years agoLexer fixes
Dale Weiler [Sat, 28 Apr 2012 20:25:43 +0000 (16:25 -0400)]
Lexer fixes

11 years agoast and ir testers - to use: compile into gmqcc and execut the functions in main()
Wolfgang Bumiller [Sat, 28 Apr 2012 19:42:12 +0000 (21:42 +0200)]
ast and ir testers - to use: compile into gmqcc and execut the functions in main()

11 years agoparam_argument cleanup
Dale Weiler [Sat, 28 Apr 2012 19:36:39 +0000 (15:36 -0400)]
param_argument cleanup

11 years agoparam_argument cleanup
Dale Weiler [Sat, 28 Apr 2012 19:20:13 +0000 (15:20 -0400)]
param_argument cleanup

11 years agoDo not force -[aci] parameters' arguments to be in the same argv; (Allow 'gmqcc ...
Wolfgang Bumiller [Sat, 28 Apr 2012 12:32:52 +0000 (14:32 +0200)]
Do not force -[aci] parameters' arguments to be in the same argv; (Allow 'gmqcc -c foo' to act like 'gmqcc -cfoo'

11 years agoast_function gets a handle to its ir_function, ast_global_codegen to generate an...
Wolfgang Bumiller [Sat, 28 Apr 2012 16:54:27 +0000 (18:54 +0200)]
ast_function gets a handle to its ir_function, ast_global_codegen to generate an ir global, or an ir_function

11 years agoFirst delete the blocks, THEN the locals, since blocks USE locals, darn
Wolfgang Bumiller [Sat, 28 Apr 2012 15:29:43 +0000 (17:29 +0200)]
First delete the blocks, THEN the locals, since blocks USE locals, darn

11 years agoast_binary takes 2 expressions, not 2 values, ast_store takes a value and and express...
Wolfgang Bumiller [Sat, 28 Apr 2012 15:27:06 +0000 (17:27 +0200)]
ast_binary takes 2 expressions, not 2 values, ast_store takes a value and and expression for now until we support pointers, also: dropped the 'keep' param from ast_value_new, values are always to be stored somewhere to be deleted independently from their uses

11 years agoast_value and ast_function are linked together when using ast_function_new, note...
Wolfgang Bumiller [Sat, 28 Apr 2012 13:57:19 +0000 (15:57 +0200)]
ast_value and ast_function are linked together when using ast_function_new, note however, that neither will delete the other in their _delete functions.

11 years agosurpress empty bodies
Dale Weiler [Sat, 28 Apr 2012 19:13:41 +0000 (15:13 -0400)]
surpress empty bodies

11 years agovector parsing for assembly
Dale Weiler [Sat, 28 Apr 2012 11:27:03 +0000 (07:27 -0400)]
vector parsing for assembly

11 years agoGet rid of ast_setfunc
Wolfgang Bumiller [Sat, 28 Apr 2012 10:51:44 +0000 (12:51 +0200)]
Get rid of ast_setfunc

11 years agoCut at comma
Dale Weiler [Sat, 28 Apr 2012 10:35:42 +0000 (06:35 -0400)]
Cut at comma