-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #99 from bluescarni/pr/neg
Implement unary negation.
- Loading branch information
Showing
10 changed files
with
962 additions
and
4 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
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
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
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,68 @@ | ||
// Copyright 2020, 2021 Francesco Biscani ([email protected]), Dario Izzo ([email protected]) | ||
// | ||
// This file is part of the heyoka library. | ||
// | ||
// This Source Code Form is subject to the terms of the Mozilla | ||
// Public License v. 2.0. If a copy of the MPL was not distributed | ||
// with this file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
#ifndef HEYOKA_MATH_NEG_HPP | ||
#define HEYOKA_MATH_NEG_HPP | ||
|
||
#include <cstdint> | ||
#include <ostream> | ||
#include <string> | ||
#include <unordered_map> | ||
#include <vector> | ||
|
||
#include <heyoka/config.hpp> | ||
#include <heyoka/detail/fwd_decl.hpp> | ||
#include <heyoka/detail/llvm_fwd.hpp> | ||
#include <heyoka/detail/visibility.hpp> | ||
#include <heyoka/func.hpp> | ||
|
||
namespace heyoka | ||
{ | ||
|
||
namespace detail | ||
{ | ||
|
||
class HEYOKA_DLL_PUBLIC neg_impl : public func_base | ||
{ | ||
public: | ||
neg_impl(); | ||
explicit neg_impl(expression); | ||
|
||
void to_stream(std::ostream &) const; | ||
|
||
llvm::Value *codegen_dbl(llvm_state &, const std::vector<llvm::Value *> &) const; | ||
llvm::Value *codegen_ldbl(llvm_state &, const std::vector<llvm::Value *> &) const; | ||
#if defined(HEYOKA_HAVE_REAL128) | ||
llvm::Value *codegen_f128(llvm_state &, const std::vector<llvm::Value *> &) const; | ||
#endif | ||
|
||
llvm::Value *taylor_diff_dbl(llvm_state &, const std::vector<std::uint32_t> &, const std::vector<llvm::Value *> &, | ||
llvm::Value *, llvm::Value *, std::uint32_t, std::uint32_t, std::uint32_t, | ||
std::uint32_t) const; | ||
llvm::Value *taylor_diff_ldbl(llvm_state &, const std::vector<std::uint32_t> &, const std::vector<llvm::Value *> &, | ||
llvm::Value *, llvm::Value *, std::uint32_t, std::uint32_t, std::uint32_t, | ||
std::uint32_t) const; | ||
#if defined(HEYOKA_HAVE_REAL128) | ||
llvm::Value *taylor_diff_f128(llvm_state &, const std::vector<std::uint32_t> &, const std::vector<llvm::Value *> &, | ||
llvm::Value *, llvm::Value *, std::uint32_t, std::uint32_t, std::uint32_t, | ||
std::uint32_t) const; | ||
#endif | ||
llvm::Function *taylor_c_diff_func_dbl(llvm_state &, std::uint32_t, std::uint32_t) const; | ||
llvm::Function *taylor_c_diff_func_ldbl(llvm_state &, std::uint32_t, std::uint32_t) const; | ||
#if defined(HEYOKA_HAVE_REAL128) | ||
llvm::Function *taylor_c_diff_func_f128(llvm_state &, std::uint32_t, std::uint32_t) const; | ||
#endif | ||
}; | ||
|
||
} // namespace detail | ||
|
||
HEYOKA_DLL_PUBLIC expression neg(expression); | ||
|
||
} // namespace heyoka | ||
|
||
#endif |
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.