Skip to content

Fix DROUNDUP_LWORK: patch was not fully copied#5753

Merged
martin-frbg merged 1 commit intoOpenMathLib:developfrom
foxtran:fix/1203
Apr 9, 2026
Merged

Fix DROUNDUP_LWORK: patch was not fully copied#5753
martin-frbg merged 1 commit intoOpenMathLib:developfrom
foxtran:fix/1203

Conversation

@foxtran
Copy link
Copy Markdown
Contributor

@foxtran foxtran commented Apr 9, 2026

Asm before fix: https://godbolt.org/z/dzoTvaoTq

The most interesting lines are 153-154:

         bl      droundup_lwork_
         fcvt    d0, s0

Here, droundup_lwork_ sets d0 register based on integer value in x0 register. Then, fcvt sets d0 fp64 register with value from s0 fp32 register. However, s0 was set to zero (and, actually, never used), so, after this, d0 is 0.0 that breaks computing of memory requirement.

Asm after fix: https://godbolt.org/z/MW4rvoETa

Only these two files are affected.

Bug was introduced by commit 99c1209 (PR #5702)

Fixes #5754

@martin-frbg
Copy link
Copy Markdown
Collaborator

Oops, not sure what happened to #5702 - there appear to be similar differences in the related complex routines. (One of those silly situations where I abused the web interface for PR creating instead of pushing from a local repo due to travelling)
Thanks a lot for spotting and fixing this, I'll follow up with the remaining files in a minute.

@martin-frbg martin-frbg modified the milestone: 0.3.33 Apr 9, 2026
@martin-frbg martin-frbg merged commit 1aea1d6 into OpenMathLib:develop Apr 9, 2026
99 of 102 checks passed
@foxtran foxtran deleted the fix/1203 branch April 9, 2026 12:20
@foxtran
Copy link
Copy Markdown
Contributor Author

foxtran commented Apr 9, 2026

Remaining files are OK.

@martin-frbg
Copy link
Copy Markdown
Collaborator

I'm seeing differences in chegvd.f (roundup not used on RWORK(1) in line 322 between a fresh checkout of both OpenBLAS and Reference-LAPACK, and also for the other c & z files from 1203/5702

@martin-frbg
Copy link
Copy Markdown
Collaborator

Absolutely no idea right now how #5702 ended up with a partial commit of the fixes from 1203, as I had copied the entire files from an up-to-date checkout of Reference , no manual edits...

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.

Broken memory computation in DSYGVD/DSPGVD routines

2 participants