mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-14 03:29:57 +00:00
[flang][runtime] Fix NORM2([negative, ...])
NORM2 is broken for arrays that start with a negative number because it sets the initial running max_ value to that number rather than to its absolute value. Differential Revision: https://reviews.llvm.org/D155976
This commit is contained in:
parent
863e8123df
commit
b7585c75ee
@ -800,7 +800,7 @@ public:
|
||||
bool Accumulate(Type x) {
|
||||
auto absX{std::abs(static_cast<AccumType>(x))};
|
||||
if (!max_) {
|
||||
max_ = x;
|
||||
max_ = absX;
|
||||
} else if (absX > max_) {
|
||||
auto t{max_ / absX}; // < 1.0
|
||||
auto tsq{t * t};
|
||||
|
Loading…
Reference in New Issue
Block a user