Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
GHC
Commits
9782f8fb
Commit
9782f8fb
authored
Mar 23, 2012
by
Ian Lynagh
Browse files
Merge branch 'master' of win:c:/m64/reg4/.
parents
47a01802
1212145b
Changes
3
Hide whitespace changes
Inline
Side-by-side
includes/Stg.h
View file @
9782f8fb
...
...
@@ -257,7 +257,7 @@ typedef StgFunPtr F_;
INLINE_HEADER
void
ASSIGN_FLT
(
W_
[],
StgFloat
);
INLINE_HEADER
StgFloat
PK_FLT
(
W_
[]);
#if ALIGNMENT_FLOAT <= ALIGNMENT_
LONG
#if ALIGNMENT_FLOAT <= ALIGNMENT_
VOID_P
INLINE_HEADER
void
ASSIGN_FLT
(
W_
p_dest
[],
StgFloat
src
)
{
*
(
StgFloat
*
)
p_dest
=
src
;
}
INLINE_HEADER
StgFloat
PK_FLT
(
W_
p_src
[])
{
return
*
(
StgFloat
*
)
p_src
;
}
...
...
@@ -278,9 +278,9 @@ INLINE_HEADER StgFloat PK_FLT(W_ p_src[])
return
(
y
.
f
);
}
#endif
/* ALIGNMENT_FLOAT > ALIGNMENT_
LONG
*/
#endif
/* ALIGNMENT_FLOAT > ALIGNMENT_
VOID_P
*/
#if ALIGNMENT_DOUBLE <= ALIGNMENT_
LONG
#if ALIGNMENT_DOUBLE <= ALIGNMENT_
VOID_P
INLINE_HEADER
void
ASSIGN_DBL
(
W_
[],
StgDouble
);
INLINE_HEADER
StgDouble
PK_DBL
(
W_
[]);
...
...
@@ -288,7 +288,7 @@ INLINE_HEADER StgDouble PK_DBL (W_ []);
INLINE_HEADER
void
ASSIGN_DBL
(
W_
p_dest
[],
StgDouble
src
)
{
*
(
StgDouble
*
)
p_dest
=
src
;
}
INLINE_HEADER
StgDouble
PK_DBL
(
W_
p_src
[])
{
return
*
(
StgDouble
*
)
p_src
;
}
#else
/* ALIGNMENT_DOUBLE > ALIGNMENT_
LONG
*/
#else
/* ALIGNMENT_DOUBLE > ALIGNMENT_
VOID_P
*/
/* Sparc uses two floating point registers to hold a double. We can
* write ASSIGN_DBL and PK_DBL by directly accessing the registers
...
...
includes/stg/MachRegs.h
View file @
9782f8fb
...
...
@@ -164,8 +164,10 @@
#define REG_D1 xmm5
#define REG_D2 xmm6
#if !defined(mingw32_HOST_OS)
#define CALLER_SAVES_R3
#define CALLER_SAVES_R4
#endif
#define CALLER_SAVES_R5
#define CALLER_SAVES_R6
...
...
@@ -175,7 +177,9 @@
#define CALLER_SAVES_F4
#define CALLER_SAVES_D1
#if !defined(mingw32_HOST_OS)
#define CALLER_SAVES_D2
#endif
#define MAX_REAL_VANILLA_REG 6
#define MAX_REAL_FLOAT_REG 4
...
...
rts/StgCRun.c
View file @
9782f8fb
...
...
@@ -247,15 +247,20 @@ StgRunIsImplementedInAssembler(void)
*/
".globl "
STG_RUN
"
\n
"
STG_RUN
":
\n\t
"
"subq %
0
, %%rsp
\n\t
"
"subq %
1
, %%rsp
\n\t
"
"movq %%rsp, %%rax
\n\t
"
"
add
q %0
-48
, %%r
ax
\n\t
"
"
sub
q %0, %%r
sp
\n\t
"
"movq %%rbx,0(%%rax)
\n\t
"
"movq %%rbp,8(%%rax)
\n\t
"
"movq %%r12,16(%%rax)
\n\t
"
"movq %%r13,24(%%rax)
\n\t
"
"movq %%r14,32(%%rax)
\n\t
"
"movq %%r15,40(%%rax)
\n\t
"
#if defined(mingw32_HOST_OS)
"movq %%rdi,48(%%rax)
\n\t
"
"movq %%rsi,56(%%rax)
\n\t
"
"movq %%xmm6,64(%%rax)
\n\t
"
#endif
/*
* Set BaseReg
*/
...
...
@@ -282,18 +287,30 @@ StgRunIsImplementedInAssembler(void)
/*
* restore callee-saves registers. (Don't stomp on %%rax!)
*/
"addq %0, %%rsp
\n\t
"
"movq %%rsp, %%rdx
\n\t
"
"addq %
0-48
, %%r
dx
\n\t
"
"addq %
1
, %%r
sp
\n\t
"
"movq 0(%%rdx),%%rbx
\n\t
"
/* restore the registers saved above */
"movq 8(%%rdx),%%rbp
\n\t
"
"movq 16(%%rdx),%%r12
\n\t
"
"movq 24(%%rdx),%%r13
\n\t
"
"movq 32(%%rdx),%%r14
\n\t
"
"movq 40(%%rdx),%%r15
\n\t
"
"addq %0, %%rsp
\n\t
"
#if defined(mingw32_HOST_OS)
"movq 48(%%rdx),%%rdi
\n\t
"
"movq 56(%%rdx),%%rsi
\n\t
"
"movq 64(%%rdx),%%xmm6
\n\t
"
#endif
"retq"
:
:
"i"
(
RESERVED_C_STACK_BYTES
+
48
/*stack frame size*/
));
:
:
"i"
(
RESERVED_C_STACK_BYTES
),
#if defined(mingw32_HOST_OS)
"i"
(
72
/*stack frame size*/
)
#else
"i"
(
48
/*stack frame size*/
)
#endif
);
/*
* See Note [Stack Alignment on X86]
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment