Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
GHC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Gesh
GHC
Commits
f5fd4677
Commit
f5fd4677
authored
25 years ago
by
Simon Marlow
Browse files
Options
Downloads
Patches
Plain Diff
[project @ 1999-10-15 09:50:22 by simonmar]
Add macros for two-register call/return convention, for experimentation.
parent
ed2992a5
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
ghc/rts/PrimOps.hc
+53
-11
53 additions, 11 deletions
ghc/rts/PrimOps.hc
with
53 additions
and
11 deletions
ghc/rts/PrimOps.hc
+
53
−
11
View file @
f5fd4677
/* -----------------------------------------------------------------------------
* $Id: PrimOps.hc,v 1.3
1
1999/10/1
3 16:39:23
simonmar Exp $
* $Id: PrimOps.hc,v 1.3
2
1999/10/1
5 09:50:22
simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
...
...
@@ -55,7 +55,7 @@ W_ GHC_ZCCReturnable_static_info[0];
*/
/*------ All Regs available */
#ifdef
REG_R8
#if
def
ined(
REG_R8
)
# define RET_P(a) R1.w = (W_)(a); JMP_(ENTRY_CODE(Sp[0]));
# define RET_N(a) RET_P(a)
...
...
@@ -80,15 +80,60 @@ W_ GHC_ZCCReturnable_static_info[0];
R4.w = (W_)(d); R5.w = (W_)(e); R6.w = (W_)(f); \
JMP_(ENTRY_CODE(Sp[0]));
#else
#if defined(REG_R7) || defined(REG_R6) || defined(REG_R5) || \
defined(REG_R4) || defined(REG_R3) || defined(REG_R2)
#elif defined(REG_R7) || defined(REG_R6) || defined(REG_R5) || \
defined(REG_R4) || defined(REG_R3)
# error RET_n macros not defined for this setup.
#else
/*------ 2 Registers available */
#elif defined(REG_R2)
# define RET_P(a) R1.w = (W_)(a); JMP_(ENTRY_CODE(Sp[0]));
# define RET_N(a) RET_P(a)
# define RET_PP(a,b) R1.w = (W_)(a); R2.w = (W_)(b); \
JMP_(ENTRY_CODE(Sp[0]));
# define RET_NN(a,b) RET_PP(a,b)
# define RET_NP(a,b) RET_PP(a,b)
# define RET_PPP(a,b,c) \
R1.w = (W_)(a); R2.w = (W_)(b); Sp[-1] = (W_)(c); Sp -= 1; \
JMP_(ENTRY_CODE(Sp[1]));
# define RET_NNP(a,b,c) \
R1.w = (W_)(a); R2.w = (W_)(b); Sp[-1] = (W_)(c); Sp -= 1; \
JMP_(ENTRY_CODE(Sp[1]));
# define RET_NNNP(a,b,c,d) \
R1.w = (W_)(a); \
R2.w = (W_)(b); \
/* Sp[-3] = ARGTAG(1); */ \
Sp[-2] = (W_)(c); \
Sp[-1] = (W_)(d); \
Sp -= 3; \
JMP_(ENTRY_CODE(Sp[3]));
# define RET_NPNP(a,b,c,d) \
R1.w = (W_)(a); \
R2.w = (W_)(b); \
/* Sp[-3] = ARGTAG(1); */ \
Sp[-2] = (W_)(c); \
Sp[-1] = (W_)(d); \
Sp -= 3; \
JMP_(ENTRY_CODE(Sp[3]));
# define RET_NNPNNP(a,b,c,d,e,f) \
R1.w = (W_)(a); \
R2.w = (W_)(b); \
Sp[-6] = (W_)(c); \
/* Sp[-5] = ARGTAG(1); */ \
Sp[-4] = (W_)(d); \
/* Sp[-3] = ARGTAG(1); */ \
Sp[-2] = (W_)(e); \
Sp[-1] = (W_)(f); \
Sp -= 6; \
JMP_(ENTRY_CODE(Sp[6]));
/*------ 1 Register available */
#ifdef
REG_R1
#
el
if
def
ined(
REG_R1
)
# define RET_P(a) R1.w = (W_)(a); JMP_(ENTRY_CODE(Sp[0]));
# define RET_N(a) RET_P(a)
...
...
@@ -176,9 +221,6 @@ W_ GHC_ZCCReturnable_static_info[0];
#endif
#endif
#endif
/*-----------------------------------------------------------------------------
Array Primitives
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment