tahonermann / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Note: the repository does not accept github pull requests at this moment. Please submit your patches at http://reviews.llvm.org.
http://llvm.org
Other
0 stars 1 forks source link

Reflect DFP encoding (BID/DPD) in `llvm::DataLayout` and the `target datalayout` directive #36

Open tahonermann opened 11 months ago

tahonermann commented 11 months ago

Per discussion in PR #33, it will be necessary to record the DFP encoding for the translation unit in the LLVM IR and the natural way to do that is to specify it as part of the llvm::DataLayout class and the target datalayout LLVM IR directive.

The llvm::DataLayout class is defined in llvm/include/llvm/IR/DataLayout.h.

An example of a LLVM IR target datalayout directive follows:

target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"

Part of this work will require investigating compatibility issues introduced by these changes. Presumably, LLVM IR with modified target datalayout syntax will not be consumable by tools built from previous LLVM versions. Also presumably, consumption of LLVM IR that does not reflect the DFP encoding will require assuming a target-dependent default or treating DFP support as disabled for that TU (which seems consistent with reality). It may likewise be useful to be able to explicitly indicate that DFP support is disabled in the target datalayout directive.