[libc] Move long double table option to new config (#66151)

This patch adds the long double table option for printf into the new
configuration scheme. This allows it to be set for most targets but
unset for baremetal.
This commit is contained in:
michaelrj-google 2023-09-13 10:43:05 -07:00 committed by GitHub
parent 7457228629
commit 380eb46b13
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 11 additions and 1 deletions

View File

@ -8,6 +8,9 @@
},
"LIBC_CONF_PRINTF_DISABLE_WRITE_INT": {
"value": true
},
"LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE": {
"value": false
}
}
}

View File

@ -11,6 +11,10 @@
"LIBC_CONF_PRINTF_DISABLE_WRITE_INT": {
"value": false,
"doc": "Disable handling of %n in printf format string."
},
"LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE": {
"value": true,
"doc": "Use large table for better printf long double performance."
}
}
}

View File

@ -29,3 +29,4 @@ to learn about the defaults for your platform and target.
- ``LIBC_CONF_PRINTF_DISABLE_FLOAT``: Disable printing floating point values in printf and friends.
- ``LIBC_CONF_PRINTF_DISABLE_INDEX_MODE``: Disable index mode in the printf format string.
- ``LIBC_CONF_PRINTF_DISABLE_WRITE_INT``: Disable handling of %n in printf format string.
- ``LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE``: Use large table for better printf long double performance.

View File

@ -363,6 +363,9 @@ endif()
if(LIBC_CONF_PRINTF_DISABLE_WRITE_INT)
list(APPEND printf_copts "-DLIBC_COPT_PRINTF_DISABLE_WRITE_INT")
endif()
if(LIBC_CONF_PRINTF_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE)
list(APPEND printf_copts "-DLIBC_COPT_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE")
endif()
if(LLVM_LIBC_FULL_BUILD)
list(APPEND printf_deps

View File

@ -92,7 +92,6 @@ add_object_library(
libc.src.__support.integer_to_string
libc.src.__support.float_to_string
COMPILE_OPTIONS
-DLIBC_COPT_FLOAT_TO_STR_USE_MEGA_LONG_DOUBLE_TABLE
${printf_copts}
)