summaryrefslogtreecommitdiff
path: root/cgcode.c
diff options
context:
space:
mode:
authorJohn van Groningen2005-12-06 11:13:52 +0000
committerJohn van Groningen2005-12-06 11:13:52 +0000
commit2480a3a0a20c69f9da531e9d68c711e3b9e8a227 (patch)
tree6acab570ed2e72ebad8a7481330df165e3006ac5 /cgcode.c
parentadd passing of float argument in ccall for the PowerPC (diff)
add pushLc instruction for pushing the value of a label, with
a '_' or '.' added at the beginning if this is specified in the c ABI for this platform
Diffstat (limited to 'cgcode.c')
-rw-r--r--cgcode.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/cgcode.c b/cgcode.c
index bdad684..4b72a1c 100644
--- a/cgcode.c
+++ b/cgcode.c
@@ -4931,6 +4931,35 @@ void code_pushL (char *label_name)
s_push_b (graph_1);
}
+void code_pushLc (char *c_function_name)
+{
+ INSTRUCTION_GRAPH graph_1;
+ LABEL *label;
+
+#if (defined (sparc) && !defined (SOLARIS)) || (defined (I486) && !defined (LINUX_ELF)) || (defined (G_POWER) && !defined (LINUX_ELF)) || defined (MACH_O)
+ char label_name [202];
+
+# if defined (G_POWER) && !defined (MACH_O)
+ label_name[0]='.';
+# else
+ label_name[0]='_';
+# endif
+ strcpy (&label_name[1],c_function_name);
+
+ label=enter_label (label_name,0);
+#else
+ label=enter_label (c_function_name,0);
+#endif
+
+ graph_1=g_lea (label);
+
+#ifndef M68000
+ --graph_1->instruction_d_min_a_cost;
+#endif
+
+ s_push_b (graph_1);
+}
+
void code_pushR (double v)
{
INSTRUCTION_GRAPH graph_1,graph_2,graph_3;