flatten the use of strcpy, 90% of the cases we already knew the length of the string either at compile-time, or already within the scope we where, thus letting us use strncpy, which can be further optimized (unrolled if static)
Dale Weiler [Thu, 21 Mar 2013 02:02:41 +0000 (02:02 +0000)]
Cross architecture stuff for distro build scripts. If you have an x86_64 capable system with a compiler and make (the OS doesn't even matter), simply changing to "distro" directory and typing "make" is sufficent to make archlinux i686/x86_64, and debian i686/x86_64 packages.
Dale Weiler [Sat, 9 Mar 2013 08:53:39 +0000 (08:53 +0000)]
Implemented smart intrinsic / builtin system. When you use trivial math functions like "pow", if they don't exist as a builtin, the compiler will implement its own versions, likewise, if a compiler builtin depends on a function that exists, it will use it, likewise if it doesn't it will implement it. If you explicitally use __builtin_ (prefixed) versions, the compiler again will select the best option it can, be it a combination of both builtins and compiler builtins, all compiler builtins, OR, all builtins (most performant).
Dale Weiler [Fri, 8 Mar 2013 09:17:54 +0000 (09:17 +0000)]
Implemented __builtin_mod, and % operator. Added floor builtin to the standalone executor. Mod works so long as the compiler can find a suitable definition of "float floor(float)", otherwise it prints a diagnostic and gives up (original id1 Quake had floor so we can depend on it).
Dale Weiler [Fri, 8 Mar 2013 08:01:45 +0000 (08:01 +0000)]
Implemented concept of enumeration attributes (can be further extended, but currently only "flag" is implemented as an attribute). An enumeration with a flag attribute will act as a "flagged enumeration", one that automatically handles exponentiation of the constants defined inside it, i.e enum : flag { A, B, C }, A,B,C will equal 2, 4, 8.
Dale Weiler [Thu, 7 Mar 2013 23:05:40 +0000 (23:05 +0000)]
Actually generate an ast_call for __builtin_pow for the ** operator, otherwise the operator yeilds a ast_function, making "a ** b" not work, but since it's a function, allows **(a, b). Also added tests for exponentiation operator.
Dale Weiler [Thu, 7 Mar 2013 21:31:19 +0000 (21:31 +0000)]
Implement exponentiation operator `**` as well as __builtin_pow (used for exponentiation operator). Use of exponentiation operator with constants results in const folded (precomputed at compile time exponentiation), otherwise runtime exponentiation with some clever loops (slow!).
Wolfgang Bumiller [Mon, 11 Feb 2013 10:37:39 +0000 (11:37 +0100)]
Lifetime analysis: Don't go through the blocks as a graph, instead, go through only the list.
The difference in code is rather small, but it's much faster.
Dale Weiler [Fri, 8 Feb 2013 12:06:59 +0000 (12:06 +0000)]
Cleanup cargocult directory and file specific things, to fs.c (renamed file.c which also contains directory handling stuff). Also cleaned up some stuff, and added proper end comments to conditional inclusion stuff.
Dale Weiler [Wed, 6 Feb 2013 09:09:47 +0000 (09:09 +0000)]
Fix alias bug. Implemented support for aliases of vectors (x, y, z components). Also made aliases corrector resident (e.g alias to vector foo, named bop, indexing bol_x [instead of bop_x] will result in a correction suggestion of bop_x now).