aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build/Step/InstallFile.zig
diff options
context:
space:
mode:
authorKoki Ueha <jeamsblue@gmail.com>2025-06-15 01:05:58 +0000
committerJacob Young <15544577+jacobly0@users.noreply.github.com>2025-06-15 04:01:43 -0400
commit878b7b80c15d4b9a894f6ab1d4e8753de77568ad (patch)
treedb26c68ae9e0da28fefba8c0b2b2f917655bbbdb /lib/std/Build/Step/InstallFile.zig
parent3ce8d19f76690afe21b77651cffef9a9866cbf30 (diff)
downloadzig-878b7b80c15d4b9a894f6ab1d4e8753de77568ad.tar.gz
zig-878b7b80c15d4b9a894f6ab1d4e8753de77568ad.zip
libc: Prevent FCSEL instruction from being used to avoid raising an unintended exception
If you write an if expression in mem.doNotOptimizeAway like doNotOptimizeAway(if (ix < 0x00100000) x / 0x1p120 else x + 0x1p120);, FCSEL instruction is used on AArch64. FCSEL instruction selects one of the two registers according to the condition and copies its value. In this example, `x / 0x1p120` and `x + 0x1p120` are expressions that raise different floating-point exceptions. However, since both are actually evaluated before the FCSEL instruction, the exception not intended by the programmer may also be raised. To prevent FCSEL instruction from being used here, this commit splits doNotOptimizeAway in two.
Diffstat (limited to 'lib/std/Build/Step/InstallFile.zig')
0 files changed, 0 insertions, 0 deletions