X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fgmqcc.git;a=blobdiff_plain;f=doc%2Fgmqcc.1;h=78d767e26f384ae38e8e7394a0a0d607c9f90a50;hp=66d2e4e4e14e3b50779e9f7f6bdb641c74ca1281;hb=5d8c18dcab931a740b6696811b889077aae2d15a;hpb=b7b60e74683ec62eb62e461f757448b3f1a78744 diff --git a/doc/gmqcc.1 b/doc/gmqcc.1 index 66d2e4e..78d767e 100644 --- a/doc/gmqcc.1 +++ b/doc/gmqcc.1 @@ -349,6 +349,10 @@ will search its intrinsics table for something that matches that function name by appending "__builtin_" to it. This behaviour may be unexpected, so enabling this will produce a diagnostic when such a function is resolved to a builtin. +.It Fl W Ns Cm inexact-compares +When comparing an inexact value such as `1.0/3.0' the result is +pathologically wrong. Enabling this will trigger a compiler warning +on such expressions. .El .Sh COMPILE FLAGS .Bl -tag -width Ds @@ -422,6 +426,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 @@ -587,6 +610,21 @@ 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. .El .Sh OPTIMIZATIONS .Bl -tag -width Ds