At 05:01 PM 7/7/2002 -0400, via RT wrote:
># New Ticket Created by  "Sean O'Rourke"
># Please include the string:  [netlabs #769]
># in the subject line of all future correspondence about this issue.
># <URL: http://bugs6.perl.org/rt2/Ticket/Display.html?id=769 >
>
>
>imcc currently only seems to support string and integer comparisons.  This
>patch lets you use if PMC, INTCONST.

Thats weird. It shouldn't restrict you from using PMC symbolic regs, although
there isn't currently a way to define locals like you can with int/string.

>+SymReg * iIF_PMC(SymReg * r0, SymReg * dest)
>+{
>+    Instruction * i;
>+    char op[256];
>+    strcpy(op, "if %s, %s");
>+    i = emitb(mk_instruction(op, r0, dest, 0, NULL, IF_r0_read |
>IF_r1_branch));
>+    i->type = ITBRANCH;
>+    return 0;
>+}
>+
>  SymReg * iNEW(SymReg * r0, char * type) {
>      char op[256];
>      strcpy(op, "new %s, .");
>@@ -350,6 +360,8 @@ assignment:
>  if_statement:
>         labels IF var relop var GOTO IDENTIFIER
>         { $$ = iIF($4, $3, $5, mk_address($7)); }
>+    |  labels IF var GOTO IDENTIFIER
>+       { $$ = iIF_PMC($3, mk_address($5)); }
>      ;

I'd rather not provide a PMC "specific" conditional. Lets keep
the instruction set orthogonal for all reg types.

Did you try the following?

if $P0 != 0 goto FOO

If this isn't satisfactory, let me know what you need.

-Melvin




Reply via email to