aboutsummaryrefslogtreecommitdiffstats
path: root/src/comp.c
diff options
context:
space:
mode:
authorAndrea Corallo2019-05-24 16:57:55 +0200
committerAndrea Corallo2020-01-01 11:33:38 +0100
commita5524504164ed9077984b90ecf5067d1e8bcbdb2 (patch)
treeec819df1a351fc70f683b75b96e4057bbd80edfc /src/comp.c
parent2a5c81a5c92d15e8db471d16f3a014a338f9c271 (diff)
downloademacs-a5524504164ed9077984b90ecf5067d1e8bcbdb2.tar.gz
emacs-a5524504164ed9077984b90ecf5067d1e8bcbdb2.zip
add concat
Diffstat (limited to 'src/comp.c')
-rw-r--r--src/comp.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/comp.c b/src/comp.c
index 2e5f3342cbd..8745908708a 100644
--- a/src/comp.c
+++ b/src/comp.c
@@ -91,8 +91,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
91 91
92#define STR(s) #s 92#define STR(s) #s
93 93
94/* With most of the ops we need to do the same stuff so this save some 94/* With most of the ops we need to do the same stuff so this macros are meant
95 typing. */ 95 to save some typing. */
96
97/* Generate appropriate case and emit convential calls to function. */
96 98
97#define CASE_CALL_NARGS(name, nargs) \ 99#define CASE_CALL_NARGS(name, nargs) \
98 case B##name: \ 100 case B##name: \
@@ -101,6 +103,14 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
101 PUSH (gcc_jit_lvalue_as_rvalue (res)); \ 103 PUSH (gcc_jit_lvalue_as_rvalue (res)); \
102 break 104 break
103 105
106/* Emit calls to functions with prototype (ptrdiff_t nargs, Lisp_Object *args)
107 This is done aggregating args into the scratch_call_area. */
108
109#define EMIT_SCRATCH_CALL_N(name, nargs) \
110 pop (nargs, &stack, args); \
111 res = jit_emit_callN (name, nargs, args); \
112 PUSH (gcc_jit_lvalue_as_rvalue (res))
113
104/* The compiler context */ 114/* The compiler context */
105 115
106typedef struct { 116typedef struct {
@@ -588,14 +598,19 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
588 CASE_CALL_NARGS (substring, 3); 598 CASE_CALL_NARGS (substring, 3);
589 599
590 case Bconcat2: 600 case Bconcat2:
591 printf("Bconcat2\n"); 601 EMIT_SCRATCH_CALL_N ("Fconcat", 2);
592 break; 602 break;
593 case Bconcat3: 603 case Bconcat3:
594 printf("Bconcat3\n"); 604 EMIT_SCRATCH_CALL_N ("Fconcat", 3);
595 break; 605 break;
596 case Bconcat4: 606 case Bconcat4:
597 printf("Bconcat4\n"); 607 EMIT_SCRATCH_CALL_N ("Fconcat", 4);
598 break; 608 break;
609 case BconcatN:
610 op = FETCH;
611 EMIT_SCRATCH_CALL_N ("Fconcat", op);
612 break;
613
599 case Bsub1: 614 case Bsub1:
600 printf("Bsub1\n"); 615 printf("Bsub1\n");
601 break; 616 break;
@@ -864,9 +879,6 @@ compile_f (const char *f_name, ptrdiff_t bytestr_length,
864 case BRgotoifnonnilelsepop: 879 case BRgotoifnonnilelsepop:
865 printf("BRgotoifnonnilelsepop\n"); 880 printf("BRgotoifnonnilelsepop\n");
866 break; 881 break;
867 case BconcatN:
868 printf("BconcatN\n");
869 break;
870 case BinsertN: 882 case BinsertN:
871 printf("BinsertN\n"); 883 printf("BinsertN\n");
872 break; 884 break;