Skip to content

Commit

Permalink
extend definitions of ppc64
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewfeickert committed Dec 21, 2024
1 parent c9ed117 commit a4c0e09
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace std {
seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}

#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
template <>
struct hash<ql::qdouble> : public __hash_base<size_t, ql::qdouble>
{
Expand Down
14 changes: 7 additions & 7 deletions src/qcdloop/maths.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace ql
{
// Logarithms
inline double Log(double const& x) { return std::log(x); }
#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
inline qdouble Log(qdouble const& x) { return logq(x); }
inline qcomplex Log(qcomplex const& x) { return clogq(x); }
#endif
Expand All @@ -33,7 +33,7 @@ namespace ql

// Power
inline double Pow(double const& x, int const& a) { return std::pow(x, a); }
#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
inline qdouble Pow(qdouble const& x, int const& a) { return powq(x,a); }
inline qcomplex Pow(qcomplex const& x, int const& a){ return cpowq(x,a); }
#endif
Expand All @@ -45,7 +45,7 @@ namespace ql

// Root
inline double Sqrt(double const& x) { return std::sqrt(x); }
#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
inline qdouble Sqrt(qdouble const& x) { return sqrtq(x); }
inline qcomplex Sqrt(qcomplex const& x){ return csqrtq(x); }
#endif
Expand All @@ -57,7 +57,7 @@ namespace ql

// Absolute value
inline double Abs(double const& x) { return std::abs(x); }
#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
inline qdouble Abs(qdouble const& x) { return fabsq(x);}
inline qdouble Abs(qcomplex const& x) { return cabsq(x); }
#endif
Expand All @@ -71,7 +71,7 @@ namespace ql
inline double Imag(double const& x) { UNUSED(x); return 0; }
inline qdouble Imag(qdouble const& x) { UNUSED(x); return qdouble(0); }
inline double Imag(complex const& x) { return x.imag(); }
#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
inline qdouble Imag(qcomplex const& x){ return cimagq(x);}
#endif
#if defined(__aarch64__)
Expand All @@ -81,15 +81,15 @@ namespace ql
inline double Real(double const& x) { return x; }
inline qdouble Real(qdouble const& x) { return x; }
inline double Real(complex const& x) { return x.real(); }
#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
inline qdouble Real(qcomplex const& x) { return crealq(x); }
#endif
#if defined(__aarch64__)
inline qdouble Real(qcomplex const& x) { return creall(x); }
#endif

inline complex Conjg(complex const& x) { return std::conj(x); }
#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
inline qcomplex Conjg(qcomplex const& x){ return conjq(x); }
#endif
#if defined(__aarch64__)
Expand Down
4 changes: 2 additions & 2 deletions src/qcdloop/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#pragma once

#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
extern "C" { // for gcc4.7 compatibility
#include <quadmath.h>
}
Expand Down Expand Up @@ -49,7 +49,7 @@ namespace ql
namespace std
{

#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
//! implementation of operator<< for qdouble
ostream& operator<<(std::ostream& out, ql::qdouble f);
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/tools.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace ql {
template<typename TOutput, typename TMass, typename TScale>
Tools<TOutput,TMass,TScale>::Tools():
_qlonshellcutoff(is_same<TScale,double>::value ? 1e-10 : 1e-20q),
#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
_pi(is_same<TScale,double>::value ? M_PI : M_PIq),
#endif
#if defined(__aarch64__)
Expand Down
2 changes: 1 addition & 1 deletion src/types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace std
{
#if defined(__x86_64__) || defined(__i386__) || defined(__ppc64__)
#if defined(__x86_64__) || defined(__i386__) || defined(__PPC64__) || defined(__ppc64__) || defined(_ARCH_PPC64)
ostream& operator<<(std::ostream& out, ql::qdouble f)
{
char buf[200];
Expand Down

0 comments on commit a4c0e09

Please sign in to comment.