Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fir] Add fir numeric intrinsic runtime call builder
This patch adds the FIR builder to generate the numeric intrinsic runtime call. This patch is part of the upstreaming effort from fir-dev branch. Reviewed By: rovka Differential Revision: https://reviews.llvm.org/D114477 Co-authored-by: Jean Perier <jperier@nvidia.com> Co-authored-by: mleair <leairmark@gmail.com>
- Loading branch information
1 parent
55d392c
commit 529d094
Showing
5 changed files
with
573 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
//===-- Numeric.h -- generate numeric intrinsics runtime calls --*- C++ -*-===// | ||
// | ||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
// See https://llvm.org/LICENSE.txt for license information. | ||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
// | ||
//===----------------------------------------------------------------------===// | ||
|
||
#ifndef FORTRAN_OPTIMIZER_BUILDER_RUNTIME_NUMERIC_H | ||
#define FORTRAN_OPTIMIZER_BUILDER_RUNTIME_NUMERIC_H | ||
|
||
#include "mlir/Dialect/StandardOps/IR/Ops.h" | ||
|
||
namespace fir { | ||
class ExtendedValue; | ||
class FirOpBuilder; | ||
} // namespace fir | ||
|
||
namespace fir::runtime { | ||
|
||
/// Generate call to Exponent intrinsic runtime routine. | ||
mlir::Value genExponent(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Type resultType, mlir::Value x); | ||
|
||
/// Generate call to Fraction intrinsic runtime routine. | ||
mlir::Value genFraction(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value x); | ||
|
||
/// Generate call to Nearest intrinsic runtime routine. | ||
mlir::Value genNearest(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value x, mlir::Value s); | ||
|
||
/// Generate call to RRSpacing intrinsic runtime routine. | ||
mlir::Value genRRSpacing(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value x); | ||
|
||
/// Generate call to Scale intrinsic runtime routine. | ||
mlir::Value genScale(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value x, mlir::Value i); | ||
|
||
/// Generate call to Set_exponent intrinsic runtime routine. | ||
mlir::Value genSetExponent(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value x, mlir::Value i); | ||
|
||
/// Generate call to Spacing intrinsic runtime routine. | ||
mlir::Value genSpacing(fir::FirOpBuilder &builder, mlir::Location loc, | ||
mlir::Value x); | ||
|
||
} // namespace fir::runtime | ||
#endif // FORTRAN_OPTIMIZER_BUILDER_RUNTIME_NUMERIC_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.