1 //===-- RegisterValue.h -----------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
11 /// Defines a Target independent value for a Register. This is useful to explore
12 /// the influence of the instruction input values on its execution time.
14 //===----------------------------------------------------------------------===//
16 #ifndef LLVM_TOOLS_LLVM_EXEGESIS_REGISTERVALUE_H
17 #define LLVM_TOOLS_LLVM_EXEGESIS_REGISTERVALUE_H
19 #include <llvm/ADT/APFloat.h>
20 #include <llvm/ADT/APInt.h>
25 // A simple object storing the value for a particular register.
26 struct RegisterValue
{
27 static RegisterValue
zero(unsigned Reg
) { return {Reg
, APInt()}; }
32 enum class PredefinedValues
{
33 POS_ZERO
, // Positive zero
34 NEG_ZERO
, // Negative zero
39 ULP
, // One Unit in the last place
40 SMALLEST
= ULP
, // The minimum subnormal number
41 SMALLEST_NORM
, // The minimum normal number
42 LARGEST
, // The maximum normal number
43 ONE_PLUS_ULP
, // The value just after 1.0
46 APInt
bitcastFloatValue(const fltSemantics
&FltSemantics
,
47 PredefinedValues Value
);
49 } // namespace exegesis
52 #endif // LLVM_TOOLS_LLVM_EXEGESIS_REGISTERVALUE_H