mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-07-22 07:05:22 +02:00
Applied easy part from wilsonk's x86-64 patch in #107
This commit is contained in:
@@ -112,6 +112,12 @@ pragma(intrinsic, "llvm.sqrt.f80")
|
||||
real llvm_sqrt_f80(real val);
|
||||
}
|
||||
|
||||
version(X86_64)
|
||||
{
|
||||
pragma(intrinsic, "llvm.sqrt.f80")
|
||||
real llvm_sqrt_f80(real val);
|
||||
}
|
||||
|
||||
|
||||
// The 'llvm.sin.*' intrinsics return the sine of the operand.
|
||||
|
||||
@@ -125,6 +131,12 @@ pragma(intrinsic, "llvm.sin.f80")
|
||||
real llvm_sin_f80(real val);
|
||||
}
|
||||
|
||||
version(X86_64)
|
||||
{
|
||||
pragma(intrinsic, "llvm.sin.f80")
|
||||
real llvm_sin_f80(real val);
|
||||
}
|
||||
|
||||
|
||||
// The 'llvm.cos.*' intrinsics return the cosine of the operand.
|
||||
|
||||
@@ -138,6 +150,12 @@ pragma(intrinsic, "llvm.cos.f80")
|
||||
real llvm_cos_f80(real val);
|
||||
}
|
||||
|
||||
version(X86_64)
|
||||
{
|
||||
pragma(intrinsic, "llvm.cos.f80")
|
||||
real llvm_cos_f80(real val);
|
||||
}
|
||||
|
||||
|
||||
// The 'llvm.powi.*' intrinsics return the first operand raised to the specified (positive or negative) power. The order of evaluation of multiplications is not defined. When a vector of floating point type is used, the second argument remains a scalar integer value.
|
||||
|
||||
@@ -152,6 +170,11 @@ pragma(intrinsic, "llvm.powi.f80")
|
||||
real llvm_powi_f80(real val, int power);
|
||||
}
|
||||
|
||||
version(X86_64)
|
||||
{
|
||||
pragma(intrinsic, "llvm.powi.f80")
|
||||
real llvm_powi_f80(real val, int power);
|
||||
}
|
||||
|
||||
// The 'llvm.pow.*' intrinsics return the first operand raised to the specified (positive or negative) power.
|
||||
|
||||
@@ -166,7 +189,11 @@ pragma(intrinsic, "llvm.pow.f80")
|
||||
real llvm_pow_f80(real val, real power);
|
||||
}
|
||||
|
||||
|
||||
version(X86_64)
|
||||
{
|
||||
pragma(intrinsic, "llvm.pow.f80")
|
||||
real llvm_pow_f80(real val, real power);
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
|
||||
@@ -15,6 +15,9 @@ version(X86) {
|
||||
version(linux) version=X86_UNWIND;
|
||||
version(darwin) version=X86_UNWIND;
|
||||
}
|
||||
version(X86_64) {
|
||||
version(linux) version=X86_UNWIND;
|
||||
}
|
||||
|
||||
private extern(C) void abort();
|
||||
private extern(C) int printf(char*, ...);
|
||||
@@ -168,7 +171,7 @@ char[8] _d_exception_class = "LLDCD1\0\0";
|
||||
// x86 unwind specific implementation of personality function
|
||||
// and helpers
|
||||
//
|
||||
version(X86_UNWIND)
|
||||
version(X86_UNWIND)
|
||||
{
|
||||
|
||||
// the personality routine gets called by the unwind handler and is responsible for
|
||||
@@ -296,9 +299,15 @@ extern(C) _Unwind_Reason_Code _d_eh_personality(int ver, _Unwind_Action actions,
|
||||
// These are the register numbers for SetGR that
|
||||
// llvm's eh.exception and eh.selector intrinsics
|
||||
// will pick up.
|
||||
// Found by trial-and-error and probably platform dependent!
|
||||
private int eh_exception_regno = 0;
|
||||
private int eh_selector_regno = 2;
|
||||
// Found by trial-and-error :/
|
||||
version (X86_64)
|
||||
{
|
||||
private int eh_exception_regno = 3;
|
||||
private int eh_selector_regno = 1;
|
||||
} else {
|
||||
private int eh_exception_regno = 0;
|
||||
private int eh_selector_regno = 2;
|
||||
}
|
||||
|
||||
private _Unwind_Reason_Code _d_eh_install_catch_context(_Unwind_Action actions, ptrdiff_t switchval, ulong landing_pad, _d_exception* exception_struct, _Unwind_Context_Ptr context)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user