X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=ir%2Fir%2Firopt.h;h=0a5098a2ad55c38cb01ad01138c4c68d4207562d;hb=2cee4704915e0e2ecc85568536570601419a251b;hp=98a1d72bcc627851ba71eb374f2f7c88ac2933e5;hpb=464132f4d8840f7bb4228bfeef5484331bf50835;p=libfirm diff --git a/ir/ir/iropt.h b/ir/ir/iropt.h index 98a1d72bc..0a5098a2a 100644 --- a/ir/ir/iropt.h +++ b/ir/ir/iropt.h @@ -22,6 +22,53 @@ #include "firm_types.h" +/** + * The Floating point model. + * + * Several basic properties are defined: + * - fp_explicit_rounding + * - fp_strict_algebraic + * - fp_contradictions + * - fp_strict_eval_order + * - fp_exceptions + * - fp_environment_access + * + * From those basic properties three general models are defined, + * compatible to the VC8 compiler: + * - fp_model_precise: + * Default mode. Associative and distributive law forbidden unless a transformation + * is guaranteed to produce the same result. + * No FPU environment access. No FP exception semantics. + * - fp_model_strict: + * Slowest mode. Additionally to fp_model_precise allows correct handling of + * FP exceptions and FPU environment access. + * - fp_model_fast: + * Fastest mode. Associative and distributive law allowed at the expense + * of floating point accuracy and correctness. Explicite rounding is disabled. + */ +typedef enum _fp_model_t { + fp_explicit_rounding = 1, /**< Explicite rounding at assignments, typecasts, return + and function calls. Conv nodes may NOT be removed, even + if they look useless. */ + fp_strict_algebraic = 2, /**< Strict adherence to non-associative and non-distributive + algebra unless the same result is guaranteed. */ + fp_contradictions = 4, /**< FP contradictions are enabled. Only for backend. */ + fp_strict_eval_order = 8, /**< FP instructions must be strict evaluated in given order. */ + fp_exceptions = 16, /**< FP exceptions are supported. No reordering that changes + the exception flow are allowed. Backends must generate + synchronized exception code. */ + fp_environment_access = 32, /**< FPU environment can be accessed. Even Constant folding + cannot be done. */ + + /** Precise floating point model. Default. */ + fp_model_precise = fp_explicit_rounding|fp_strict_algebraic|fp_contradictions, + /** Strict floating point model. */ + fp_model_strict = fp_explicit_rounding|fp_strict_algebraic|fp_strict_eval_order| + fp_exceptions|fp_environment_access, + /** Fast floating point model. */ + fp_model_fast = fp_contradictions, +} fp_model_t; + /** If the expression referenced can be evaluated statically * computed_value returns a tarval representing the result. * Else returns tarval_bad. */