- Now that state jumps are handled by returning a state, we still need a
way for them to jump to a NULL state. If the parameter processed by this
macro turns out to be NULL, Actor's 'Null' state will be substituted
instead, since that's something that can be jumped to.
- The A_Jump family of action functions now return the state to jump
to (NULL if no jump is to be taken) instead of jumping directly.
It is the caller's responsibility to handle the jump. This will
make it possible to use their results in if statements and
do something other than jump.
- DECORATE return statements can now return the result of a function
(but not any random expression--it must be a function call). To
make a jump happen from inside a multi-action block, you must
return the value of an A_Jump function. e.g.:
{ return A_Jump(128, "SomeState"); }
- The VMFunction class now contains its prototype instead of storing
it at a higher level in PFunction. This is so that
FState::CallAction can easily tell if a function returns a state.
- Removed the FxTailable class because with explicit return
statements, it's not useful anymore.
Converting a floating point value that is out of range for a signed integer will result in 0x80000000 with SSE math, which is used exclusively for this purpose on modern Visual C++ compilers, so this cannot be used anywhere.
On ARM there's problems with float to unsigned int conversions.
xs_Float does not depend on these
- I kept getting confused trying to read these instructions, so now their
disassembly looks more MIPS-like:
* All mnemonics have had 'b' prepended to them for "branch".
* The CMP_CHECK bit alters the displayed mnemonic for the inverted
versions. e.g. BEQ can be displayed as BNE.
* The following JMP instruction that encodes the branch destination has
been folded into the disassembly of the branch instruction. Unlike
MIPS, I chose to display it offset from the branch check with =>
instead of another comma.
- Fixed: Don't assume operator new will return a pointer with 16-byte
alignment when allocating a block for the VMFrameStack. Because it seems
it's actually guaranteed to be 8-byte aligned. Don't know where I got
the idea it would always be 16-byte aligned.
- This replaces the general extensibility that had existed formerly
in thingdef_function.cpp. Parameter parsing for function calls is
shared with state parameter parsing. Functions are defined exactly in
the same way as action functions, but without the 'action' keyword.
- Fixed: Integer constants passed to pick() need to manually generate load
instructions, since FxConstant::Emit() will just return a constant
register with its value.
- Fixed: VMFunctionBuilder::RegAvailability::Reuse() didn't actually
calculate a proper mask. Also added another assert to this function.
Conflicts:
src/CMakeLists.txt
src/b_think.cpp
src/g_doom/a_doomweaps.cpp
src/g_hexen/a_clericstaff.cpp
src/g_hexen/a_fighterplayer.cpp
src/namedef.h
src/p_enemy.cpp
src/p_local.h
src/p_mobj.cpp
src/p_teleport.cpp
src/sc_man_tokens.h
src/thingdef/thingdef_codeptr.cpp
src/thingdef/thingdef_function.cpp
src/thingdef/thingdef_parse.cpp
wadsrc/static/actors/actor.txt
wadsrc/static/actors/constants.txt
wadsrc/static/actors/shared/inventory.txt
- Added register reuse to VMFunctionBuilder for FxPick's code emitter.
- Note to self: Need to reimplement IsPointerEqual and CheckClass, which
were added to thingdef_function.cpp over the past year, as this file no
longer exists in this branch.
- The binary form of ZCC_OpInfoType::FindBestProto() needs special
handling for conversion from single to double precision floating point
so that it doesn't choose an integer form over a floating point form
when picking the best prototype.
- This information is already stored in the node's NodeType field, so
there's no reason to go do a table lookup for it elsewhere. Must have
been a brain fart when I wrote them in the first place.
- AST nodes cannot be shared, because type conversion changes them in
place, and what's appropriate for one use is by no means appropriate for
all uses.
- Added ZCCCompiler class as a place to generate IR and symbols from an
AST. Right now, all it does is simplify constant expressions into
constant values.
- Do type promotion on the AST where appropriate.
- Added true and false tokens to the parser driver.
- Since the VM doesn't directly support the GT, GTEQ, and NEQ comparisons,
don't use them in the trees either. Instead, wrap them as LTEQ, LT, and
EQEQ inside a BoolNot operator.
- I can't believe I completely forgot to let the parser handle true and
false literals.
- Consolidate all the %include blocks in zcc-parse.lemon into a single
one, because Lemon all of a sudden decided it didn't like me having more
than one in the grammar file.
- Added a PBool type to represent boolean values with.
- Since the tokenizer never gives the parser negative numbers but always a
unary minus followed by a positive number, it seems reasonable to make
the parser smart enough to turn these into negative constants without
generating extra tree nodes.
- And since we're doing it for unary -, we might as well do it for unary +
as well and avoid extra nodes when we know we don't need them.
- For an enum like this:
enum { value1 = SOME_NUM*2, value2 };
Generate an increment expression for value2 of the form
(add (id value1) 1)
and not
(add (* SOME_NUM 2) 1)
- Instead of representating enumeration values with a special node type,
use the same ZCC_ConstantDef nodes that const_def produces. These are
created at the same scope as the ZCC_Enum, rather than being contained
entirely within it. To mark the end of enums for a single instance of
ZCC_Enum, a ZCC_EnumTerminator node is now appended to the chain of
ZCC_ConstantDefs.
- Instead of having ZCC_ExprString, ZCC_ExprInt, and ZCC_ExprFloat,
just use a single ZCC_ExprConstant. It should simplify type
promotion and constant folding in the future.
- Constants can fill out the type field right away. Other expressions will need
to wait until a later pass, after names have been resolved, so they get
initialized to NULL.
- To simplify code generation genericizing, add three new opcodes
* NOP: No-Operation
* LANG: Load Angle - load a BAM angle into a float reg as degrees
* SANG: Save Angle - store a float reg into a BEM angle, converting from degrees
- Added versions of the trig operations supported by FLOP that can work
with degrees directly instead of radians.
- Reorder FLOPs into more sensible groupings.