X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=doc%2Fgmqcc.1;h=f392cc3e1357060e6f7491fd8158b5e99f19a4a9;hb=092067482fddeccf1b3e42ff09a046f6555cd11e;hp=e88acd9882f33134845987a3e6ac4faf525886a6;hpb=6424ebaf98262bfd65a48b644b57fdf99b7866a9;p=xonotic%2Fgmqcc.git diff --git a/doc/gmqcc.1 b/doc/gmqcc.1 index e88acd9..f392cc3 100644 --- a/doc/gmqcc.1 +++ b/doc/gmqcc.1 @@ -168,6 +168,11 @@ DEBUG OPTION. Print the code's intermediate representation after the optimization and finalization passes to stdout before generating the binary. The instructions will be enumerated, and values will contain a list of liferanges. +.It Fl force-crc= Ns Ar CRC +Force the produced progs file to use the specified CRC. +.It Fl state-fps= Ns Ar NUM +Activate \-femulate-state and set the emulated FPS to +.Ar NUM Ns . .El .Sh COMPILE WARNINGS .Bl -tag -width Ds @@ -181,6 +186,9 @@ variables can be opened using .Ql #pragma noref 1 and closed via .Ql #pragma noref 0 Ns . +.It Fl W Ns Cm unused-component +Generate a warning about vector variables which are declared but not all their +components are used. .It Fl W Ns Cm used-uninitialized Generate a warning if it is possible that a variable can be used without prior initialization. Note that this warning is not @@ -421,6 +429,25 @@ M_SQRT2 M_SQRT1_2 M_TAU .Ed +.It Fl f Ns Cm ftepp-indirect-expansion +Enable indirect macro expansion. This only works in combination +with '-fftepp' and is currently not included by '-std=fteqcc'. +Enabling this behavior will allow the preprocessor to operate more +like the standard C preprocessor in that it will allow arguments +of macros which are macro-expanded to be substituted into the +definition of the macro. +.Pp +As an example: +.Bd -literal -offset indent +#define STR1(x) #x +#define STR2(x) STR1(x) +#define THE_ANSWER 42 +#define THE_ANSWER_STR STR2(THE_ANSWER) /* "42" */ + +.Ed +With this enabled, an expansion of THE_ANSWER_STR will yield +the string "42". With this disabled an expansion of THE_ANSWER_STR +will yield "THE_ANSWER" .It Fl f Ns Cm relaxed-switch Allow switch cases to use non constant variables. .It Fl f Ns Cm short-logic @@ -581,6 +608,33 @@ breaks decompilers, but causes the output file to be better compressible. In commutative instructions, always put the lower-numbered operand first. This shaves off 1 byte of entropy from all these instructions, reducing compressed size of the output file. +.It Fl f Ns Cm emulate-state +Emulate OP_STATE operations in code rather than using the instruction. +The desired fps can be set via -state-fps=NUM, defaults to 10. +Specifying \-state-fps implicitly sets this flag. Defaults to off in all +standards. +.It Fl f Ns Cm arithmetic-exceptions +Turn on arithmetic exception tests in the compiler. In constant expressions +which trigger exceptions like division by zero, overflow, underflow, etc, +the following flag will produce diagnostics for what triggered that +exception. +.It Fl f Ns Cm split-vector-parameters +With this flag immediate vector literals which only ever appear as function +parameters won't be stored as vector immediates. Instead, the 3 floats making +up the vector will be copied separately. Essentially this turns a vector-store +instruction into 3 float-store instructions for such cases. This increases +code size but can dramatically reduce the amount of vector globals, which is +after all limited to 64k. There's at least one known codebase where this +lowers the number of globals from over 80k down to around 3k. In other code +bases it doesn't reduce the globals at all but only increases code size. +Just try it and see whether it helps you. +.It Fl f Ns Cm default-eraseable +Force all expressions to be "eraseable" which permits the compiler to +remove unused functions, variables and statements. This is equivlant to +putting [[eraseable]] on all definitions. This is dangerous as it breaks +auto cvars, definitions for functions the engine may be looking for and +translatable strings. Instead, you can mark a definition with [[noerase]] +to prevent this from happening. .El .Sh OPTIMIZATIONS .Bl -tag -width Ds