MLIR  20.0.0git
WideIntEmulationConverter.h
Go to the documentation of this file.
1 //===- WideIntEmulationConverter.h - Type Converter for WIE -----*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef MLIR_DIALECT_ARITH_WIDE_INT_EMULATION_CONVERTER_H_
10 #define MLIR_DIALECT_ARITH_WIDE_INT_EMULATION_CONVERTER_H_
11 
13 
14 namespace mlir::arith {
15 /// Converts integer types that are too wide for the target by splitting them in
16 /// two halves and thus turning into supported ones, i.e., i2*N --> iN, where N
17 /// is the widest integer bitwidth supported by the target.
18 /// Currently, we only handle power-of-two integer types and support conversions
19 /// of integers twice as wide as the maximum supported by the target. Wide
20 /// integers are represented as vectors, e.g., i64 --> vector<2xi32>, where the
21 /// first element is the low half of the original integer, and the second
22 /// element the high half.
24 public:
25  explicit WideIntEmulationConverter(unsigned widestIntSupportedByTarget);
26 
27  unsigned getMaxTargetIntBitWidth() const { return maxIntWidth; }
28 
29 private:
30  unsigned maxIntWidth;
31 };
32 } // namespace mlir::arith
33 
34 #endif // MLIR_DIALECT_ARITH_WIDE_INT_EMULATION_CONVERTER_H_
Type conversion class.
Converts integer types that are too wide for the target by splitting them in two halves and thus turn...
WideIntEmulationConverter(unsigned widestIntSupportedByTarget)