#endif // QMLJS_LLVM_RUNTIME
#include <cmath>
-#if !defined(QMLJS_LLVM_RUNTIME) && 1 //CPU(X86_64)
+#if !defined(QMLJS_LLVM_RUNTIME) && COMPILER(GCC) && (CPU(X86_64) || CPU(X86))
+#define QMLJS_INLINE_MATH
+#endif
+
+#if defined(QMLJS_INLINE_MATH)
QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
-#endif // !defined(QMLJS_LLVM_RUNTIME) && 1 //CPU(X86_64)
+#endif // defined(QMLJS_INLINE_MATH)
#endif // QMLJS_MATH_H
{
TRACE2(left, right);
-#ifndef QMLJS_LLVM_RUNTIME
+#ifdef QMLJS_INLINE_MATH
if (Value::integerCompatible(left, right))
return add_int32(left.integerValue(), right.integerValue());
-#endif // QMLJS_LLVM_RUNTIME
+#endif
if (Value::bothDouble(left, right))
return Value::fromDouble(left.doubleValue() + right.doubleValue());
{
TRACE2(left, right);
-#ifndef QMLJS_LLVM_RUNTIME
+#ifdef QMLJS_INLINE_MATH
if (Value::integerCompatible(left, right))
return sub_int32(left.integerValue(), right.integerValue());
-#endif // QMLJS_LLVM_RUNTIME
+#endif
double lval = __qmljs_to_number(left, ctx);
double rval = __qmljs_to_number(right, ctx);
{
TRACE2(left, right);
-#ifndef QMLJS_LLVM_RUNTIME
+#ifdef QMLJS_INLINE_MATH
if (Value::integerCompatible(left, right))
return mul_int32(left.integerValue(), right.integerValue());
-#endif // QMLJS_LLVM_RUNTIME
+#endif
double lval = __qmljs_to_number(left, ctx);
double rval = __qmljs_to_number(right, ctx);