You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've put many strict checks in my engine so it detects some weird things in ioq3' q3asm output QVMs:
jump targets set on instructions that you're never jumping in
duplicate entries in JTRGSEG
As long as you're set more jump targets than needed - it is ok, just optimization pass will be skipped.
But when you set less jump targets than needed - it may turn into unsafe opzimization.
So as long as I can see unneeded/duplicated jump targets here - I can't say that you doesn't miss jumps in other places.
"crude test for labels" https://github.com/ioquake/ioq3/blob/master/code/tools/asm/q3asm.c#L982
does something wrong
The text was updated successfully, but these errors were encountered:
I just dumped more time than is strictly reasonable into actually examining this codebase to find out why this is.
Now, disclaimer: I am not a contributor, and I have spent a mere few hours looking at this thing. But I think I'm right enough to make a fool of myself over it on GitHub, so...
Anyways, the uneeded and duped targets exist because the only check for putting something in JTRGSEG is right there on the line you specified. That is, literally any use of address followed by a sym in the objfile is gonna place the sym's value into JTRGSEG.
This could be fixed. OTOH, I'm not sure it's worth it. It's not gonna miss a jump unless it's to a static address, which, by my admittedly limited understanding of LCC's architecture, Shouldn't Happen. The dupes could be fixed by scanning back on JTRGSEG, but the erroneous targets could only be eliminated by looking at the previously assembled instruction. Which may just be more trouble than it's worth. For that matter, scanning back on JTRGSEG might be more trouble than it's worth...
EDIT: A question that should have occurred to me did not occur to me: does this happen in your Q3asm, @ec- ? Because your q3asm seems to have an essentially identical implementation of this section of code, so if the bug doesn't appear there might be something else at work here.
I've put many strict checks in my engine so it detects some weird things in ioq3' q3asm output QVMs:
As long as you're set more jump targets than needed - it is ok, just optimization pass will be skipped.
But when you set less jump targets than needed - it may turn into unsafe opzimization.
So as long as I can see unneeded/duplicated jump targets here - I can't say that you doesn't miss jumps in other places.
"crude test for labels"
https://github.com/ioquake/ioq3/blob/master/code/tools/asm/q3asm.c#L982
does something wrong
The text was updated successfully, but these errors were encountered: