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 am using the modified lcc used in q3vm. I compared the source for the bytecode generation and no changes in the bytecode are present except for not enabling doubles and converting them to floats and popping after a CALL OP.
The odd things I see are that lcc creates a local variable(none are defined in the c source), it uses a constant f value 1073741824 does multiplies when a simple add is expected. When running in the q3vm it of course gives me different output:
I am using the modified lcc used in q3vm. I compared the source for the bytecode generation and no changes in the bytecode are present except for not enabling doubles and converting them to floats and popping after a CALL OP.
The issue
When generating bytecode for this code:
lcc generates this:
I naively generate with my compiler(I basically use chibicc to parse and give me the AST and generate the bytecode from the AST):
The odd things I see are that lcc creates a local variable(none are defined in the c source), it uses a constant f value
1073741824
does multiplies when a simple add is expected. When running in the q3vm it of course gives me different output:The c source that calls the code:
Here is the repo with all the tests that I have made.
The text was updated successfully, but these errors were encountered: