Skip to content
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

Fix overflow in floating point multiplication #33

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

iglesias
Copy link

@iglesias iglesias commented May 1, 2024

No description provided.

@mario4tier
Copy link
Member

mario4tier commented Oct 16, 2024

Thanks. The proposed change is in the right direction, but the fix has to be applied differently though.

So leaving this open for now to keep track.

Two issues with the proposed change:
(1) This code is generated. It will be overwritten when the code is regenerated. The change needs to be done in tools/gencode.

(2) The same source code has to remain compatible with Java, C, C++ and C++ managed (and may be Rust soon!). So the fix must either work with all these setup (verified with ta_regtest) OR make your change specific to the language you are fixing with the pre-processor

Example:

/* Generated */ #if defined( _JAVA )
/* Generated */          outReal[outIdx] = inReal0[i]*inReal1[i];  
/* Generated */ #else 
/* Generated */          outReal[outIdx] = ((double)inReal0[i])*inReal1[i];  
/* Generated */ #endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants