Commit graph

20 commits

Author SHA1 Message Date
Dale Weiler
80adfebd23 Implement isinf intrinsic 2013-11-23 10:16:48 -05:00
Dale Weiler
e2bfaf8109 Implemented exp2 intrinsic 2013-11-23 07:37:26 -05:00
Dale Weiler
c68a5c29e1 Simplify 2013-11-23 07:27:09 -05:00
Dale Weiler
11f79bb1a6 Use '#' in nullfun identifier to prevent it from being used in code 2013-11-23 07:25:24 -05:00
Dale Weiler
54f331a64a Fix intrinsics for self-inclusion of other intrinsics. 2013-11-23 07:21:12 -05:00
Dale Weiler
d9572e3e30 Fixed pow/exp using fast approximation until the fractional part is hit. Once fractional is reached a binary search is used to get close to the value. 2013-11-23 06:40:27 -05:00
Dale Weiler
ae9d3d42cf A better mod implementation 2013-11-23 03:53:07 -05:00
Dale Weiler
8699053887 Fix handling on intrinsic folding, this closes #118. 2013-10-17 00:14:42 -04:00
Dale Weiler
50d165e173 Some intrinsic code cleanup. The args check is handled anyways in the parser. We use a generated array alongside to prevent generating the intrinsic multiple times instead of using static storage. Other various cleanups as well. 2013-10-16 00:04:39 -04:00
Dale Weiler
263fcfbc2f Refactor intrinsic stuff 2013-10-02 13:00:34 -04:00
Dale Weiler
98cb23ca63 Logic elsewhere handles this (no need to duplicate) 2013-08-30 07:23:15 -04:00
Dale Weiler
a50635bcd7 intrinsic folding cleanups (and improvements.) 2013-08-30 07:12:16 -04:00
Dale Weiler
a7c1f6f021 Implement [[eraseable]] attribute. When used with a function it instructs the AST (which than transfers logic to the IR) that the function (or variable) is potentially unused (verified by checking the read count). This than propogates through the IR and prevents the IR from generating both the definition and global/function. The intrinsics system uses this as well to prevent intrinsic functions from being generated unless they're used. 2013-08-29 00:05:37 -04:00
Dale Weiler
3b4a5667ea Constant fold intrinsics if their arguments are constant. TODO: reference count intrinsics such that they're not generated unless they're used, currently when an intrinsic can be folded-away it's marked for generation and makes it to the final output binary even though it isn't used. 2013-08-28 12:46:22 -04:00
Dale Weiler
bbe4927a20 Implemented a __builtin_fabs intrinsic. 2013-08-28 11:28:27 -04:00
Dale Weiler
c64005966f Remove some trailing whitespace 2013-08-17 23:43:41 +00:00
Dale Weiler
772dbfae26 Make it compile in visual studio again, without warnings. 2013-08-16 09:03:36 +00:00
Dale Weiler
73d9aa29c4 Made intrinsics seperate from the parser. 2013-08-14 06:02:15 +00:00
Dale Weiler
965f8b9041 Uh wrong file. 2013-03-09 08:57:37 +00:00
Dale Weiler
cbeac3e5f2 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). 2013-03-09 08:53:39 +00:00