C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Integer overflow arithmetic with exceptions

From: Thiago Macieira <thiago_at_[hidden]>
Date: Thu, 24 Apr 2025 17:19:13 -0700
On Thursday, 24 April 2025 17:02:31 Pacific Daylight Time Tiago Freire via Std-
Proposals wrote:
> As in so far that these are floating point instructions and not integer
> arithmetic instructions with extended precision? Or did I miss something?

Integer multiplications don't lose precision, so there's no mathematical need
for a fused multiply-add.

Intel CPUs do have them but only for 52-bit inputs (AVX512-IFMA extension).
This is more of a performance optimisation because the PMA takes as many
cycles including the addition as a packed multiplication. But the result is
bitwise identical as doing the operations separately.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
  Principal Engineer - Intel DCAI Platform & System Engineering

Received on 2025-04-25 00:19:15