6 Commits

Author SHA1 Message Date
Jakub Ficek
fda0e63e73
[clang] handle fp options in __builtin_convertvector (#125522)
This patch allows using fpfeatures pragmas with __builtin_convertvector:
- added TrailingObjects with FPOptionsOverride and methods for handling
it to ConvertVectorExpr
- added support for codegen, node dumping, and serialization of
fpfeatures contained in ConvertVectorExpr
2025-02-19 09:03:18 -08:00
Serge Pavlov
f4066fa2dd
[clang] Use constant rounding mode for floating literals (#90877)
Conversion of floating-point literal to binary representation must be
made using constant rounding mode, which can be changed using pragma
FENV_ROUND. For example, the literal "0.1F" should be representes by
either 0.099999994 or 0.100000001 depending on the rounding direction.
2024-05-17 12:06:34 +07:00
Fangrui Song
c5de4dd1ea [test] %clang_cc1 -emit-llvm: remove redundant -S
And replace -emit-llvm -o - with -emit-llvm-only
2024-05-04 17:00:29 -07:00
Serge Pavlov
1ddd586308 [clang] Missed rounding mode use in constant evaluation
Integer-to-float conversion was handled in constant evaluator with
default rounding mode. This change fixes the behavior and the conversion
is made using rounding mode stored in ImplicitCastExpr node.

Differential Revision: https://reviews.llvm.org/D137719
2022-11-17 12:05:28 +07:00
Melanie Blower
71bf9f07d5 [clang] add fexperimental-strict-floating-point to test cases that fail on arm and aarch not sure this will work due to commit rG13bfd89c4962 2020-10-30 07:30:06 -07:00
Serge Pavlov
6314f412a8 [FPEnv] Evaluate constant expressions under non-default rounding modes
The change implements evaluation of constant floating point expressions
under non-default rounding modes. The main objective was to support
evaluation of global variable initializers, where constant rounding mode
may be specified by `#pragma STDC FENV_ROUND`.

Differential Revision: https://reviews.llvm.org/D87822
2020-09-26 17:59:39 +07:00