Fully support basic floating point operations in spshell. #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, floating point functions in SourcePawn are optimized by hardcoding the native names SourceMod uses. The hack is not very rigorous. Nevertheless, it exists, and it's why spshell is able to use float ops despite not having the natives.
Let's finally promote at least some of the floating point library to builtin status. We'll probably see more of this in the future (since it's a nice way to prototype new opcodes too), so this patch introduces a "builtins" mechanism. The actual way things get bound is still tied to float native replacement.
Note that when using the new
<core/float>
include, the native names are different from SourceMod (__float_sub
instead ofFloatSub
, for example). This again is in anticipation of having other special builtins for underlying features. SourceMod won't be upgraded to the new names - there's no particular reason to, and it would cause some minor disruption.