Commit graph

34 commits

Author SHA1 Message Date
Wolfgang Bumiller
2d4a054440 ir: fix generation of multi-op vinstrs
Do not assume that the destination is a temporary location,
as our peephole optimizer will break this. For example, the
following IR code (generated via from `x ^= gety()`):

    (0) binst6 <- BITXOR   x,      call5
    (0) x <- STORE_F       binst6

after peephole optimization becomes:

    (7) x <- BITXOR        x,      call5

Therefore we cannot assume that the output of the virtual
xor instruction can be utilized as a temporary value.

BITXOR becomes `(x | y) - (x & y)`, which would wrongly be
generated as:
    x = x | y;
    temp0 = x & y;
    x = x - temp0;

While this particular case can be fixed by using temp0 first
and then x, the cross-product case would not be so simple.

Signed-off-by: Wolfgang Bumiller <wry.git@bumiller.com>
Fixes #190
2019-09-15 10:23:47 +02:00
divVerent
9c81ff263a
Fix printing of floating poing values in -dumpfin.
%g is not lossless for single precision floats - %.9g is (other than distinguishing NaNs, who cares).
2019-02-04 06:14:58 -08:00
Dale Weiler
d9127bf28a
Merge pull request #180 from xonotic/mem_leak_fix_on_failure_paths
two small memory leak fixes on failure paths
2017-11-26 17:30:30 -05:00
Dale Weiler
fa7dce495b fix writing of globaldefs for vector subcomponents so that FTE field remapping works 2017-11-26 17:26:00 -05:00
Wolfgang Bumiller
3f5305af58 ir: fix vector negation using the nil value
We cannot use OFS_NULL as it is only a single value and
overlaps with OFS_RETURN.
2017-06-22 08:44:36 +02:00
David Carlier
8538658e83 two small memory leak fixes on failure paths 2017-05-23 21:56:03 +01:00
Wolfgang Bumiller
2dde6d903e c++: ir_function::m_params 2016-12-03 21:42:15 +01:00
Wolfgang Bumiller
4bf63bb379 c++: ir: function_allocator 2016-12-03 21:39:09 +01:00
Wolfgang Bumiller
95d232ca72 c++: ir_block::m_instr 2016-12-03 21:30:33 +01:00
Wolfgang Bumiller
90f190f5e1 c++: ir_block::m_exits 2016-12-03 20:34:42 +01:00
Wolfgang Bumiller
566c17a964 c++: ir_block::m_entries 2016-12-03 20:32:26 +01:00
Dale Weiler
a5636899f2 Cleaner way to set the mask for -Wunused-component 2016-11-24 19:54:17 +00:00
Dale Weiler
17c0812ae4 Just mark LOCAL_RETURN noref instead of checking for '#' in the name 2016-11-24 15:50:48 +00:00
Dale Weiler
3a7848d67c Remove parser m_uses in favor of {IR,AST}_FLAG_NOREF instead 2016-11-24 15:33:58 +00:00
Dale Weiler
def1a26b12 Add -Wunused-component like -Wunused-variable but warns about unused components of vector 2016-11-24 14:52:57 +00:00
Dale Weiler
eab20602b1 more intelligent handling of unused vector fields 2016-11-24 14:44:28 +00:00
Dale Weiler
9821b6a075 Fix fieldfuncs test and track unused variables through writes as well. 2016-11-19 12:19:00 +00:00
Wolfgang Bumiller
4c48bae203 Revert "Fix ent.vec.{x,y,z} writes"
This reverts commit ad1cfcfeaa.
2016-11-19 16:22:13 +01:00
Dale Weiler
ad1cfcfeaa Fix ent.vec.{x,y,z} writes 2016-11-19 10:42:33 +00:00
Wolfgang Bumiller
ee3c1e43c9 tempcommitting a whole bunch of to-c++ conversions 2015-05-02 09:48:24 +02:00
Wolfgang Bumiller
fab640da4c Merge branch 'cleanup' of git://github.com/graphitemaster/gmqcc into cleanup 2015-02-01 12:13:59 +01:00
Wolfgang Bumiller
66d908f39b ir_instr_delete_quick needs to clear _m_ops 2015-02-01 11:49:46 +01:00
Dale Weiler
fa21d85820 Same on the cleanup branch 2015-01-30 00:46:25 -05:00
Wolfgang Bumiller
9d98805dfb a whole lotta 'm_'s 2015-01-24 12:25:46 +01:00
Wolfgang Bumiller
e7d1e701c4 why didn't gcc catch that... 2015-01-24 10:26:43 +01:00
Wolfgang Bumiller
566e761546 more c++ migration for ast/ir/code; reached a working condition here 2015-01-20 20:25:56 +01:00
Wolfgang Bumiller
f09c6a5d63 temp committing major c++ification 2015-01-20 16:43:58 +01:00
Dale Weiler
76278e8b97 s/NULL/nullptr/ 2015-01-15 15:18:33 -05:00
Dale Weiler
fe95b28a35 More std::vector 2015-01-15 02:17:37 -05:00
Dale Weiler
317e0499f7 More std::vector 2015-01-15 01:57:40 -05:00
Dale Weiler
35a8c3c9af More std::vector migration 2015-01-15 01:22:21 -05:00
Dale Weiler
878195bdec Use C++ naming for structures 2015-01-15 00:05:48 -05:00
Dale Weiler
aabefd1bfe Use C++ naming for structures 2015-01-14 23:56:52 -05:00
Dale Weiler
65362d93aa .c -> .cpp 2015-01-14 21:48:47 -05:00
Renamed from ir.c (Browse further)