New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pp_(i_)negate: TARGMY & favour-IV/NV optimizations #21442
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On Thu, Aug 31, 2023 at 02:54:30PM -0700, Richard Leach wrote:
The `negate` and `i_negate` functions are modified in a series of commits such that they:
* Support the generic TARGMY optimization, such that `op_targ` points directly to the SV to be assigned into, rather than assigning into a PADTMP for subsequent assignment by a different OP.
* Are RC-stack aware.
Ugh, sorry but I've been spending the last few days working on a fairly
massive "make lots of common PP functions RC-stack aware" branch
which I'm about to turn into a PR.
Would you be able to hold off and rebase this once my work is merged?
…--
O Unicef Clearasil!
Gibberish and Drivel!
-- "Bored of the Rings"
|
Yeah, that's no problem. It was still useful for me to get familiar with the new macros. |
richardleach
changed the title
pp_(i_)negate: optimizations & RC stack support
pp_(i_)negate: TARGMY & favour-IV/NV optimizations
Sep 5, 2023
Just running tests locally before pushing rebased commits. This PR will now do the following for
|
richardleach
force-pushed
the
hydahy/TARGMYnegate
branch
from
September 5, 2023 22:16
679254f
to
cb3f61a
Compare
tonycoz
reviewed
Sep 6, 2023
Adds a case in `S_negate_string` to allow for TARG==sv, which then means that the `pp_negate` and `pp_i_negate` OPs can support the TARGMY optimization
This mostly means using the existing machinery in regen/, but also not bothering to replace *PL_stack_sp when (targ == sv), as that would effectively be a busywork no-op.
Arguably it will be more common for users to want to negate an IV or NV, rather than a PV. Prior to this commit, `S_negate_string` was always called at the start of the OP and, if the target wasn't `SvPOKp`, that function just immediately returned. This commit moves the `SvPOKp` check into the `pp_` functions to avoid needless function calls.
richardleach
force-pushed
the
hydahy/TARGMYnegate
branch
from
September 6, 2023 22:55
cb3f61a
to
dd10855
Compare
tonycoz
approved these changes
Sep 7, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The
negate
andi_negate
functions are modified in a series of commits such that they:op_targ
points directly to the SV to be assigned into, rather than assigning into a PADTMP for subsequent assignment by a different OP.S_negate_string
without first checking if the argument even looks like a string.