mirror of
https://github.com/KhronosGroup/SPIRV-Tools
synced 2024-10-19 03:20:14 +00:00
57a2441791
CPPreference.com has this description of digits10: “The value of std::numeric_limits<T>::digits10 is the number of base-10 digits that can be represented by the type T without change, that is, any number with this many significant decimal digits can be converted to a value of type T and back to decimal form, without change due to rounding or overflow.” This means that any number with this many digits can be represented accurately in the corresponding type. A change in any digit in a number after that may or may not cause it a different bitwise representation. Therefore this isn’t necessarily enough precision to accurately represent the value in text. Instead we need max_digits10 which has the following description: “The value of std::numeric_limits<T>::max_digits10 is the number of base-10 digits that are necessary to uniquely represent all distinct values of the type T, such as necessary for serialization/deserialization to text.” The patch includes a test case in hex_float_test which tries to do a round-robin conversion of a number that requires more than 6 decimal places to be accurately represented. This would fail without the patch. Sadly this also breaks a bunch of other tests. Some of the tests in hex_float_test use ldexp and then compare it with a value which is not the same as the one returned by ldexp but instead is the value rounded to 6 decimals. Others use values that are not evenly representable as a binary floating fraction but then happened to generate the same value when rounded to 6 decimals. Where the actual value didn’t seem to matter these have been changed with different values that can be represented as a binary fraction. |
||
---|---|---|
.. | ||
dominator_tree | ||
loop_optimizations | ||
aggressive_dead_code_elim_test.cpp | ||
assembly_builder_test.cpp | ||
assembly_builder.h | ||
block_merge_test.cpp | ||
ccp_test.cpp | ||
cfg_cleanup_test.cpp | ||
CMakeLists.txt | ||
common_uniform_elim_test.cpp | ||
compact_ids_test.cpp | ||
copy_prop_array_test.cpp | ||
dead_branch_elim_test.cpp | ||
dead_insert_elim_test.cpp | ||
dead_variable_elim_test.cpp | ||
decoration_manager_test.cpp | ||
def_use_test.cpp | ||
eliminate_dead_const_test.cpp | ||
eliminate_dead_functions_test.cpp | ||
feature_manager_test.cpp | ||
flatten_decoration_test.cpp | ||
fold_spec_const_op_composite_test.cpp | ||
fold_test.cpp | ||
freeze_spec_const_test.cpp | ||
function_utils.h | ||
if_conversion_test.cpp | ||
inline_opaque_test.cpp | ||
inline_test.cpp | ||
insert_extract_elim_test.cpp | ||
instruction_list_test.cpp | ||
instruction_test.cpp | ||
ir_builder.cpp | ||
ir_context_test.cpp | ||
ir_loader_test.cpp | ||
iterator_test.cpp | ||
line_debug_info_test.cpp | ||
local_access_chain_convert_test.cpp | ||
local_redundancy_elimination_test.cpp | ||
local_single_block_elim.cpp | ||
local_single_store_elim_test.cpp | ||
local_ssa_elim_test.cpp | ||
module_test.cpp | ||
module_utils.h | ||
optimizer_test.cpp | ||
pass_fixture.h | ||
pass_manager_test.cpp | ||
pass_merge_return_test.cpp | ||
pass_remove_duplicates_test.cpp | ||
pass_test.cpp | ||
pass_utils.cpp | ||
pass_utils.h | ||
private_to_local_test.cpp | ||
propagator_test.cpp | ||
redundancy_elimination_test.cpp | ||
replace_invalid_opc_test.cpp | ||
scalar_analysis.cpp | ||
scalar_replacement_test.cpp | ||
set_spec_const_default_value_test.cpp | ||
simplification_test.cpp | ||
strength_reduction_test.cpp | ||
strip_debug_info_test.cpp | ||
strip_reflect_info_test.cpp | ||
type_manager_test.cpp | ||
types_test.cpp | ||
unify_const_test.cpp | ||
utils_test.cpp | ||
value_table_test.cpp | ||
workaround1209_test.cpp |