optimise is/2 as a binary predicate.

This commit is contained in:
Vitor Santos Costa
2009-02-09 22:21:58 +00:00
parent 8a3978e3e1
commit 89635fb1f6
2 changed files with 19 additions and 17 deletions

View File

@@ -1598,29 +1598,31 @@ static COUNT
compile_cmp_flags(char *s)
{
if (strcmp(s,"=<") == 0)
return(EQ_OK_IN_CMP|LT_OK_IN_CMP);
return EQ_OK_IN_CMP|LT_OK_IN_CMP;
if (strcmp(s,"is") == 0)
return EQ_OK_IN_CMP;
if (strcmp(s,"@=<") == 0)
return(EQ_OK_IN_CMP|LT_OK_IN_CMP);
return EQ_OK_IN_CMP|LT_OK_IN_CMP;
if (strcmp(s,"<") == 0)
return(LT_OK_IN_CMP);
return LT_OK_IN_CMP;
if (strcmp(s,"@<") == 0)
return(LT_OK_IN_CMP);
return LT_OK_IN_CMP;
if (strcmp(s,">=") == 0)
return(EQ_OK_IN_CMP|GT_OK_IN_CMP);
return EQ_OK_IN_CMP|GT_OK_IN_CMP;
if (strcmp(s,"@>=") == 0)
return(EQ_OK_IN_CMP|GT_OK_IN_CMP);
return EQ_OK_IN_CMP|GT_OK_IN_CMP;
if (strcmp(s,">") == 0)
return(GT_OK_IN_CMP);
return GT_OK_IN_CMP;
if (strcmp(s,"@>") == 0)
return(GT_OK_IN_CMP);
return GT_OK_IN_CMP;
if (strcmp(s,"=:=") == 0)
return(EQ_OK_IN_CMP);
return EQ_OK_IN_CMP;
if (strcmp(s,"=\\=") == 0)
return(GT_OK_IN_CMP|LT_OK_IN_CMP);
return GT_OK_IN_CMP|LT_OK_IN_CMP;
if (strcmp(s,"\\==") == 0)
return(GT_OK_IN_CMP|LT_OK_IN_CMP);
Yap_Error(INTERNAL_COMPILER_ERROR, TermNil, "internal assembler error, %s is not recognised", s);
return(0);
return GT_OK_IN_CMP|LT_OK_IN_CMP;
Yap_Error(INTERNAL_COMPILER_ERROR, TermNil, "internal assembler error, %s/2 not recognised as binary op", s);
return 0;
}
COUNT