[Lldb-commits] [PATCH] D126359: [LLDB] Add basic floating point ops to IR interpreter
Greg Clayton via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Thu Jul 28 10:36:57 PDT 2022
clayborg added inline comments.
================
Comment at: lldb/test/API/lang/c/fpeval/main.c:3-4
+{
+ double a = 42.0;
+ double b = 2.0;
+ return 0; //// Set break point at this line.
----------------
labath wrote:
> kpdev42 wrote:
> > clayborg wrote:
> > > We should be testing "float" and "long double" as well to verify those work.
> > Long double is not supported by this patch, but can be added. However long double is platform dependent type, so it makes no sense at all comparing JIT and interpreted results
> I think that was Greg's point. Interpreted and JITted results should provide the same results even for platform dependent types. llvm's APFloat should know enough about the individual types in order to emulate the operations correctly, and lldb should know enough about the target in order to create the appropriate APFloat instance.
Indeed. and if we are going to replace the float/double/long double interpretation, APFloat can handle that all as we must get the types from the ASTContext for the triple that has the right types anyway so this should be easy to make work.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D126359/new/
https://reviews.llvm.org/D126359
More information about the lldb-commits
mailing list