aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorThomas Preud'homme <robotux@celest.fr>2011-12-10 07:22:09 +0100
committerThomas Preud'homme <robotux@celest.fr>2012-06-05 23:09:55 +0200
commit7f6095bfec82b178084b22b33941d4f06155e514 (patch)
tree1eb61b34ecfee1afa07159c1b4f97a9483fd8e2a /tccgen.c
parentbfb00494eb2ffaf4fbf68a8ecabe9e503f4cdf65 (diff)
downloadtinycc-7f6095bfec82b178084b22b33941d4f06155e514.tar.gz
tinycc-7f6095bfec82b178084b22b33941d4f06155e514.tar.bz2
Add support for arm hardfloat calling convention
See Procedure Call Standard for the ARM Architecture (AAPCS) for more details.
Diffstat (limited to 'tccgen.c')
-rw-r--r--tccgen.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/tccgen.c b/tccgen.c
index 5b9f50a..7295267 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -972,18 +972,26 @@ ST_FUNC void vrotb(int n)
vtop[0] = tmp;
}
-/* rotate n first stack elements to the top
- I1 ... In -> In I1 ... I(n-1) [top is right]
+/* rotate the n elements before entry e towards the top
+ I1 ... In ... -> In I1 ... I(n-1) ... [top is right]
*/
-ST_FUNC void vrott(int n)
+ST_FUNC void vrote(SValue *e, int n)
{
int i;
SValue tmp;
- tmp = vtop[0];
+ tmp = *e;
for(i = 0;i < n - 1; i++)
- vtop[-i] = vtop[-i - 1];
- vtop[-n + 1] = tmp;
+ e[-i] = e[-i - 1];
+ e[-n + 1] = tmp;
+}
+
+/* rotate n first stack elements to the top
+ I1 ... In -> In I1 ... I(n-1) [top is right]
+ */
+ST_FUNC void vrott(int n)
+{
+ vrote(vtop, n);
}
/* pop stack value */