TempleOSCDV4.05.ISO
This commit is contained in:
1 parent
d1856315e0
commit
6fe38d2d9d
118 files changed
+4559
-5069
No files matched your search
+37
-39
@@ -1,7 +1,7 @@
|
||||
Bool PrsAsmImm(CCmpCtrl *cc,CAsmArg *arg)
|
||||
{
|
||||
if (arg->imm_or_off_present)
|
||||
LexExcept(cc,"already one immediate at ");
|
||||
LexExcept(cc,"Already one immediate at ");
|
||||
arg->imm_or_off_present=TRUE;
|
||||
arg->num.local_asm_undef_hash=NULL;
|
||||
arg->num.glbl_asm_undef_hash=NULL;
|
||||
@@ -146,8 +146,8 @@ pa_asm_direct_imm:
|
||||
goto pa_asm_indirect_imm;
|
||||
} else if (cc->token=='*') {
|
||||
Lex(cc);
|
||||
if (cc->token!=TK_INTEGER)
|
||||
LexExcept(cc,"expecting scale factor at ");
|
||||
if (cc->token!=TK_INT)
|
||||
LexExcept(cc,"Expecting scale factor at ");
|
||||
arg->scale=cc->cur_i64;
|
||||
Lex(cc); //skip scale
|
||||
if (arg->reg2!=REG_NONE)
|
||||
@@ -161,7 +161,7 @@ pa_asm_indirect_imm:
|
||||
}
|
||||
}
|
||||
if (cc->token!=']')
|
||||
LexExcept(cc,"missing ']' at ");
|
||||
LexExcept(cc,"Missing ']' at ");
|
||||
Lex(cc); //skip ]
|
||||
return;
|
||||
} else
|
||||
@@ -276,7 +276,7 @@ Bool AsmStoreNum(CCmpCtrl *cc,CAsmNum2 *num2,I64 cnt,Bool U8_avail)
|
||||
num2->num.glbl_asm_undef_hash,cc->lex_include_stk->line_num,
|
||||
U8_avail);
|
||||
else if (!num2->imm_flag && !(MIN_I8<=num2->num.i<=MAX_I8))
|
||||
LexExcept(cc,"branch out of range at ");
|
||||
LexExcept(cc,"Branch out of range at ");
|
||||
if (num2->imm_flag) {
|
||||
if (num2->num.abs_cnts.abs_addres&1) {
|
||||
tempa=CAlloc(sizeof(CAOTAbsAddr));
|
||||
@@ -303,7 +303,7 @@ Bool AsmStoreNum(CCmpCtrl *cc,CAsmNum2 *num2,I64 cnt,Bool U8_avail)
|
||||
num2->num.glbl_asm_undef_hash,cc->lex_include_stk->line_num,
|
||||
U8_avail);
|
||||
else if (!num2->imm_flag && !(MIN_I16<=num2->num.i<=MAX_I16))
|
||||
LexExcept(cc,"branch out of range at ");
|
||||
LexExcept(cc,"Branch out of range at ");
|
||||
if (num2->imm_flag) {
|
||||
if (num2->num.abs_cnts.abs_addres&1) {
|
||||
tempa=CAlloc(sizeof(CAOTAbsAddr));
|
||||
@@ -330,7 +330,7 @@ Bool AsmStoreNum(CCmpCtrl *cc,CAsmNum2 *num2,I64 cnt,Bool U8_avail)
|
||||
num2->num.glbl_asm_undef_hash,cc->lex_include_stk->line_num,
|
||||
U8_avail);
|
||||
else if (!num2->imm_flag && !(MIN_I32<=num2->num.i<=MAX_I32))
|
||||
LexExcept(cc,"branch out of range at ");
|
||||
LexExcept(cc,"Branch out of range at ");
|
||||
if (num2->imm_flag) {
|
||||
if (num2->num.abs_cnts.abs_addres&1) {
|
||||
tempa=CAlloc(sizeof(CAOTAbsAddr));
|
||||
@@ -387,13 +387,13 @@ Bool AsmStoreNum(CCmpCtrl *cc,CAsmNum2 *num2,I64 cnt,Bool U8_avail)
|
||||
|
||||
U8 asm_seg_prefixes[6]={0x26,0x2E,0x36,0x3E,0x64,0x65};
|
||||
|
||||
Bool PrsAsmInstruction(CCmpCtrl *cc,CHashOpcode *tempo,I64 argcnt)
|
||||
Bool PrsAsmInst(CCmpCtrl *cc,CHashOpcode *tempo,I64 argcnt)
|
||||
{
|
||||
CAOTCtrl *aotc=cc->aotc;
|
||||
I64 i,j,a1,a2,om,seg,arg1mask,arg2mask;
|
||||
CAsmArg *tempa1,*tempa2;
|
||||
Bool ModrM_complete,U8_avail=FALSE,found_second_possible=FALSE;
|
||||
CInstruction *tempi;
|
||||
CInst *tempi;
|
||||
|
||||
CAsmIns cur,best;
|
||||
best.U8_cnt=255;
|
||||
@@ -406,12 +406,12 @@ Bool PrsAsmInstruction(CCmpCtrl *cc,CHashOpcode *tempo,I64 argcnt)
|
||||
arg2mask=AsmMakeArgMask(cc,&aotc->arg2);
|
||||
else
|
||||
arg2mask=1;
|
||||
for (i=0;i<tempo->instruction_entry_cnt;i++) {
|
||||
for (i=0;i<tempo->inst_entry_cnt;i++) {
|
||||
tempi=&tempo->ins[i];
|
||||
if (tempi->arg1==ARGT_REL8 || tempi->arg2==ARGT_REL8)
|
||||
U8_avail=TRUE;
|
||||
if (Bt(&arg1mask,tempi->arg1) && Bt(&arg2mask,tempi->arg2) &&
|
||||
(!(tempi->flags&IEF_NOT_IN_64_BIT) || aotc->seg_size!=64)) {
|
||||
(!(tempi->flags&IEF_NOT_IN_64_BIT) || aotc->seg_size!=64)) {
|
||||
MemSet(&cur,0,sizeof(CAsmIns));
|
||||
cur.tempi=tempi;
|
||||
ModrM_complete=FALSE;
|
||||
@@ -559,8 +559,7 @@ Bool PrsAsmInstruction(CCmpCtrl *cc,CHashOpcode *tempo,I64 argcnt)
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (ARGT_REL8<=a1<=ARGT_REL32 ||
|
||||
ARGT_IMM8<=a1<=ARGT_IMM64 ||
|
||||
} else if (ARGT_REL8<=a1<=ARGT_REL32 || ARGT_IMM8<=a1<=ARGT_IMM64 ||
|
||||
ARGT_UIMM8<=a1<=ARGT_UIMM64) {
|
||||
if (a1==ARGT_IMM64 || a2==ARGT_UIMM64)
|
||||
cur.REX|=8;
|
||||
@@ -596,12 +595,11 @@ Bool PrsAsmInstruction(CCmpCtrl *cc,CHashOpcode *tempo,I64 argcnt)
|
||||
cur.last_opcode_U8|=tempa2->fstk;
|
||||
}
|
||||
}
|
||||
if (a1==ARGT_RM64 || a2==ARGT_RM64 ||
|
||||
a1==ARGT_M64 || a2==ARGT_M64 ||
|
||||
if (a1==ARGT_RM64 || a2==ARGT_RM64 || a1==ARGT_M64 || a2==ARGT_M64 ||
|
||||
a1==ARGT_R64 || a2==ARGT_R64)
|
||||
cur.REX|=8;
|
||||
if (ARGT_RM8<=a1<=ARGT_RM64 || ARGT_RM8<=a2<=ARGT_RM64 ||
|
||||
ARGT_M8 <=a1<=ARGT_M64 || ARGT_M8 <=a2<=ARGT_M64) {
|
||||
ARGT_M8<=a1<=ARGT_M64 || ARGT_M8<=a2<=ARGT_M64) {
|
||||
if (aotc->seg_size==16)
|
||||
cur.has_addr_prefix=TRUE;
|
||||
cur.has_ModrM=TRUE;
|
||||
@@ -801,11 +799,11 @@ Bool PrsAsmInstruction(CCmpCtrl *cc,CHashOpcode *tempo,I64 argcnt)
|
||||
if (!AsmStoreNum(cc,&best.imm,1,U8_avail))
|
||||
return FALSE;
|
||||
}
|
||||
if (tempi->flags&IEF_ENDING_ZERO) //ENTER instruction
|
||||
if (tempi->flags&IEF_ENDING_ZERO) //ENTER inst
|
||||
AOTStoreCodeU8(cc,0);
|
||||
return TRUE;
|
||||
}
|
||||
LexExcept(cc,"invalid instruction at ");
|
||||
LexExcept(cc,"Invalid inst at ");
|
||||
}
|
||||
|
||||
U0 PrsAsmDefine(CCmpCtrl *cc,I64 U8_cnt)
|
||||
@@ -853,11 +851,11 @@ U0 PrsAsmDefine(CCmpCtrl *cc,I64 U8_cnt)
|
||||
cc->hash_entry->user_data0==AKW_DUP) {
|
||||
is_dup=TRUE;
|
||||
if (Lex(cc)!='(')
|
||||
LexExcept(cc,"expecting '(' at ");
|
||||
LexExcept(cc,"Expecting '(' at ");
|
||||
Lex(cc); //skip (
|
||||
dup_val=AsmLexExpression(cc);
|
||||
if (cc->token!=')')
|
||||
LexExcept(cc,"expecting ')' at ");
|
||||
LexExcept(cc,"Expecting ')' at ");
|
||||
Lex(cc); //SKIP )
|
||||
}
|
||||
}
|
||||
@@ -866,7 +864,7 @@ U0 PrsAsmDefine(CCmpCtrl *cc,I64 U8_cnt)
|
||||
num2.num.abs_cnts=cc->abs_cnts;
|
||||
if (is_dup) {
|
||||
if (num2.num.local_asm_undef_hash || num2.num.glbl_asm_undef_hash)
|
||||
LexExcept(cc,"undefined DUP cnt at ");
|
||||
LexExcept(cc,"Undefined DUP cnt at ");
|
||||
num2.num.i=dup_val;
|
||||
AsmStoreNum(cc,&num2,i,FALSE);
|
||||
} else {
|
||||
@@ -878,7 +876,7 @@ U0 PrsAsmDefine(CCmpCtrl *cc,I64 U8_cnt)
|
||||
Lex(cc);
|
||||
}
|
||||
if (cc->token!=';')
|
||||
LexExcept(cc,"missing ';' at");
|
||||
LexExcept(cc,"Missing ';' at");
|
||||
Lex(cc);
|
||||
}
|
||||
|
||||
@@ -887,14 +885,14 @@ U0 PrsBinFile(CCmpCtrl *cc)
|
||||
I64 i,size;
|
||||
U8 *buf,*st;
|
||||
if (cc->token!=TK_STR)
|
||||
LexExcept(cc,"expecting string at ");
|
||||
LexExcept(cc,"Expecting string at ");
|
||||
st=DftExt(cc->cur_str,"BIN");
|
||||
buf=FileRead(st,&size);
|
||||
Free(st);
|
||||
for (i=0;i<size;i++)
|
||||
AOTStoreCodeU8(cc,buf[i]);
|
||||
if (Lex(cc)!=';')
|
||||
LexExcept(cc,"missing ';' at");
|
||||
LexExcept(cc,"Missing ';' at");
|
||||
Lex(cc);
|
||||
}
|
||||
|
||||
@@ -912,7 +910,7 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
cc->flags|=CCF_ASM_EXPRESSIONS;
|
||||
if (!(cmp_flags&CMPF_ONE_ASM_INS)) {
|
||||
if (cc->token!='{')
|
||||
LexExcept(cc,"expecting '{' at ");
|
||||
LexExcept(cc,"Expecting '{' at ");
|
||||
Lex(cc);
|
||||
}
|
||||
while (cc->token && cc->token!='}') {
|
||||
@@ -925,7 +923,7 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
case AKW_IMPORT:
|
||||
while (cc->token && cc->token!=';') {
|
||||
if (cc->token!=TK_IDENT)
|
||||
LexExcept(cc,"expecting identifier at ");
|
||||
LexExcept(cc,"Expecting identifier at ");
|
||||
else {
|
||||
tempex=NULL;
|
||||
tempex=CAlloc(sizeof(CHashExport));
|
||||
@@ -939,7 +937,7 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
}
|
||||
}
|
||||
if (cc->token!=';')
|
||||
LexExcept(cc,"missing ';' at");
|
||||
LexExcept(cc,"Missing ';' at");
|
||||
Lex(cc); //skip ';';
|
||||
break;
|
||||
case AKW_MODULE_ORG:
|
||||
@@ -963,7 +961,7 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
if (j>aotc->max_align_bits) aotc->max_align_bits=j;
|
||||
i=CeilU64(aotc->ip,i);
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"expecting ',' at ");
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
Lex(cc);
|
||||
k=AsmLexExpression(cc);
|
||||
for (j=aotc->ip;j<i;j++)
|
||||
@@ -1000,7 +998,7 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
aotc->seg_size=64;
|
||||
break;
|
||||
default:
|
||||
LexExcept(cc,"syntax error at ");
|
||||
LexExcept(cc,"Syntax error at ");
|
||||
}
|
||||
} else if (cc->hash_entry->type & HTT_OPCODE) {
|
||||
tempo=cc->hash_entry;
|
||||
@@ -1015,7 +1013,7 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
if (tempo->ins[0].arg2) {
|
||||
argcnt++;
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"expecting ',' at ");
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
else {
|
||||
Lex(cc); //skip ','
|
||||
if (ARGT_REL8<=tempo->ins[0].arg2<=ARGT_REL32)
|
||||
@@ -1025,13 +1023,13 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
}
|
||||
}
|
||||
}
|
||||
PrsAsmInstruction(cc,tempo,argcnt);
|
||||
PrsAsmInst(cc,tempo,argcnt);
|
||||
} else if (cc->hash_entry->type & HTT_EXPORT_SYS_SYM) {
|
||||
if (Btr(&cc->hash_entry->type,HTf_UNRESOLVED)) {
|
||||
if (cc->hash_entry->type & HTF_LOCAL) {
|
||||
cc->hash_entry(CHashExport *)->val=aotc->ip;
|
||||
if (Lex(cc)!=':')
|
||||
LexExcept(cc,"expecting ':' at ");
|
||||
LexExcept(cc,"Expecting ':' at ");
|
||||
Lex(cc);
|
||||
} else {
|
||||
if (cc->hash_entry->type & HTF_IMPORT)
|
||||
@@ -1040,7 +1038,7 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
next_last_label=cc->hash_entry->str;
|
||||
Lex(cc); //Skip cur_str
|
||||
if (cc->token!=':' && cc->token!=TK_DBL_COLON)
|
||||
LexExcept(cc,"expecting ':' at ");
|
||||
LexExcept(cc,"Expecting ':' at ");
|
||||
if (cc->token==TK_DBL_COLON) {
|
||||
cc->hash_entry->type|=HTF_EXPORT;
|
||||
HashSrcFileSet(cc,cc->hash_entry);
|
||||
@@ -1053,12 +1051,12 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
} else if (cc->hash_entry(CHashExport *)->val==aotc->ip) {
|
||||
Lex(cc); //Skip cur_str
|
||||
if (cc->token!=':' && cc->token!=TK_DBL_COLON)
|
||||
LexExcept(cc,"expecting ':' at ");
|
||||
LexExcept(cc,"Expecting ':' at ");
|
||||
Lex(cc);
|
||||
} else
|
||||
LexExcept(cc,"redefinition at ");
|
||||
LexExcept(cc,"Redefinition at ");
|
||||
} else
|
||||
LexExcept(cc,"syntax error at ");
|
||||
LexExcept(cc,"Syntax error at ");
|
||||
} else if (cc->token==TK_IDENT) {
|
||||
tempex=CAlloc(sizeof(CHashExport));
|
||||
tempex->str=cc->cur_str;
|
||||
@@ -1067,11 +1065,11 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
tempex->val=aotc->ip;
|
||||
Lex(cc); //Skip cur_str
|
||||
if (cc->token!=':' && cc->token!=TK_DBL_COLON)
|
||||
LexExcept(cc,"expecting ':' at ");
|
||||
LexExcept(cc,"Expecting ':' at ");
|
||||
else {
|
||||
if (*tempex->str=='@' && tempex->str[1]=='@') {
|
||||
if (cc->token==TK_DBL_COLON)
|
||||
LexExcept(cc,"no local glbl exports at ");
|
||||
LexExcept(cc,"No local glbl exports at ");
|
||||
HashAdd(tempex,cc->htc.local_hash_table);
|
||||
} else
|
||||
HashAdd(tempex,cc->htc.glbl_hash_table);
|
||||
@@ -1099,7 +1097,7 @@ U0 PrsAsmBlk(CCmpCtrl *cc,I64 cmp_flags)
|
||||
} else if (cc->token==';')
|
||||
Lex(cc);
|
||||
else
|
||||
LexExcept(cc,"syntax error at ");
|
||||
LexExcept(cc,"Syntax error at ");
|
||||
if (cmp_flags&CMPF_ONE_ASM_INS && (cc->token!=TK_IDENT ||
|
||||
!(tempo=cc->hash_entry) ||
|
||||
!(tempo->type&(HTT_OPCODE|HTT_ASM_KEYWORD))))
|
||||
|
||||
+59
-54
@@ -1,4 +1,4 @@
|
||||
U0 AsmPrsInsFlags(CCmpCtrl *cc,CInstruction *tempi)
|
||||
U0 AsmPrsInsFlags(CCmpCtrl *cc,CInst *tempi)
|
||||
{
|
||||
I64 i;
|
||||
while (TRUE) {
|
||||
@@ -9,7 +9,7 @@ U0 AsmPrsInsFlags(CCmpCtrl *cc,CInstruction *tempi)
|
||||
break;
|
||||
} else
|
||||
return;
|
||||
case TK_INTEGER:
|
||||
case TK_INT:
|
||||
if (cc->cur_i64==16)
|
||||
tempi->flags|=IEF_OP_SIZE16;
|
||||
else if (cc->cur_i64==32)
|
||||
@@ -20,7 +20,7 @@ U0 AsmPrsInsFlags(CCmpCtrl *cc,CInstruction *tempi)
|
||||
case '+':
|
||||
tempi->flags|=IEF_PLUS_OPCODE;
|
||||
case '/':
|
||||
if (Lex(cc)==TK_INTEGER && cc->cur_i64<8)
|
||||
if (Lex(cc)==TK_INT && cc->cur_i64<8)
|
||||
tempi->slash_val=cc->cur_i64;
|
||||
else if (cc->token==TK_IDENT) {
|
||||
if (!StrCmp(cc->cur_str,"R"))
|
||||
@@ -49,13 +49,13 @@ U0 AsmPrsInsFlags(CCmpCtrl *cc,CInstruction *tempi)
|
||||
|
||||
U0 AsmHashLoad()
|
||||
{//See $LK,"::/Compiler/OpCodes.TXT"$.
|
||||
I64 i,j,size,size1;
|
||||
I64 i,j,size,size_max;
|
||||
CInternalType *tempit;
|
||||
CCmpCtrl *cc;
|
||||
CHashGeneric *temph;
|
||||
CHashReg *tempr;
|
||||
CHashOpcode *tempo,*tempo1;
|
||||
CInstruction *tempi;
|
||||
CHashOpcode *tempo,*tempo2,*tempo_max;
|
||||
CInst *tempi;
|
||||
CHashClass *tempc;
|
||||
|
||||
cmp.size_arg_mask[0]=0x3FF0FFFFFE;
|
||||
@@ -65,42 +65,57 @@ U0 AsmHashLoad()
|
||||
cmp.size_arg_mask[8]=0x0880888880;
|
||||
|
||||
cmp.asm_hash=HashTableNew(1024);
|
||||
size1=offset(CHashOpcode.ins)+sizeof(CInstruction)<<5;
|
||||
tempo=MAlloc(size1);
|
||||
size_max=offset(CHashOpcode.ins)+sizeof(CInst)<<5;
|
||||
tempo_max=MAlloc(size_max);
|
||||
|
||||
cc=CmpCtrlNew(FileRead("OpCodes.TXT"),,"OpCodes.TXT.Z");
|
||||
cc->htc.hash_table_lst=NULL;
|
||||
Lex(cc);
|
||||
while (cc->token) {
|
||||
if (cc->token!=TK_IDENT)
|
||||
LexExcept(cc,"expecting identifier at ");
|
||||
LexExcept(cc,"Expecting identifier at ");
|
||||
i=LstMatch(cc->cur_str,"R8\0R16\0R32\0R64\0SEG\0FSTK\0"
|
||||
"MM\0XMM\0OPCODE\0KEYWORD\0ASM_KEYWORD\0");
|
||||
if (i<0)
|
||||
LexExcept(cc,"Unknown Stmt");
|
||||
Lex(cc); //skip keyword
|
||||
if (cc->token!=TK_IDENT)
|
||||
LexExcept(cc,"expecting identifier at ");
|
||||
LexExcept(cc,"Expecting identifier at ");
|
||||
switch (i) {
|
||||
case 8: //OPCODE
|
||||
MemSet(tempo,0,size1);
|
||||
tempo->type=HTT_OPCODE;
|
||||
tempo->instruction_entry_cnt=0;
|
||||
tempo->str=cc->cur_str;
|
||||
case REGT_R8...REGT_XMM:
|
||||
tempr=CAlloc(sizeof(CHashReg));
|
||||
tempr->str=cc->cur_str;
|
||||
cc->cur_str=NULL;
|
||||
Lex(cc); //skip keyword name
|
||||
if (cc->token!=TK_INT)
|
||||
LexExcept(cc,"Expecting int at ");
|
||||
tempr->type=HTT_REG;
|
||||
tempr->reg_type=i;
|
||||
tempr->reg_num=cc->cur_i64;
|
||||
HashAdd(tempr,cmp.asm_hash);
|
||||
Lex(cc); //Skip INT
|
||||
break;
|
||||
case: //OPCODE
|
||||
if (cc->token!=TK_IDENT)
|
||||
LexExcept(cc,"Expecting opcode at ");
|
||||
MemSet(tempo_max,0,size_max);
|
||||
tempo_max->type=HTT_OPCODE;
|
||||
tempo_max->inst_entry_cnt=0;
|
||||
tempo_max->str=cc->cur_str;
|
||||
cc->cur_str=0;
|
||||
Lex(cc); //Skip OPCODE
|
||||
while (cc->token && cc->token!=';') {
|
||||
tempi=&tempo->ins[tempo->instruction_entry_cnt];
|
||||
tempi->ins_entry_num=tempo->instruction_entry_cnt++;
|
||||
while (cc->token && cc->token!=';' && cc->token!=':') {
|
||||
tempi=&tempo_max->ins[tempo_max->inst_entry_cnt];
|
||||
tempi->ins_entry_num=tempo_max->inst_entry_cnt++;
|
||||
tempi->slash_val=SV_NONE; //Not zero!!
|
||||
while (cc->token==TK_INTEGER) {
|
||||
while (cc->token==TK_INT) {
|
||||
tempi->opcode[tempi->opcode_cnt++]=cc->cur_i64;
|
||||
Lex(cc);
|
||||
}
|
||||
if (cc->token==',')
|
||||
Lex(cc);
|
||||
else if (cc->token!=';')
|
||||
LexExcept(cc,"expecting ',' at ");
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
|
||||
AsmPrsInsFlags(cc,tempi);
|
||||
|
||||
@@ -136,24 +151,34 @@ U0 AsmHashLoad()
|
||||
}
|
||||
}
|
||||
}
|
||||
size=offset(CHashOpcode.ins)+
|
||||
sizeof(CInstruction)*tempo->instruction_entry_cnt;
|
||||
|
||||
tempo1=MAlloc(size);
|
||||
MemCpy(tempo1,tempo,size);
|
||||
tempo1->use_cnt=0;
|
||||
if (HashFind(tempo1->str,cmp.asm_hash,HTT_OPCODE))
|
||||
size=offset(CHashOpcode.ins)+sizeof(CInst)*tempo_max->inst_entry_cnt;
|
||||
tempo=MAlloc(size);
|
||||
MemCpy(tempo,tempo_max,size);
|
||||
tempo->use_cnt=0;
|
||||
if (HashFind(tempo->str,cmp.asm_hash,HTT_OPCODE))
|
||||
LexExcept(cc,"Duplicate OPCODE entry ");
|
||||
HashAdd(tempo1,cmp.asm_hash);
|
||||
HashAdd(tempo,cmp.asm_hash);
|
||||
//Parse aliases.
|
||||
if (cc->token==':') {
|
||||
while (Lex(cc)==TK_IDENT) {
|
||||
tempo2=MAllocIdentical(tempo);
|
||||
tempo2->str=cc->cur_str;
|
||||
cc->cur_str=0;
|
||||
tempo2->oc_flags|=OCF_ALIAS;
|
||||
if (HashFind(tempo2->str,cmp.asm_hash,HTT_OPCODE))
|
||||
LexExcept(cc,"Duplicate OPCODE ALIAS entry ");
|
||||
HashAdd(tempo2,cmp.asm_hash);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 9: //KEYWORD
|
||||
case 10: //ASM_KEYWORD
|
||||
case: //KEYWORD
|
||||
case: //ASM_KEYWORD
|
||||
temph=CAlloc(sizeof(CHashGeneric));
|
||||
temph->str=cc->cur_str;
|
||||
cc->cur_str=NULL;
|
||||
Lex(cc); //skip keyword name
|
||||
if (cc->token!=TK_INTEGER)
|
||||
LexExcept(cc,"expecting integer at ");
|
||||
if (cc->token!=TK_INT)
|
||||
LexExcept(cc,"Expecting int at ");
|
||||
temph->user_data0=cc->cur_i64;
|
||||
if (i==9)
|
||||
temph->type=HTT_KEYWORD;
|
||||
@@ -162,32 +187,12 @@ U0 AsmHashLoad()
|
||||
HashAdd(temph,cmp.asm_hash);
|
||||
Lex(cc); //Skip INT
|
||||
break;
|
||||
case REGT_R8:
|
||||
case REGT_R16:
|
||||
case REGT_R32:
|
||||
case REGT_R64:
|
||||
case REGT_SEG:
|
||||
case REGT_FSTK:
|
||||
case REGT_MM:
|
||||
case REGT_XMM:
|
||||
tempr=CAlloc(sizeof(CHashReg));
|
||||
tempr->str=cc->cur_str;
|
||||
cc->cur_str=NULL;
|
||||
Lex(cc); //skip keyword name
|
||||
if (cc->token!=TK_INTEGER)
|
||||
LexExcept(cc,"expecting integer at ");
|
||||
tempr->type=HTT_REG;
|
||||
tempr->reg_type=i;
|
||||
tempr->reg_num=cc->cur_i64;
|
||||
HashAdd(tempr,cmp.asm_hash);
|
||||
Lex(cc); //Skip INT
|
||||
break;
|
||||
}
|
||||
if (cc->token!=';')
|
||||
LexExcept(cc,"missing ';' at");
|
||||
LexExcept(cc,"Missing ';' at");
|
||||
Lex(cc); //Skip ';'
|
||||
}
|
||||
Free(tempo);
|
||||
Free(tempo_max);
|
||||
CmpCtrlDel(cc);
|
||||
for (i=0;i<NUM_INTERNAL_TYPES;i++) {
|
||||
tempit=&internal_types_table[i];
|
||||
|
||||
+3
-5
@@ -30,8 +30,7 @@ U0 AOTStoreCodeU8(CCmpCtrl *cc,U8 b)
|
||||
U0 AOTStoreCodeU32(CCmpCtrl *cc,U32 d)
|
||||
{
|
||||
CAOTCtrl *aotc=cc->aotc;
|
||||
I64 i=aotc->ip>>AOT_BIN_BLK_BITS,
|
||||
j=(aotc->ip+sizeof(U32))>>AOT_BIN_BLK_BITS;
|
||||
I64 i=aotc->ip>>AOT_BIN_BLK_BITS,j=(aotc->ip+sizeof(U32))>>AOT_BIN_BLK_BITS;
|
||||
U32 *_d;
|
||||
CAOTBinBlk *tempbin;
|
||||
if (i!=j)
|
||||
@@ -69,8 +68,7 @@ U0 AOTStoreCodeU32(CCmpCtrl *cc,U32 d)
|
||||
U0 AOTStoreCodeU64(CCmpCtrl *cc,U64 q)
|
||||
{
|
||||
CAOTCtrl *aotc=cc->aotc;
|
||||
I64 i=aotc->ip>>AOT_BIN_BLK_BITS,
|
||||
j=(aotc->ip+sizeof(I64))>>AOT_BIN_BLK_BITS,
|
||||
I64 i=aotc->ip>>AOT_BIN_BLK_BITS,j=(aotc->ip+sizeof(I64))>>AOT_BIN_BLK_BITS,
|
||||
*_q;
|
||||
CAOTBinBlk *tempbin;
|
||||
if (i!=j)
|
||||
@@ -139,7 +137,7 @@ I64 AsmLexExpression(CCmpCtrl *cc)
|
||||
if (cc->abs_cnts.externs)
|
||||
LexExcept(cc,"Extern Not Allowed at ");
|
||||
if (cc->flags & CCF_UNRESOLVED)
|
||||
LexExcept(cc,"undefined sym at ");
|
||||
LexExcept(cc,"Undefined sym at ");
|
||||
result=Call(machine_code);
|
||||
Free(machine_code);
|
||||
}
|
||||
|
||||
@@ -16,11 +16,11 @@ U0 AsmResolve(CCmpCtrl *cc,CAsmUnresolvedRef *tempu,U8 *label,Bool undefined)
|
||||
}
|
||||
tempauh=tempauh->next; //Technically, more than one won't work.
|
||||
}
|
||||
} else if (!(tempu->type&1)) {//Rel?
|
||||
} else if (!(tempu->type&IEF_IMM_NOT_REL)) {
|
||||
r-=tempu->rel_ip;
|
||||
if (tempu->type==IET_REL_I8 && !(MIN_I8<=r<=MAX_I8) ||
|
||||
tempu->type==IET_REL_I16 && !(MIN_I16<=r<=MAX_I16)) {
|
||||
PrintErr("branch out of range at line:%04d %s\n",
|
||||
PrintErr("Branch out of range at line:%04d %s\n",
|
||||
tempu->line_num,label);
|
||||
LexExcept(cc);
|
||||
}
|
||||
@@ -53,7 +53,7 @@ U0 AOTLocalsResolve(CCmpCtrl *cc)
|
||||
tempauh=tempu->asm_undef_hash;
|
||||
while (tempauh) {
|
||||
if (tempauh->hash->type & HTF_UNRESOLVED) {
|
||||
PrintErr("undefined sym at line:%04d %s %s\n",
|
||||
PrintErr("Undefined sym at line:%04d %s %s\n",
|
||||
tempu->line_num,aotc->last_label,tempauh->hash->str);
|
||||
LexExcept(cc);
|
||||
}
|
||||
@@ -94,8 +94,7 @@ U0 AOTGlblsResolve(CCmpCtrl *cc,CAOT *tempaot)
|
||||
while (tempauh) {
|
||||
if (tempauh->hash->type & HTF_UNRESOLVED) {
|
||||
tempex=tempauh->hash;
|
||||
if (tempex->type & HTT_EXPORT_SYS_SYM &&
|
||||
tempex->type & HTF_UNRESOLVED &&
|
||||
if (tempex->type & HTT_EXPORT_SYS_SYM&& tempex->type & HTF_UNRESOLVED &&
|
||||
!(tempex->type & HTF_IMPORT) &&
|
||||
(tempf=HashFind(tempex->str,cc->htc.hash_table_lst,HTT_FUN)) &&
|
||||
!Bt(&tempf->flags,Cf_EXTERN)) {
|
||||
@@ -108,7 +107,7 @@ U0 AOTGlblsResolve(CCmpCtrl *cc,CAOT *tempaot)
|
||||
tempex->type|=HTF_GOTO_LABEL;
|
||||
tempex->use_cnt++;
|
||||
} else {
|
||||
PrintErr("undefined sym at line:%04d %s\n",
|
||||
PrintErr("Undefined sym at line:%04d %s\n",
|
||||
tempu->line_num,tempex->str);
|
||||
LexExcept(cc);
|
||||
}
|
||||
@@ -150,7 +149,7 @@ U0 AOTGlblsResolve(CCmpCtrl *cc,CAOT *tempaot)
|
||||
}
|
||||
} else if (tempex->type & (HTF_EXPORT|HTF_RESOLVE)) {
|
||||
if (tempex->type & HTF_UNRESOLVED) {
|
||||
PrintErr("undefined sym at %s\n",tempex->str);
|
||||
PrintErr("Undefined sym at %s\n",tempex->str);
|
||||
LexExcept(cc);
|
||||
}
|
||||
if (tempex->type & HTF_RESOLVE) {
|
||||
|
||||
+227
-330
@@ -1,5 +1,5 @@
|
||||
U0 ICAddEct(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
I64 t2,I64 r2,I64 d2,I64 t3,I64 r3,I64 d3,I64 op,I64 ip)
|
||||
U0 ICAddEct(CIntermediateCode *tempi,CICType t1,I64 r1,I64 d1,
|
||||
CICType t2,I64 r2,I64 d2,CICType t3,I64 r3,I64 d3,I64 op,I64 ip)
|
||||
{
|
||||
I64 i,temp,result_reg=REG_RAX;
|
||||
Bool swap=FALSE;
|
||||
@@ -9,11 +9,10 @@ U0 ICAddEct(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
SwapI64(&r2,&r3);
|
||||
SwapI64(&d2,&d3);
|
||||
}
|
||||
if (t2&RT_MASK>=RT_I64 && r2!=result_reg &&
|
||||
TY_REG<=t2&TY_MASK<=TY_RIP_DISP32) {
|
||||
if (t1&TY_MASK==TY_REG && !(r2==r1 && TY_REG<=t2&TY_MASK<=TY_SIB))
|
||||
if (t2.raw_type>=RT_I64 && r2!=result_reg && t2&MDG_REG_DISP_SIB_RIP) {
|
||||
if (t1&MDF_REG && !(r2==r1 && t2&MDG_REG_DISP_SIB))
|
||||
result_reg=r1;
|
||||
ICMov(tempi,TY_REG+RT_I64,result_reg,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,result_reg,0,t3,r3,d3,ip);
|
||||
i=ICModr1(result_reg,t2,r2,d2);
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
@@ -21,26 +20,26 @@ U0 ICAddEct(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
ICU16(tempi,i.u8[2]<<8+op);
|
||||
ICModr2(tempi,i,d2,ip+4);
|
||||
} else {
|
||||
if (t2&TY_MASK==TY_REG)
|
||||
if (t2&MDF_REG)
|
||||
temp=r2;
|
||||
else
|
||||
temp=REG_RCX;
|
||||
|
||||
if (t1&TY_MASK==TY_REG)
|
||||
if (t1&MDF_REG)
|
||||
result_reg=r1;
|
||||
|
||||
if (temp==result_reg)
|
||||
result_reg=REG_RDX;
|
||||
if (swap ^^ tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (r3==temp && TY_REG<=t3&TY_MASK<=TY_SIB)
|
||||
if (swap) {
|
||||
if (r3==temp && t3&MDG_REG_DISP_SIB)
|
||||
temp=REG_RCX;
|
||||
ICMov(tempi,TY_REG+RT_I64,temp,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,result_reg,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,temp,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,result_reg,0,t3,r3,d3,ip);
|
||||
} else {
|
||||
if (r2==result_reg && TY_REG<=t2&TY_MASK<=TY_SIB)
|
||||
if (r2==result_reg && t2&MDG_REG_DISP_SIB)
|
||||
result_reg=REG_RDX;
|
||||
ICMov(tempi,TY_REG+RT_I64,result_reg,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,temp,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,result_reg,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,temp,0,t2,r2,d2,ip);
|
||||
}
|
||||
i=0x48;
|
||||
if (result_reg>7)
|
||||
@@ -51,19 +50,19 @@ U0 ICAddEct(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
ICU24(tempi,0xC00000+i+(temp&7)<<16+(result_reg&7)<<19+op<<8);
|
||||
}
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,result_reg,0,ip);
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,result_reg,0,ip);
|
||||
}
|
||||
|
||||
U0 ICAddSubEctImm(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
I64 t2,I64 r2,I64 d2,I64 d,I64 op,I64 ip)
|
||||
U0 ICAddSubEctImm(CIntermediateCode *tempi,CICType t1,I64 r1,I64 d1,
|
||||
CICType t2,I64 r2,I64 d2,I64 d,I64 op,I64 ip)
|
||||
{
|
||||
I64 i,r;
|
||||
if (op.u8[0]==0x2B) {
|
||||
op=0x0003;
|
||||
d=-d;
|
||||
}
|
||||
if (t1&TY_MASK==TY_REG) {
|
||||
if (t2&TY_MASK!=TY_REG) {
|
||||
if (t1&MDF_REG) {
|
||||
if (!(t2&MDF_REG)) {
|
||||
ICMov(tempi,t1,r1,d1,t2,r2,d2,ip);
|
||||
t2=t1;
|
||||
r2=r1;
|
||||
@@ -95,18 +94,18 @@ U0 ICAddSubEctImm(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
}
|
||||
if (op.u8[0]==0x03 && MIN_I32<=d<=MAX_I32 &&
|
||||
!Bt(&cmp.non_ptr_vars_mask,r2)) {
|
||||
i=ICModr1(r1,TY_DISP+RT_I64,r2,d);
|
||||
i=ICModr1(r1,MDF_DISP+RT_I64,r2,d);
|
||||
i.u8[1]|=0x48;
|
||||
ICU24(tempi,i.u8[2]<<16+0x8D00+i.u8[1]);
|
||||
ICModr2(tempi,i,d,ip+4);
|
||||
return;
|
||||
}
|
||||
}
|
||||
switch (t1>>4) {
|
||||
case TY_REG>>4:
|
||||
case TY_DISP>>4:
|
||||
case TY_SIB>>4:
|
||||
case TY_RIP_DISP32>>4:
|
||||
switch (Bsr(t1)) {
|
||||
case MDf_REG:
|
||||
case MDf_DISP:
|
||||
case MDf_SIB:
|
||||
case MDf_RIP_DISP32:
|
||||
if (t1!=t2 || r1!=r2 || d1!=d2) {
|
||||
ICMov(tempi,t1,r1,d1,t2,r2,d2,ip);
|
||||
t2=t1;
|
||||
@@ -114,8 +113,7 @@ U0 ICAddSubEctImm(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
d2=d1;
|
||||
}
|
||||
|
||||
if (!d &&
|
||||
(op.u8[0]==0x03||op.u8[0]==0x2B||op.u8[0]==0x33||op.u8[0]==0x0B))
|
||||
if (!d &&(op.u8[0]==0x03||op.u8[0]==0x2B||op.u8[0]==0x33||op.u8[0]==0x0B))
|
||||
return;
|
||||
r=op.u8[1]; //not a reg but a slash val
|
||||
if (op.u8[0]==0x03 && d==-1) //add -1
|
||||
@@ -123,9 +121,9 @@ U0 ICAddSubEctImm(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
|
||||
if (op.u8[0]==0x03 && (d==1 || d==-1)) { //Add
|
||||
i=ICModr1(r,t1,r1,d1);
|
||||
if (t1!=TY_REG && tempi->ic_flags&ICF_LOCK)
|
||||
if (!(t1&MDF_REG) && tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
switch (t1&RT_MASK) {
|
||||
switch (t1.raw_type) {
|
||||
case RT_I8:
|
||||
case RT_U8:
|
||||
ICRex(tempi,i.u8[1]);
|
||||
@@ -143,11 +141,11 @@ U0 ICAddSubEctImm(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
ICModr2(tempi,i,d1,ip+4);
|
||||
return;
|
||||
}
|
||||
if (MIN_I8<=d<=MAX_I8 || t1&(RT_MASK-1)==RT_I8) {
|
||||
if (MIN_I8<=d<=MAX_I8 || t1&(RTG_MASK-RTF_UNSIGNED)==RT_I8) {
|
||||
i=ICModr1(r,t1,r1,d1);
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
switch (t1&RT_MASK) {
|
||||
switch (t1.raw_type) {
|
||||
case RT_I8:
|
||||
case RT_U8:
|
||||
ICRex(tempi,i.u8[1]);
|
||||
@@ -166,11 +164,11 @@ U0 ICAddSubEctImm(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
ICU8(tempi,d);
|
||||
return;
|
||||
}
|
||||
if (MIN_I32<=d<=MAX_I32 || t1&RT_MASK<RT_I64) {
|
||||
if (MIN_I32<=d<=MAX_I32 || t1.raw_type<RT_I64) {
|
||||
i=ICModr1(r,t1,r1,d1);
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
switch (t1&RT_MASK) {
|
||||
switch (t1.raw_type) {
|
||||
case RT_I16:
|
||||
case RT_U16:
|
||||
ICOpSizeRex(tempi,i.u8[1]);
|
||||
@@ -180,32 +178,32 @@ U0 ICAddSubEctImm(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
ICRex(tempi,i.u8[1]);
|
||||
ICU16(tempi,i.u8[2]<<8+0x81);
|
||||
}
|
||||
if (i.u8[0]!=MDR_RIP_REL)
|
||||
if (i.u8[0]!=MODR_RIP_REL)
|
||||
ICModr2(tempi,i,d1,);
|
||||
else {
|
||||
if (t1&(RT_MASK-1)==RT_I16)
|
||||
if (t1&(RTG_MASK-RTF_UNSIGNED)==RT_I16)
|
||||
ICU32(tempi,d1-(ip+tempi->ic_cnt+6));
|
||||
else
|
||||
ICU32(tempi,d1-(ip+tempi->ic_cnt+8));
|
||||
tempi->ic_flags&=~ICF_CODE_FINAL;
|
||||
}
|
||||
if (t1&(RT_MASK-1)==RT_I16)
|
||||
if (t1&(RTG_MASK-RTF_UNSIGNED)==RT_I16)
|
||||
ICU16(tempi,d);
|
||||
else
|
||||
ICU32(tempi,d);
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case TY_STK>>4:
|
||||
ICAddSubEctImm(tempi,TY_REG+RT_I64,REG_RAX,0,t2,r2,d2,d,op,ip);
|
||||
case MDf_STK:
|
||||
ICAddSubEctImm(tempi,MDF_REG+RT_I64,REG_RAX,0,t2,r2,d2,d,op,ip);
|
||||
ICPushRegs(tempi,1<<REG_RAX);
|
||||
return;
|
||||
}
|
||||
ICAddEct(tempi,t1,r1,d1,TY_IMM+RT_I64,0,d,t2,r2,d2,op.u8[0],ip);
|
||||
ICAddEct(tempi,t1,r1,d1,MDF_IMM+RT_I64,0,d,t2,r2,d2,op.u8[0],ip);
|
||||
}
|
||||
|
||||
U0 ICSub(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
I64 t2,I64 r2,I64 d2,I64 t3,I64 r3,I64 d3,I64 ip)
|
||||
U0 ICSub(CIntermediateCode *tempi,CICType t1,I64 r1,I64 d1,
|
||||
CICType t2,I64 r2,I64 d2,CICType t3,I64 r3,I64 d3,I64 ip)
|
||||
{
|
||||
I64 i=0x48,op=0x2B;
|
||||
Bool swap=FALSE;
|
||||
@@ -215,10 +213,9 @@ U0 ICSub(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
SwapI64(&r2,&r3);
|
||||
SwapI64(&d2,&d3);
|
||||
}
|
||||
if (t2&RT_MASK>=RT_I64 && r2.u8[0]!=REG_RAX &&
|
||||
(t2&TY_MASK!=TY_SIB || r2.u8[1]&15!=REG_RAX) &&
|
||||
TY_REG<=t2&TY_MASK<=TY_RIP_DISP32) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
if (t2.raw_type>=RT_I64 && r2.u8[0]!=REG_RAX &&
|
||||
(!(t2&MDF_SIB) || r2.u8[1]&15!=REG_RAX) && t2&MDG_REG_DISP_SIB_RIP) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
if (!swap) {
|
||||
op=0x03;
|
||||
ICU24(tempi,0xD8F748);
|
||||
@@ -229,44 +226,24 @@ U0 ICSub(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
ICRex(tempi,i.u8[1]);
|
||||
ICU16(tempi,i.u8[2]<<8+op);
|
||||
ICModr2(tempi,i,d2,ip+4);
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (t3&TY_MASK!=TY_REG || t3&RT_MASK<RT_I64) {
|
||||
if (swap) {
|
||||
swap=FALSE;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
r3=REG_RCX;
|
||||
r2=REG_RAX;
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
r2=REG_RCX;
|
||||
r3=REG_RAX;
|
||||
}
|
||||
if (!(t3&MDF_REG) || t3.raw_type<RT_I64) {
|
||||
if (swap) {
|
||||
swap=FALSE;
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
r2=REG_RAX;
|
||||
r3=REG_RCX;
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
r3=REG_RAX;
|
||||
r2=REG_RCX;
|
||||
}
|
||||
} else {
|
||||
if (t3&TY_MASK!=TY_REG || t3&RT_MASK<RT_I64) {
|
||||
if (swap) {
|
||||
swap=FALSE;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
r2=REG_RAX;
|
||||
r3=REG_RCX;
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
r3=REG_RAX;
|
||||
r2=REG_RCX;
|
||||
}
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
r2=REG_RCX;
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
r2=REG_RCX;
|
||||
}
|
||||
if (swap) {
|
||||
op=0x03;
|
||||
@@ -279,7 +256,7 @@ U0 ICSub(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
ICU24(tempi,0xC00000+i+(r3&7)<<16+(r2&7)<<19+op<<8);
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,r2,0,ip);
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,r2,0,ip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,23 +264,25 @@ U0 ICMul(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
I64 i,r2,r=REG_RAX,j;
|
||||
CICArg *a1,*a2;
|
||||
if (tempi->a1.type&TY_MASK==TY_IMM) {
|
||||
Bool alt;
|
||||
if (tempi->a1.type&MDF_IMM) {
|
||||
a1=&tempi->a2;
|
||||
a2=&tempi->a1;
|
||||
tempi->ic_flags|=ICF_A1_FIRST;
|
||||
alt=TRUE;
|
||||
} else {
|
||||
a1=&tempi->a1;
|
||||
a2=&tempi->a2;
|
||||
alt=FALSE;
|
||||
}
|
||||
i=a2->disp;
|
||||
if (!(tempi->ic_class->raw_type&1) &&
|
||||
a2->type&TY_MASK==TY_IMM && MIN_I32<=i<=MAX_I32) {
|
||||
if (tempi->r.type==TY_REG+RT_I64) {
|
||||
if (!(tempi->ic_class->raw_type&RTF_UNSIGNED) &&
|
||||
a2->type&MDF_IMM && MIN_I32<=i<=MAX_I32) {
|
||||
if (tempi->r.type==MDF_REG+RT_I64) {
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
a1->type,a1->reg,a1->disp,ip);
|
||||
r=tempi->r.reg;
|
||||
} else
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
if (r>7)
|
||||
j=0xC0004D;
|
||||
else
|
||||
@@ -315,19 +294,18 @@ U0 ICMul(CIntermediateCode *tempi,I64 ip)
|
||||
ICU32(tempi,i);
|
||||
}
|
||||
} else {
|
||||
if (tempi->ic_class->raw_type&1)
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED)
|
||||
i=0xE0F748;
|
||||
else
|
||||
i=0xE8F748;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
if (alt) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
r2=REG_RCX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
if (a1->type&TY_MASK!=TY_REG ||
|
||||
a1->type&RT_MASK<RT_I64) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
if (!(a1->type&MDF_REG) || a1->type.raw_type<RT_I64) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
r2=REG_RCX;
|
||||
} else
|
||||
r2=a1->reg;
|
||||
@@ -338,20 +316,20 @@ U0 ICMul(CIntermediateCode *tempi,I64 ip)
|
||||
}
|
||||
ICU24(tempi,i+r2<<16);
|
||||
}
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,TY_REG+RT_I64,r,0,ip);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,MDF_REG+RT_I64,r,0,ip);
|
||||
}
|
||||
|
||||
U0 ICMulEqu(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
I64 i=tempi->a2.disp,r=REG_RAX,j;
|
||||
if (!(tempi->ic_class->raw_type&1) &&
|
||||
tempi->a2.type&TY_MASK==TY_IMM && MIN_I32<=i<=MAX_I32) {
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->a1.type==TY_REG+RT_I64)
|
||||
if (!(tempi->ic_class->raw_type&RTF_UNSIGNED) &&
|
||||
tempi->a2.type&MDF_IMM && MIN_I32<=i<=MAX_I32) {
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
if (tempi->a1.type==MDF_REG+RT_I64)
|
||||
r=tempi->a1.reg;
|
||||
else
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (r>7)
|
||||
j=0xC0004D;
|
||||
@@ -363,13 +341,13 @@ U0 ICMulEqu(CIntermediateCode *tempi,I64 ip)
|
||||
ICU24(tempi,0x6900+j+(r&7)<<16+(r&7)<<19);
|
||||
ICU32(tempi,i);
|
||||
}
|
||||
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,TY_REG+RT_I64,r,0,ip);
|
||||
ICMov(tempi,tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,MDF_REG+RT_I64,r,0,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
|
||||
TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,
|
||||
MDF_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
|
||||
r=REG_RBX;
|
||||
if (MIN_I8<=i<=MAX_I8)
|
||||
ICU32(tempi,i<<24+0xDB6B48);
|
||||
@@ -377,68 +355,46 @@ U0 ICMulEqu(CIntermediateCode *tempi,I64 ip)
|
||||
ICU24(tempi,0xDB6948);
|
||||
ICU32(tempi,i);
|
||||
}
|
||||
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
TY_REG+RT_I64,REG_RBX,0,ip);
|
||||
ICMov(tempi,MDF_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
MDF_REG+RT_I64,REG_RBX,0,ip);
|
||||
}
|
||||
} else {
|
||||
if (tempi->ic_class->raw_type&1)
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED)
|
||||
i=0xE3F748;
|
||||
else
|
||||
i=0xEBF748;
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICU24(tempi,i);
|
||||
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICMov(tempi,tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
|
||||
TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,
|
||||
MDF_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
|
||||
ICU24(tempi,i);
|
||||
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICMov(tempi,MDF_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
}
|
||||
if (tempi->r.type&TY_MASK)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,TY_REG+RT_I64,r,0,ip);
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,MDF_REG+RT_I64,r,0,ip);
|
||||
}
|
||||
|
||||
U0 ICDiv(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
if (tempi->ic_class->raw_type&1) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED) {
|
||||
ICZero(tempi,REG_RDX);
|
||||
ICU24(tempi,0xF1F748);
|
||||
} else {
|
||||
@@ -446,26 +402,18 @@ U0 ICDiv(CIntermediateCode *tempi,I64 ip)
|
||||
ICU24(tempi,0xF9F748);
|
||||
}
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICDivEqu(CIntermediateCode *tempi,Bool is_mod,I64 ip)
|
||||
{
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
if (tempi->ic_class->raw_type&1) {
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED) {
|
||||
ICZero(tempi,REG_RDX);
|
||||
ICU24(tempi,0xF1F748);
|
||||
} else {
|
||||
@@ -473,28 +421,20 @@ U0 ICDivEqu(CIntermediateCode *tempi,Bool is_mod,I64 ip)
|
||||
ICU24(tempi,0xF9F748);
|
||||
}
|
||||
if (is_mod)
|
||||
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,TY_REG+RT_I64,REG_RDX,0,ip);
|
||||
ICMov(tempi,tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,MDF_REG+RT_I64,REG_RDX,0,ip);
|
||||
else
|
||||
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICMov(tempi,tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICU24(tempi,0xD98748); //xchg bx,cx
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
//dangerous might clobber RBX in Mov, but it doesn't
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,TY_DISP+tempi->a1.type_pointed_to,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,MDF_DISP+tempi->a1.type_pointed_to,
|
||||
REG_RBX,0,ip);
|
||||
if (tempi->ic_class->raw_type&1) {
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED) {
|
||||
ICZero(tempi,REG_RDX);
|
||||
ICU24(tempi,0xF1F748);
|
||||
} else {
|
||||
@@ -502,36 +442,29 @@ U0 ICDivEqu(CIntermediateCode *tempi,Bool is_mod,I64 ip)
|
||||
ICU24(tempi,0xF9F748);
|
||||
}
|
||||
if (is_mod)
|
||||
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RBX,0,
|
||||
TY_REG+RT_I64,REG_RDX,0,ip);
|
||||
ICMov(tempi,MDF_DISP+tempi->a1.type_pointed_to,REG_RBX,0,
|
||||
MDF_REG+RT_I64,REG_RDX,0,ip);
|
||||
else
|
||||
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RBX,0,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICMov(tempi,MDF_DISP+tempi->a1.type_pointed_to,REG_RBX,0,
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
if (tempi->r.type&TY_MASK) {
|
||||
if (tempi->r.type.mode) {
|
||||
if (is_mod)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RDX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RDX,0,ip);
|
||||
else
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
}
|
||||
|
||||
U0 ICMod(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
if (tempi->ic_class->raw_type&1) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED) {
|
||||
ICZero(tempi,REG_RDX);
|
||||
ICU24(tempi,0xF1F748);
|
||||
} else {
|
||||
@@ -539,35 +472,33 @@ U0 ICMod(CIntermediateCode *tempi,I64 ip)
|
||||
ICU24(tempi,0xF9F748);
|
||||
}
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RDX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RDX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed_to,
|
||||
I64 t1,I64 r1,I64 d1,I64 t2,I64 r2,I64 d2,
|
||||
I64 t3,I64 r3,I64 d3,I64 op,I64 ip)
|
||||
U0 ICAddSubEctEqu(CIntermediateCode *tempi,U8 type_pointed_to,
|
||||
CICType t1,I64 r1,I64 d1,CICType t2,I64 r2,I64 d2,
|
||||
CICType t3,I64 r3,I64 d3,I64 op,I64 ip)
|
||||
{
|
||||
Bool done;
|
||||
I64 result_reg,temp,i;
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (t3&TY_MASK==TY_IMM) {
|
||||
ICAddSubEctImm(tempi,
|
||||
t2&TY_MASK+type_pointed_to,r2,d2,t2&TY_MASK+
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
if (t3&MDF_IMM) {
|
||||
ICAddSubEctImm(tempi,t2&MDG_MASK+type_pointed_to,r2,d2,t2&MDG_MASK+
|
||||
type_pointed_to,r2,d2,d3,op,ip);
|
||||
if (t1&TY_MASK)
|
||||
ICMov(tempi,t1,r1,d1,t2&TY_MASK+type_pointed_to,r2,d2,ip);
|
||||
if (t1.mode)
|
||||
ICMov(tempi,t1,r1,d1,t2&MDG_MASK+type_pointed_to,r2,d2,ip);
|
||||
return;
|
||||
} else {
|
||||
done=FALSE;
|
||||
if (type_pointed_to>=RT_I64) {
|
||||
if (!(t1&TY_MASK) &&
|
||||
TY_REG<=t2&TY_MASK<=TY_RIP_DISP32) {
|
||||
if (t3&TY_MASK==TY_REG)
|
||||
if (!t1.mode && t2&MDG_REG_DISP_SIB_RIP) {
|
||||
if (t3&MDF_REG)
|
||||
temp=r3;
|
||||
else {
|
||||
temp=REG_RCX;
|
||||
ICMov(tempi,TY_REG+RT_I64,temp,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,temp,0,t3,r3,d3,ip);
|
||||
}
|
||||
i=ICModr1(temp,t2&TY_MASK+type_pointed_to,r2,d2);
|
||||
i=ICModr1(temp,t2&MDG_MASK+type_pointed_to,r2,d2);
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
ICRex(tempi,i.u8[1]);
|
||||
@@ -575,44 +506,32 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed_to,
|
||||
ICModr2(tempi,i,d2,ip+4);
|
||||
return;
|
||||
}
|
||||
if (t3&RT_MASK>=RT_I64 &&
|
||||
TY_REG<=t3&TY_MASK<=TY_RIP_DISP32) {
|
||||
if (t2&TY_MASK==TY_REG)
|
||||
if (t3.raw_type>=RT_I64 && t3&MDG_REG_DISP_SIB_RIP) {
|
||||
if (t2&MDF_REG)
|
||||
result_reg=r2;
|
||||
else {
|
||||
result_reg=REG_RCX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
}
|
||||
i=ICModr1(result_reg,t3&TY_MASK+type_pointed_to,r3,d3);
|
||||
i=ICModr1(result_reg,t3&MDG_MASK+type_pointed_to,r3,d3);
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
ICRex(tempi,i.u8[1]);
|
||||
ICU16(tempi,i.u8[2]<<8+op.u8[0]);
|
||||
ICModr2(tempi,i,d3,ip+4);
|
||||
ICMov(tempi,t2&TY_MASK+type_pointed_to,r2,d2,
|
||||
TY_REG+RT_I64,result_reg,0,ip);
|
||||
ICMov(tempi,t2&MDG_MASK+type_pointed_to,r2,d2,
|
||||
MDF_REG+RT_I64,result_reg,0,ip);
|
||||
done=TRUE;
|
||||
}
|
||||
}
|
||||
if (!done) {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (t2&TY_MASK==TY_REG && r2!=REG_RAX)
|
||||
result_reg=r2;
|
||||
else {
|
||||
result_reg=REG_RCX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
t2&TY_MASK+type_pointed_to,r2,d2,ip);
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
if (t2&TY_MASK==TY_REG && r2!=REG_RAX)
|
||||
result_reg=r2;
|
||||
else {
|
||||
result_reg=REG_RCX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
t2&TY_MASK+type_pointed_to,r2,d2,ip);
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
if (t2&MDF_REG && r2!=REG_RAX)
|
||||
result_reg=r2;
|
||||
else {
|
||||
result_reg=REG_RCX;
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
t2&MDG_MASK+type_pointed_to,r2,d2,ip);
|
||||
}
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
@@ -621,35 +540,35 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed_to,
|
||||
else
|
||||
ICU8(tempi,0x48);
|
||||
ICU16(tempi,0xC000+op.u8[0]+(result_reg&7)<<11);
|
||||
ICMov(tempi,t2&TY_MASK+type_pointed_to,r2,d2,
|
||||
TY_REG+RT_I64,result_reg,0,ip);
|
||||
ICMov(tempi,t2&MDG_MASK+type_pointed_to,r2,d2,
|
||||
MDF_REG+RT_I64,result_reg,0,ip);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
done=FALSE;
|
||||
if (t3&TY_MASK==TY_IMM && op.u8[2]) {
|
||||
if (t3&MDF_IMM && op.u8[2]) {
|
||||
if (!d3.u32[1]) {
|
||||
if (tempi->ic_flags&ICF_NO_DEPEND_RESULT &&
|
||||
t2&TY_MASK==TY_REG && d3(U64)<=MAX_I8) {
|
||||
ICSlashOp(tempi,TY_DISP+type_pointed_to,r2,0,0x838000+op.u8[4],ip);
|
||||
t2&MDF_REG && d3(U64)<=MAX_I8) {
|
||||
ICSlashOp(tempi,MDF_DISP+type_pointed_to,r2,0,0x838000+op.u8[4],ip);
|
||||
ICU8(tempi,d3);
|
||||
done=TRUE;
|
||||
} else if (op.u8[2]==0x24) {//AND
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
TY_DISP+type_pointed_to,REG_RCX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
MDF_DISP+type_pointed_to,REG_RCX,0,ip);
|
||||
result_reg=REG_RAX;
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
ICU16(tempi,op.u8[3]<<8+0x40);
|
||||
ICU32(tempi,d3);
|
||||
ICMov(tempi,TY_DISP+type_pointed_to,REG_RCX,0,
|
||||
TY_REG+RT_I64,result_reg,0,ip);
|
||||
ICMov(tempi,MDF_DISP+type_pointed_to,REG_RCX,0,
|
||||
MDF_REG+RT_I64,result_reg,0,ip);
|
||||
done=TRUE;
|
||||
} else if (type_pointed_to&RT_MASK<RT_I64) {//OR/XOR
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
TY_DISP+type_pointed_to,REG_RCX,0,ip);
|
||||
} else if (type_pointed_to<RT_I64) {//OR/XOR
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
MDF_DISP+type_pointed_to,REG_RCX,0,ip);
|
||||
result_reg=REG_RAX;
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
@@ -663,48 +582,46 @@ U0 ICAddSubEctEqu(CIntermediateCode *tempi,I64 type_pointed_to,
|
||||
ICU16(tempi,op.u8[2]<<8+0x40);
|
||||
ICU8(tempi,d3);
|
||||
}
|
||||
ICMov(tempi,TY_DISP+type_pointed_to,REG_RCX,0,
|
||||
TY_REG+RT_I64,result_reg,0,ip);
|
||||
ICMov(tempi,MDF_DISP+type_pointed_to,REG_RCX,0,
|
||||
MDF_REG+RT_I64,result_reg,0,ip);
|
||||
done=TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!done) {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,TY_DISP+type_pointed_to,REG_RCX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,
|
||||
MDF_DISP+type_pointed_to,REG_RCX,0,ip);
|
||||
result_reg=REG_RBX;
|
||||
if (tempi->ic_flags&ICF_LOCK)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
ICU8(tempi,0x48);
|
||||
ICU16(tempi,0xC000+op.u8[0]+(result_reg&7)<<11);
|
||||
ICMov(tempi,TY_DISP+type_pointed_to,REG_RCX,0,
|
||||
TY_REG+RT_I64,result_reg,0,ip);
|
||||
ICMov(tempi,MDF_DISP+type_pointed_to,REG_RCX,0,
|
||||
MDF_REG+RT_I64,result_reg,0,ip);
|
||||
}
|
||||
}
|
||||
if (t1&TY_MASK)
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,result_reg,0,ip);
|
||||
if (t1.mode)
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,result_reg,0,ip);
|
||||
}
|
||||
|
||||
U0 ICShift(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
I64 t2,I64 r2,I64 d2,I64 t3,I64 r3,I64 d3,I64 us,I64 is,I64 ip)
|
||||
U0 ICShift(CIntermediateCode *tempi,CICType t1,I64 r1,I64 d1,
|
||||
CICType t2,I64 r2,I64 d2,CICType t3,I64 r3,I64 d3,
|
||||
I64 us,I64 is,I64 ip)
|
||||
{
|
||||
I64 i=0x48,result_reg;
|
||||
if (tempi->ic_class->raw_type&1 || tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED ||
|
||||
tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
is=us;
|
||||
if (t1&TY_MASK==TY_REG) {
|
||||
if (t1&MDF_REG) {
|
||||
result_reg=r1;
|
||||
if (result_reg>7)
|
||||
i++;
|
||||
} else
|
||||
result_reg=REG_RAX;
|
||||
if (t3&TY_MASK==TY_IMM) {
|
||||
ICMov(tempi,TY_REG+RT_I64,result_reg,0,t2,r2,d2,ip);
|
||||
if (t3&MDF_IMM) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,result_reg,0,t2,r2,d2,ip);
|
||||
if (d3==1)
|
||||
ICU24(tempi,i+is.u16[2]<<8+(result_reg&7)<<16);
|
||||
else {
|
||||
@@ -712,52 +629,37 @@ U0 ICShift(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,
|
||||
ICU8(tempi,d3);
|
||||
}
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,result_reg,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,result_reg,0,t2,r2,d2,ip);
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,result_reg,0,t2,r2,d2,ip);
|
||||
ICU24(tempi,i+is.u16[1]<<8+(result_reg&7)<<16);
|
||||
}
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,result_reg,0,ip);
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,result_reg,0,ip);
|
||||
}
|
||||
|
||||
U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed_to,
|
||||
I64 t1,I64 r1,I64 d1,I64 t2,I64 r2,I64 d2,I64 t3,I64 r3,I64 d3,
|
||||
I64 us,I64 is,I64 ip)
|
||||
U0 ICShiftEqu(CIntermediateCode *tempi,U8 type_pointed_to,
|
||||
CICType t1,I64 r1,I64 d1,
|
||||
CICType t2,I64 r2,I64 d2,
|
||||
CICType t3,I64 r3,I64 d3,I64 us,I64 is,I64 ip)
|
||||
{
|
||||
I64 result_reg;
|
||||
if (tempi->ic_class->raw_type&1 || tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED ||
|
||||
tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
is=us;
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (t2&TY_MASK==TY_REG)
|
||||
result_reg=r2;
|
||||
else {
|
||||
result_reg=REG_RAX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
t2&TY_MASK+type_pointed_to,r2,d2,ip);
|
||||
}
|
||||
if (t3&TY_MASK!=TY_IMM)
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
|
||||
} else {
|
||||
if (t3&TY_MASK!=TY_IMM)
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
|
||||
if (t2&TY_MASK==TY_REG)
|
||||
result_reg=r2;
|
||||
else {
|
||||
result_reg=REG_RAX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
t2&TY_MASK+type_pointed_to,r2,d2,ip);
|
||||
}
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
if (!(t3&MDF_IMM))
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
|
||||
if (t2&MDF_REG)
|
||||
result_reg=r2;
|
||||
else {
|
||||
result_reg=REG_RAX;
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
t2&MDG_MASK+type_pointed_to,r2,d2,ip);
|
||||
}
|
||||
if (result_reg>7)
|
||||
ICU8(tempi,0x49);
|
||||
else
|
||||
ICU8(tempi,0x48);
|
||||
if (t3&TY_MASK==TY_IMM) {
|
||||
if (t3&MDF_IMM) {
|
||||
if (d3==1)
|
||||
ICU16(tempi,is.u16[2]+(result_reg&7)<<8);
|
||||
else {
|
||||
@@ -766,21 +668,16 @@ U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed_to,
|
||||
}
|
||||
} else
|
||||
ICU16(tempi,is.u16[1]+(result_reg&7)<<8);
|
||||
ICMov(tempi,t2&TY_MASK+type_pointed_to,r2,d2,TY_REG+RT_I64,result_reg,0,ip);
|
||||
ICMov(tempi,t2&MDG_MASK+type_pointed_to,r2,d2,
|
||||
MDF_REG+RT_I64,result_reg,0,ip);
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,t2,r2,d2,ip);
|
||||
if (t3&TY_MASK!=TY_IMM)
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
|
||||
} else {
|
||||
if (t3&TY_MASK!=TY_IMM)
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,t2,r2,d2,ip);
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,TY_DISP+type_pointed_to,REG_RDX,0,ip);
|
||||
if (!(t3&MDF_IMM))
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t3,r3,d3,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,MDF_DISP+type_pointed_to,REG_RDX,0,ip);
|
||||
result_reg=REG_RAX;
|
||||
ICU8(tempi,0x48);
|
||||
if (t3&TY_MASK==TY_IMM) {
|
||||
if (t3&MDF_IMM) {
|
||||
if (d3==1)
|
||||
ICU16(tempi,is.u16[2]+(result_reg&7)<<8);
|
||||
else {
|
||||
@@ -790,8 +687,8 @@ U0 ICShiftEqu(CIntermediateCode *tempi,I64 type_pointed_to,
|
||||
} else
|
||||
ICU16(tempi,is.u16[1]+(result_reg&7)<<8);
|
||||
ICMov(tempi,
|
||||
TY_DISP+type_pointed_to,REG_RDX,0,TY_REG+RT_I64,result_reg,0,ip);
|
||||
MDF_DISP+type_pointed_to,REG_RDX,0,MDF_REG+RT_I64,result_reg,0,ip);
|
||||
}
|
||||
if (t1&TY_MASK)
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,result_reg,0,ip);
|
||||
if (t1.mode)
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,result_reg,0,ip);
|
||||
}
|
||||
+188
-291
@@ -1,55 +1,43 @@
|
||||
U0 ICUnaries(CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
{
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICSlashOp(tempi,TY_REG+RT_I64,REG_RAX,0,op,ip);
|
||||
ICSlashOp(tempi,MDF_REG+RT_I64,REG_RAX,0,op,ip);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICNot(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
I64 i;
|
||||
if (tempi->a1.type&RT_MASK<=RT_U8 &&
|
||||
TY_DISP<=tempi->a1.type&TY_MASK<=TY_RIP_DISP32) {
|
||||
if (tempi->a1.type.raw_type<=RT_U8 && tempi->a1.type&MDG_DISP_SIB_RIP) {
|
||||
i=ICModr1(tempi,tempi->a1.type,tempi->a1.reg,tempi->a1.disp);
|
||||
ICRex(tempi,i.u8[1]);
|
||||
ICU16(tempi,i.u8[2]<<8+0xF6); //TEST ?,0xFF
|
||||
ICModr2(tempi,i,tempi->a1.disp,ip+5);
|
||||
ICU8(tempi,0xFF);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICTest(tempi,REG_RAX);
|
||||
}
|
||||
ICU24(tempi,0xC0940F); //SETZ AL
|
||||
ICU32(tempi,0xC0B60F48); //MOVZX RAX,AL
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_U64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_U64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICAndAnd(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
I64 r2;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (tempi->a1.type&TY_MASK!=TY_REG || tempi->a1.reg==REG_RAX) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=tempi->a1.reg;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->a1.type&TY_MASK!=TY_REG || tempi->a1.reg==REG_RAX) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=tempi->a1.reg;
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (!(tempi->a1.type&MDF_REG) || tempi->a1.reg==REG_RAX) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=tempi->a1.reg;
|
||||
ICZero(tempi,REG_RAX);
|
||||
ICTest(tempi,r2);
|
||||
ICU16(tempi,0x0874);
|
||||
@@ -57,31 +45,20 @@ U0 ICAndAnd(CIntermediateCode *tempi,I64 ip)
|
||||
ICU16(tempi,0x0374);
|
||||
ICU24(tempi,0xC0FF48);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICOrOr(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
I64 i=0x48,r2;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (tempi->a1.type&TY_MASK!=TY_REG || tempi->a1.reg==REG_RAX) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=tempi->a1.reg;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->a1.type&TY_MASK!=TY_REG || tempi->a1.reg==REG_RAX) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=tempi->a1.reg;
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (!(tempi->a1.type&MDF_REG) || tempi->a1.reg==REG_RAX) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=tempi->a1.reg;
|
||||
|
||||
if (r2>7) {
|
||||
i++;
|
||||
@@ -92,31 +69,20 @@ U0 ICOrOr(CIntermediateCode *tempi,I64 ip)
|
||||
ICU16(tempi,0x0374);
|
||||
ICU24(tempi,0xC0FF48);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICXorXor(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
I64 r2;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (tempi->a1.type&TY_MASK!=TY_REG) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=tempi->a1.reg;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->a1.type&TY_MASK!=TY_REG) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=tempi->a1.reg;
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (!(tempi->a1.type&MDF_REG)) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=tempi->a1.reg;
|
||||
ICZero(tempi,REG_RBX);
|
||||
ICTest(tempi,r2);
|
||||
ICU16(tempi,0x0374);
|
||||
@@ -130,16 +96,16 @@ U0 ICXorXor(CIntermediateCode *tempi,I64 ip)
|
||||
ICU24(tempi,0xC33348);
|
||||
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICCmp(CIntermediateCode *tempi,I64 us,I64 is,I64 ip)
|
||||
{
|
||||
I64 r1,d1,r2,i=0x48,j=tempi->a2.disp;
|
||||
if (tempi->a2.type&TY_MASK==TY_IMM && MIN_I32<=j<=MAX_I32) {
|
||||
if (tempi->a2.type&MDF_IMM && MIN_I32<=j<=MAX_I32) {
|
||||
if (!(tempi->ic_flags&(ICF_POP_CMP|ICF_PUSH_CMP)) &&
|
||||
tempi->a1.type&TY_MASK==TY_DISP && //TODO
|
||||
tempi->a1.type&RT_MASK>=RT_I64 && tempi->a1.reg!=REG_RAX) {
|
||||
tempi->a1.type&MDF_DISP && //TODO
|
||||
tempi->a1.type.raw_type>=RT_I64 && tempi->a1.reg!=REG_RAX) {
|
||||
r1=tempi->a1.reg;
|
||||
d1=tempi->a1.disp;
|
||||
ICZero(tempi,REG_RAX);
|
||||
@@ -167,10 +133,10 @@ U0 ICCmp(CIntermediateCode *tempi,I64 us,I64 is,I64 ip)
|
||||
ICPopRegs(tempi,1<<REG_RCX);
|
||||
r1=REG_RCX;
|
||||
} else {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG && tempi->a1.reg!=REG_RAX)
|
||||
if (tempi->a1.type&MDF_REG && tempi->a1.reg!=REG_RAX)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r1=REG_RCX;
|
||||
}
|
||||
@@ -187,53 +153,32 @@ U0 ICCmp(CIntermediateCode *tempi,I64 us,I64 is,I64 ip)
|
||||
}
|
||||
}
|
||||
if (tempi->ic_flags & ICF_PUSH_CMP)
|
||||
ICPush(tempi,TY_IMM+RT_I64,0,j,ip);
|
||||
if (tempi->ic_class->raw_type&1 || tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
ICPush(tempi,MDF_IMM+RT_I64,0,j,ip);
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED ||
|
||||
tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
is=us;
|
||||
ICU16(tempi,0x300+is);
|
||||
ICU24(tempi,0xC0FF48);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (tempi->ic_flags & ICF_POP_CMP) {
|
||||
ICPopRegs(tempi,1<<REG_RCX);
|
||||
r1=REG_RCX;
|
||||
} else {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG && tempi->a1.reg!=REG_RAX)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r1=REG_RCX;
|
||||
}
|
||||
}
|
||||
if (tempi->a2.type&TY_MASK==TY_REG && tempi->a2.reg!=REG_RAX)
|
||||
r2=tempi->a2.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
r2=REG_RDX;
|
||||
}
|
||||
if (tempi->a2.type&MDF_REG && tempi->a2.reg!=REG_RAX)
|
||||
r2=tempi->a2.reg;
|
||||
else {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
r2=REG_RCX;
|
||||
}
|
||||
if (tempi->ic_flags & ICF_POP_CMP) {
|
||||
ICPopRegs(tempi,1<<REG_RDX);
|
||||
r1=REG_RDX;
|
||||
} else {
|
||||
if (tempi->a2.type&TY_MASK==TY_REG && tempi->a2.reg!=REG_RAX)
|
||||
r2=tempi->a2.reg;
|
||||
if (tempi->a1.type&MDF_REG && tempi->a1.reg!=REG_RAX)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
r2=REG_RCX;
|
||||
}
|
||||
if (tempi->ic_flags & ICF_POP_CMP) {
|
||||
ICPopRegs(tempi,1<<REG_RDX);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r1=REG_RDX;
|
||||
} else {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG && tempi->a1.reg!=REG_RAX)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r1=REG_RDX;
|
||||
}
|
||||
}
|
||||
}
|
||||
ICZero(tempi,REG_RAX);
|
||||
@@ -244,12 +189,13 @@ U0 ICCmp(CIntermediateCode *tempi,I64 us,I64 is,I64 ip)
|
||||
if (tempi->ic_flags & ICF_PUSH_CMP)
|
||||
ICPushRegs(tempi,1<<r2);
|
||||
ICU24(tempi,0xC03B00+i+(r2&7)<<16+(r1&7)<<19);
|
||||
if (tempi->ic_class->raw_type&1 || tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED ||
|
||||
tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
is=us;
|
||||
ICU16(tempi,0x300+is);
|
||||
ICU24(tempi,0xC0FF48);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -258,85 +204,50 @@ U0 ICBitOps(CIntermediateCode *tempi,CICArg *a1,CICArg *a2,
|
||||
{//TODO:not fully utilizing Modr
|
||||
Bool no_depend=ToBool(tempi2->ic_flags&ICF_NO_DEPEND_RESULT);
|
||||
I64 r1,t2,r2,d2,i=0x48;
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
t2=a2->type&TY_MASK+RT_I64; //TODO: check overflow
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
t2=a2->type&MDG_MASK+RT_I64; //TODO: check overflow
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (a1->type&TY_MASK==TY_REG && (a1->reg!=REG_RAX||no_depend))
|
||||
r1=a1->reg;
|
||||
else if (a1->type&TY_MASK!=TY_IMM || a1->disp>63) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
r1=REG_RCX;
|
||||
} else
|
||||
r1=0;
|
||||
if (!(TY_REG<=t2&TY_MASK<=TY_RIP_DISP32) ||
|
||||
!(r2.u8[0]!=REG_RAX&&(t2&TY_MASK!=TY_SIB||r2.u8[1]&15!=REG_RAX)||
|
||||
no_depend)) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,t2,r2,d2,ip);
|
||||
t2=TY_REG+RT_I64;
|
||||
r2=REG_RDX;
|
||||
d2=0;
|
||||
}
|
||||
} else {
|
||||
if (!(TY_REG<=t2&TY_MASK<=TY_RIP_DISP32) ||
|
||||
!(r2.u8[0]!=REG_RAX&&(t2&TY_MASK!=TY_SIB||r2.u8[1]&15!=REG_RAX)||
|
||||
no_depend)) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
t2=TY_REG+RT_I64;
|
||||
r2=REG_RCX;
|
||||
d2=0;
|
||||
}
|
||||
if (a1->type&TY_MASK==TY_REG && (a1->reg!=REG_RAX||no_depend))
|
||||
r1=a1->reg;
|
||||
else if (a1->type&TY_MASK!=TY_IMM || a1->disp>63) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
r1=REG_RDX;
|
||||
} else
|
||||
r1=0;
|
||||
if (!(t2&MDG_REG_DISP_SIB_RIP) || !(r2.u8[0]!=REG_RAX&&(!(t2&MDF_SIB) ||
|
||||
r2.u8[1]&15!=REG_RAX) || no_depend)) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,t2,r2,d2,ip);
|
||||
t2=MDF_REG+RT_I64;
|
||||
r2=REG_RCX;
|
||||
d2=0;
|
||||
}
|
||||
if (a1->type&MDF_REG && (a1->reg!=REG_RAX||no_depend))
|
||||
r1=a1->reg;
|
||||
else if (!(a1->type&MDF_IMM) || a1->disp>63) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
r1=REG_RDX;
|
||||
} else
|
||||
r1=0;
|
||||
} else {
|
||||
t2=TY_DISP+RT_I64;
|
||||
t2=MDF_DISP+RT_I64;
|
||||
d2=0;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (a1->type&TY_MASK==TY_REG && (a1->reg!=REG_RAX||no_depend))
|
||||
r1=a1->reg;
|
||||
else if (a1->type&TY_MASK!=TY_IMM || a1->disp>63) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
r1=REG_RCX;
|
||||
} else
|
||||
r1=0;
|
||||
if (a2->type&TY_MASK==TY_REG && (a2->reg!=REG_RAX||no_depend))
|
||||
r2=a2->reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
r2=REG_RDX;
|
||||
}
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_REG && (a2->reg!=REG_RAX||no_depend))
|
||||
r2=a2->reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
r2=REG_RCX;
|
||||
}
|
||||
if (a1->type&TY_MASK==TY_REG && (a1->reg!=REG_RAX||no_depend))
|
||||
r1=a1->reg;
|
||||
else if (a1->type&TY_MASK!=TY_IMM || a1->disp>63) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
r1=REG_RDX;
|
||||
} else
|
||||
r1=0;
|
||||
if (a2->type&MDF_REG && (a2->reg!=REG_RAX||no_depend))
|
||||
r2=a2->reg;
|
||||
else {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
r2=REG_RCX;
|
||||
}
|
||||
if (a1->type&MDF_REG && (a1->reg!=REG_RAX||no_depend))
|
||||
r1=a1->reg;
|
||||
else if (!(a1->type&MDF_IMM) || a1->disp>63) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
r1=REG_RDX;
|
||||
} else
|
||||
r1=0;
|
||||
}
|
||||
if (!no_depend)
|
||||
ICZero(tempi,REG_RAX);
|
||||
if (tempi->ic_flags&ICF_LOCK && op!=0xA30F)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
if (a1->type&TY_MASK==TY_IMM && a1->disp<32)
|
||||
t2=t2&TY_MASK+RT_U32;
|
||||
if (a1->type&MDF_IMM && a1->disp<32)
|
||||
t2=t2&MDG_MASK+RT_U32;
|
||||
i=ICModr1(r1,t2,r2,d2);
|
||||
ICRex(tempi,i.u8[1]);
|
||||
if (a1->type&TY_MASK==TY_IMM && a1->disp<64) {
|
||||
if (a1->type&MDF_IMM && a1->disp<64) {
|
||||
ICU24(tempi,i.u8[2]<<16+op_imm);
|
||||
ICModr2(tempi,i,d2,ip+5);
|
||||
ICU8(tempi,a1->disp);
|
||||
@@ -346,15 +257,15 @@ U0 ICBitOps(CIntermediateCode *tempi,CICArg *a1,CICArg *a2,
|
||||
}
|
||||
if (!no_depend) {
|
||||
ICU32(tempi,0xD08348);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
}
|
||||
|
||||
U0 ICToUpper(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICU32(tempi,0x61F88348);
|
||||
ICU16(tempi,0x0A7C);
|
||||
@@ -378,10 +289,10 @@ U0 ICToF64(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip)
|
||||
U0 ICToBool(CCmpCtrl *,CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
I64 r;
|
||||
if (tempi->a1.type&TY_MASK==TY_REG)
|
||||
if (tempi->a1.type&MDF_REG)
|
||||
r=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r=REG_RAX;
|
||||
}
|
||||
@@ -394,40 +305,40 @@ U0 ICPreIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
{
|
||||
I64 r;
|
||||
CHashClass *tempc=tempi->ic_class,*tempc1=tempc-1;
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
if (tempc->ptr_stars_cnt && tempc1->size!=1) {
|
||||
ICAddSubEctImm(tempi,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,tempc1->size,op.u16[3],ip);
|
||||
} else
|
||||
ICSlashOp(tempi,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,op,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
} else {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG)
|
||||
if (tempi->a1.type&MDF_REG)
|
||||
r=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r=REG_RCX;
|
||||
}
|
||||
if (tempc->ptr_stars_cnt &&
|
||||
tempc1->size!=1) {
|
||||
ICAddSubEctImm(tempi,TY_DISP+tempi->a1.type_pointed_to,r,0,
|
||||
TY_DISP+tempi->a1.type_pointed_to,r,0,
|
||||
ICAddSubEctImm(tempi,MDF_DISP+tempi->a1.type_pointed_to,r,0,
|
||||
MDF_DISP+tempi->a1.type_pointed_to,r,0,
|
||||
tempc1->size,op.u16[3],ip);
|
||||
} else
|
||||
ICSlashOp(tempi,
|
||||
TY_DISP+tempi->a1.type_pointed_to,r,0,op,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
MDF_DISP+tempi->a1.type_pointed_to,r,0,op,ip);
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_DISP+tempi->a1.type_pointed_to,r,0,ip);
|
||||
MDF_DISP+tempi->a1.type_pointed_to,r,0,ip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -435,82 +346,83 @@ U0 ICPostIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
{
|
||||
I64 r;
|
||||
CHashClass *tempc=tempi->ic_class,*tempc1=tempc-1;
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempc->ptr_stars_cnt && tempc1->size!=1)
|
||||
ICAddSubEctImm(tempi,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,tempc1->size,op.u16[3],ip);
|
||||
else
|
||||
ICSlashOp(tempi,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,op,ip);
|
||||
} else {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG &&
|
||||
!(tempi->r.type&TY_MASK==TY_REG && tempi->r.reg==tempi->a1.reg))
|
||||
if (tempi->a1.type&MDF_REG &&
|
||||
!(tempi->r.type&MDF_REG && tempi->r.reg==tempi->a1.reg))
|
||||
r=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r=REG_RCX;
|
||||
}
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_DISP+tempi->a1.type_pointed_to,r,0,ip);
|
||||
MDF_DISP+tempi->a1.type_pointed_to,r,0,ip);
|
||||
if (tempc->ptr_stars_cnt && tempc1->size!=1)
|
||||
ICAddSubEctImm(tempi,TY_DISP+tempi->a1.type_pointed_to,r,0,
|
||||
TY_DISP+tempi->a1.type_pointed_to,r,0,tempc1->size,op.u16[3],ip);
|
||||
ICAddSubEctImm(tempi,MDF_DISP+tempi->a1.type_pointed_to,r,0,
|
||||
MDF_DISP+tempi->a1.type_pointed_to,r,0,tempc1->size,op.u16[3],ip);
|
||||
else
|
||||
ICSlashOp(tempi,TY_DISP+tempi->a1.type_pointed_to,r,0,op,ip);
|
||||
ICSlashOp(tempi,MDF_DISP+tempi->a1.type_pointed_to,r,0,op,ip);
|
||||
}
|
||||
}
|
||||
|
||||
U0 ICDerefPostIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
{
|
||||
I64 t,r;
|
||||
CICType t;
|
||||
I64 r;
|
||||
CHashClass *tempc1=tempi->ic_class;
|
||||
t=tempi->r.type&RT_MASK;
|
||||
t=tempi->r.type.raw_type;
|
||||
if (t>tempi->a1.type_pointed_to)
|
||||
t=tempi->a1.type_pointed_to;
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG)
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
if (tempi->a1.type&MDF_REG)
|
||||
r=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type&TY_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type&MDG_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r=REG_RDX;
|
||||
}
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_DISP+t,r,0,ip);
|
||||
MDF_DISP+t,r,0,ip);
|
||||
if (tempc1->size!=1)
|
||||
ICAddSubEctImm(tempi,
|
||||
tempi->a1.type&TY_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,
|
||||
tempi->a1.type&TY_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,
|
||||
tempi->a1.type&MDG_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,
|
||||
tempi->a1.type&MDG_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,
|
||||
tempc1->size,op.u16[3],ip);
|
||||
else
|
||||
ICSlashOp(tempi,
|
||||
tempi->a1.type&TY_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,op,ip);
|
||||
tempi->a1.type&MDG_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,op,ip);
|
||||
} else {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG)
|
||||
if (tempi->a1.type&MDF_REG)
|
||||
r=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type&TY_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type&MDG_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r=REG_RCX;
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,TY_DISP+RT_I64,r,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,MDF_DISP+RT_I64,r,0,ip);
|
||||
if (tempc1->size!=1)
|
||||
ICAddSubEctImm(tempi,TY_DISP+RT_I64,r,0,TY_DISP+RT_I64,r,0,
|
||||
ICAddSubEctImm(tempi,MDF_DISP+RT_I64,r,0,MDF_DISP+RT_I64,r,0,
|
||||
tempc1->size,op.u16[3],ip);
|
||||
else
|
||||
ICSlashOp(tempi,TY_DISP+RT_I64,r,0,op,ip);
|
||||
ICSlashOp(tempi,MDF_DISP+RT_I64,r,0,op,ip);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_DISP+t,REG_RDX,0,ip);
|
||||
MDF_DISP+t,REG_RDX,0,ip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -518,70 +430,72 @@ U0 ICAssignPostIncDec(CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
{
|
||||
CHashClass *tempc1=tempi->ic_class2-1;
|
||||
I64 r;
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG)
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
if (tempi->a1.type&MDF_REG)
|
||||
r=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type&TY_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type&MDG_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
r=REG_RDX;
|
||||
}
|
||||
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,r,0,
|
||||
ICMov(tempi,MDF_DISP+tempi->a1.type_pointed_to,r,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempc1->size!=1 || tempi->a1.type&TY_MASK==TY_STK)
|
||||
if (tempc1->size!=1 || tempi->a1.type&MDF_STK)
|
||||
ICAddSubEctImm(tempi,tempi->a1.type,tempi->a1.reg,tempi->a1.disp,
|
||||
TY_REG+RT_I64,r,0,tempc1->size,op.u16[3],ip);
|
||||
MDF_REG+RT_I64,r,0,tempc1->size,op.u16[3],ip);
|
||||
else
|
||||
ICSlashOp(tempi,tempi->a1.type,tempi->a1.reg,tempi->a1.disp,op,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,TY_DISP+RT_I64,REG_RDX,0,ip);
|
||||
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,MDF_DISP+RT_I64,REG_RDX,0,ip);
|
||||
ICMov(tempi,MDF_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempc1->size!=1)
|
||||
ICAddSubEctImm(tempi,TY_DISP+RT_I64,REG_RDX,0,
|
||||
TY_REG+RT_I64,REG_RCX,0,tempc1->size,op.u16[3],ip);
|
||||
ICAddSubEctImm(tempi,MDF_DISP+RT_I64,REG_RDX,0,
|
||||
MDF_REG+RT_I64,REG_RCX,0,tempc1->size,op.u16[3],ip);
|
||||
else
|
||||
ICSlashOp(tempi,TY_DISP+RT_I64,REG_RDX,0,op,ip);
|
||||
ICSlashOp(tempi,MDF_DISP+RT_I64,REG_RDX,0,op,ip);
|
||||
}
|
||||
}
|
||||
|
||||
U0 ICCmpAndBranch(CIntermediateCode *tempi,Bool has_result,I64 ip,
|
||||
I64 us,I64 is,I64 not_us,I64 not_is,U8 *buf,I64 ip2)
|
||||
{
|
||||
I64 r1,r2,i=0x48,j,t1,t2,result_reg;
|
||||
I64 r1,r2,i=0x48,j,result_reg;
|
||||
CICType t1,t2;
|
||||
Bool short_jmp,swap,done;
|
||||
CCodeMisc *lb;
|
||||
CICArg *a1=&tempi->a1,*a2=&tempi->a2;
|
||||
|
||||
j=a1->disp;
|
||||
if (a1->type&TY_MASK==TY_IMM && MIN_I32<=j<=MAX_I32) {
|
||||
if (a1->type&MDF_IMM && MIN_I32<=j<=MAX_I32) {
|
||||
SwapI64(&a1,&a2);
|
||||
swap=TRUE;
|
||||
us=not_us;
|
||||
is=not_is;
|
||||
} else
|
||||
swap=FALSE;
|
||||
if (tempi->ic_class->raw_type&1 || tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
if (tempi->ic_class->raw_type&RTF_UNSIGNED ||
|
||||
tempi->ic_flags & ICF_USE_UNSIGNED)
|
||||
is=us;
|
||||
|
||||
j=a2->disp;
|
||||
if (a2->type&TY_MASK==TY_IMM && MIN_I32<=j<=MAX_I32) {
|
||||
if (!has_result && TY_REG<=a1->type&TY_MASK<=TY_RIP_DISP32)
|
||||
if (a2->type&MDF_IMM && MIN_I32<=j<=MAX_I32) {
|
||||
if (!has_result && a1->type&MDG_REG_DISP_SIB_RIP)
|
||||
ICAddSubEctImm(tempi,a1->type,a1->reg,a1->disp,
|
||||
a1->type,a1->reg,a1->disp,j,0x073B,ip2);
|
||||
else {
|
||||
if (a1->type&TY_MASK==TY_REG)
|
||||
if (a1->type&MDF_REG)
|
||||
r1=a1->reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
r1=REG_RDX;
|
||||
}
|
||||
if (!j) {
|
||||
@@ -613,7 +527,7 @@ U0 ICCmpAndBranch(CIntermediateCode *tempi,Bool has_result,I64 ip,
|
||||
}
|
||||
if (has_result) {
|
||||
if (!swap) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,TY_IMM+RT_I64,0,j,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,MDF_IMM+RT_I64,0,j,ip2);
|
||||
result_reg=REG_RCX;
|
||||
} else
|
||||
result_reg=r1;
|
||||
@@ -624,10 +538,9 @@ U0 ICCmpAndBranch(CIntermediateCode *tempi,Bool has_result,I64 ip,
|
||||
r1=a1->reg;
|
||||
r2=a2->reg;
|
||||
t2=a2->type;
|
||||
if (t2&RT_MASK>=RT_I64 && !has_result &&
|
||||
TY_DISP<=t2&TY_MASK<=TY_RIP_DISP32) {
|
||||
if (t1&TY_MASK!=TY_REG || t1&RT_MASK<RT_I64) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
if (t2.raw_type>=RT_I64 && !has_result && t2&MDG_DISP_SIB_RIP) {
|
||||
if (!(t1&MDF_REG) || t1.raw_type<RT_I64) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
r1=REG_RAX;
|
||||
}
|
||||
i=ICModr1(r1,t2,r2,a2->disp);
|
||||
@@ -635,13 +548,13 @@ U0 ICCmpAndBranch(CIntermediateCode *tempi,Bool has_result,I64 ip,
|
||||
ICU16(tempi,i.u8[2]<<8+0x3B);
|
||||
ICModr2(tempi,i,a2->disp,ip2+4);
|
||||
done=TRUE;
|
||||
} else if (t1&RT_MASK>=RT_I64 && TY_REG<=t1&TY_MASK<=TY_RIP_DISP32) {
|
||||
if (t2&TY_MASK!=TY_REG || t2&RT_MASK<RT_I64) {
|
||||
if (t1&TY_MASK==TY_REG && r1==REG_RAX) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
} else if (t1.raw_type>=RT_I64 && t1&MDG_REG_DISP_SIB_RIP) {
|
||||
if (!(t2&MDF_REG) || t2.raw_type<RT_I64) {
|
||||
if (t1&MDF_REG && r1==REG_RAX) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
r2=REG_RCX;
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
r2=REG_RAX;
|
||||
}
|
||||
}
|
||||
@@ -654,32 +567,17 @@ U0 ICCmpAndBranch(CIntermediateCode *tempi,Bool has_result,I64 ip,
|
||||
done=TRUE;
|
||||
}
|
||||
if (!done) {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (a1->type&TY_MASK==TY_REG)
|
||||
r1=a1->reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
r1=REG_RAX;
|
||||
}
|
||||
if (a2->type&TY_MASK==TY_REG)
|
||||
r2=a2->reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
r2=REG_RCX;
|
||||
}
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_REG)
|
||||
r2=a2->reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
r2=REG_RAX;
|
||||
}
|
||||
if (a1->type&TY_MASK==TY_REG)
|
||||
r1=a1->reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
r1=REG_RCX;
|
||||
}
|
||||
if (a2->type&MDF_REG)
|
||||
r2=a2->reg;
|
||||
else {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
r2=REG_RAX;
|
||||
}
|
||||
if (a1->type&MDF_REG)
|
||||
r1=a1->reg;
|
||||
else {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
r1=REG_RCX;
|
||||
}
|
||||
if (r2>7)
|
||||
i++;
|
||||
@@ -730,7 +628,7 @@ U0 ICCmpAndBranch(CIntermediateCode *tempi,Bool has_result,I64 ip,
|
||||
}
|
||||
if (has_result)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,result_reg,0,ip2);
|
||||
MDF_REG+RT_I64,result_reg,0,ip2);
|
||||
}
|
||||
|
||||
U0 ICTestAndBranch(CIntermediateCode *tempi,I64 ip,I64 is,U8 *buf,I64 ip2)
|
||||
@@ -739,16 +637,15 @@ U0 ICTestAndBranch(CIntermediateCode *tempi,I64 ip,I64 is,U8 *buf,I64 ip2)
|
||||
Bool short_jmp;
|
||||
CCodeMisc *lb;
|
||||
|
||||
if (tempi->a1.type&TY_MASK!=TY_REG) {
|
||||
if (tempi->a1.type&RT_MASK<=RT_U8 &&
|
||||
TY_DISP<=tempi->a1.type&TY_MASK<=TY_RIP_DISP32) {
|
||||
if (!(tempi->a1.type&MDF_REG)) {
|
||||
if (tempi->a1.type.raw_type<=RT_U8 && tempi->a1.type&MDG_DISP_SIB_RIP) {
|
||||
i=ICModr1(tempi,tempi->a1.type,tempi->a1.reg,tempi->a1.disp);
|
||||
ICRex(tempi,i.u8[1]);
|
||||
ICU16(tempi,i.u8[2]<<8+0xF6);
|
||||
ICModr2(tempi,i,tempi->a1.disp,ip2+5);
|
||||
ICU8(tempi,0xFF);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
ICTest(tempi,REG_RAX);
|
||||
}
|
||||
|
||||
+235
-397
@@ -6,7 +6,7 @@ U0 ICAndBranch(CIntermediateCode *tempi,I64 ip,I64 is,U8 *buf,I64 ip2)
|
||||
CCodeMisc *lb;
|
||||
CICArg *a1,*a2;
|
||||
|
||||
if (tempi->a1.type&TY_MASK==TY_IMM) {
|
||||
if (tempi->a1.type&MDF_IMM) {
|
||||
swap=TRUE;
|
||||
a1=&tempi->a2;
|
||||
a2=&tempi->a1;
|
||||
@@ -16,19 +16,19 @@ U0 ICAndBranch(CIntermediateCode *tempi,I64 ip,I64 is,U8 *buf,I64 ip2)
|
||||
a2=&tempi->a2;
|
||||
}
|
||||
|
||||
if (a2->type&TY_MASK==TY_IMM && a2->disp>MAX_U32)
|
||||
if (a2->type&MDF_IMM && a2->disp>MAX_U32)
|
||||
override=TRUE;
|
||||
else
|
||||
override=FALSE;
|
||||
|
||||
if (a1->type&RT_MASK<a2->type&RT_MASK)
|
||||
it=a1->type&RT_MASK;
|
||||
if (a1->type.raw_type<a2->type.raw_type)
|
||||
it=a1->type.raw_type;
|
||||
else
|
||||
it=a2->type&RT_MASK;
|
||||
it=a2->type.raw_type;
|
||||
|
||||
i=a2->disp;
|
||||
if (a2->type&TY_MASK==TY_IMM && i<=MAX_U32) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
if (a2->type&MDF_IMM && i<=MAX_U32) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
if (i<=MAX_U8)
|
||||
ICU16(tempi,i<<8+0xA8);
|
||||
else if (i<=MAX_U16)
|
||||
@@ -38,51 +38,51 @@ U0 ICAndBranch(CIntermediateCode *tempi,I64 ip,I64 is,U8 *buf,I64 ip2)
|
||||
ICU32(tempi,i);
|
||||
}
|
||||
} else {
|
||||
t1=TY_REG+it;
|
||||
t1=MDF_REG+it;
|
||||
d1=0;
|
||||
if ((tempi->ic_flags&ICF_A1_FIRST ^^swap)&&!override) {
|
||||
if (a1->type&TY_MASK==TY_REG) {
|
||||
if (swap && !override) {
|
||||
if (a1->type&MDF_REG) {
|
||||
r1=a1->reg;
|
||||
swap=TRUE;
|
||||
} else {
|
||||
r1=REG_RCX;
|
||||
swap=FALSE;
|
||||
}
|
||||
if (a2->type&TY_MASK==TY_REG) {
|
||||
if (a2->type&MDF_REG) {
|
||||
r2=a2->reg;
|
||||
swap=FALSE;
|
||||
} else
|
||||
r2=REG_RDX;
|
||||
if (swap) {
|
||||
if (a1->type&TY_MASK!=TY_REG || r1!=a1->reg)
|
||||
ICMov(tempi,TY_REG+RT_I64,r1,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
if (TY_REG<=a2->type&TY_MASK<=TY_RIP_DISP32) {
|
||||
t1=a2->type&TY_MASK+it;
|
||||
if (!(a1->type&MDF_REG) || r1!=a1->reg)
|
||||
ICMov(tempi,MDF_REG+RT_I64,r1,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
if (a2->type&MDG_REG_DISP_SIB_RIP) {
|
||||
t1=a2->type&MDG_MASK+it;
|
||||
r2=a2->reg;
|
||||
d1=a2->disp;
|
||||
} else
|
||||
ICMov(tempi,TY_REG+RT_I64,r2,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,r2,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
i=ICModr1(r1,t1,r2,d1);
|
||||
} else {
|
||||
if (TY_REG<=a1->type&TY_MASK<=TY_RIP_DISP32) {
|
||||
t1=a1->type&TY_MASK+it;
|
||||
if (a1->type&MDG_REG_DISP_SIB_RIP) {
|
||||
t1=a1->type&MDG_MASK+it;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
} else
|
||||
ICMov(tempi,TY_REG+RT_I64,r1,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
if (a2->type&TY_MASK!=TY_REG || r2!=a2->reg)
|
||||
ICMov(tempi,TY_REG+RT_I64,r2,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,r1,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
if (!(a2->type&MDF_REG) || r2!=a2->reg)
|
||||
ICMov(tempi,MDF_REG+RT_I64,r2,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
i=ICModr1(r2,t1,r1,d1);
|
||||
}
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_REG) {
|
||||
if (a2->type&MDF_REG) {
|
||||
r2=a2->reg;
|
||||
swap=FALSE;
|
||||
} else {
|
||||
r2=REG_RDX;
|
||||
swap=TRUE;
|
||||
}
|
||||
if (a1->type&TY_MASK==TY_REG) {
|
||||
if (a1->type&MDF_REG) {
|
||||
r1=a1->reg;
|
||||
swap=TRUE;
|
||||
} else
|
||||
@@ -90,24 +90,24 @@ U0 ICAndBranch(CIntermediateCode *tempi,I64 ip,I64 is,U8 *buf,I64 ip2)
|
||||
if (override)
|
||||
swap=FALSE;
|
||||
if (swap) {
|
||||
if (TY_REG<=a2->type&TY_MASK<=TY_RIP_DISP32) {
|
||||
t1=a2->type&TY_MASK+it;
|
||||
if (a2->type&MDG_REG_DISP_SIB_RIP) {
|
||||
t1=a2->type&MDG_MASK+it;
|
||||
r2=a2->reg;
|
||||
d1=a2->disp;
|
||||
} else
|
||||
ICMov(tempi,TY_REG+RT_I64,r2,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
if (a1->type&TY_MASK!=TY_REG || r1!=a1->reg)
|
||||
ICMov(tempi,TY_REG+RT_I64,r1,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,r2,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
if (!(a1->type&MDF_REG) || r1!=a1->reg)
|
||||
ICMov(tempi,MDF_REG+RT_I64,r1,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
i=ICModr1(r1,t1,r2,d1);
|
||||
} else {
|
||||
if (a2->type&TY_MASK!=TY_REG || r2!=a2->reg)
|
||||
ICMov(tempi,TY_REG+RT_I64,r2,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
if (TY_REG<=a1->type&TY_MASK<=TY_RIP_DISP32) {
|
||||
t1=a1->type&TY_MASK+it;
|
||||
if (!(a2->type&MDF_REG) || r2!=a2->reg)
|
||||
ICMov(tempi,MDF_REG+RT_I64,r2,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
if (a1->type&MDG_REG_DISP_SIB_RIP) {
|
||||
t1=a1->type&MDG_MASK+it;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
} else
|
||||
ICMov(tempi,TY_REG+RT_I64,r1,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,r1,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
i=ICModr1(r2,t1,r1,d1);
|
||||
}
|
||||
}
|
||||
@@ -159,33 +159,31 @@ U0 ICAndBranch(CIntermediateCode *tempi,I64 ip,I64 is,U8 *buf,I64 ip2)
|
||||
U0 ICAssign(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
CIntermediateCode *tempi1;
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
ICMov(tempi,tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->r.type&TY_MASK) {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG)
|
||||
if (tempi->r.type.mode) {
|
||||
if (tempi->a1.type&MDF_REG)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
else
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
}
|
||||
} else {
|
||||
if (tempi->a1.type&TY_MASK==TY_REG) {
|
||||
if (!(tempi1=OptLag1(tempi)) ||
|
||||
tempi1->ic_code!=IC_ADD_CONST ||
|
||||
tempi1->r.type!=TY_REG+RT_I64 || tempi1->r.reg!=tempi->a1.reg ||
|
||||
tempi1->a1.type!=TY_REG+RT_I64 || tempi1->a1.reg!=tempi->a1.reg ||
|
||||
(tempi->a2.type&TY_MASK==TY_REG||tempi->a2.type&TY_MASK==TY_DISP) &&
|
||||
if (tempi->a1.type&MDF_REG) {
|
||||
if (!(tempi1=OptLag1(tempi)) || tempi1->ic_code!=IC_ADD_CONST ||
|
||||
tempi1->r.type!=MDF_REG+RT_I64 || tempi1->r.reg!=tempi->a1.reg ||
|
||||
tempi1->a1.type!=MDF_REG+RT_I64 || tempi1->a1.reg!=tempi->a1.reg ||
|
||||
(tempi->a2.type&MDF_REG || tempi->a2.type&MDF_DISP) &&
|
||||
tempi->a2.reg==tempi->a1.reg ||
|
||||
tempi->r.type&TY_MASK ||
|
||||
tempi1->ic_flags&~ICG_NO_CVT_MASK) {
|
||||
tempi->r.type.mode || tempi1->ic_flags&~ICG_NO_CVT_MASK) {
|
||||
ICMov(tempi,
|
||||
TY_DISP+tempi->a1.type_pointed_to,tempi->a1.reg,tempi->a1.disp,
|
||||
MDF_DISP+tempi->a1.type_pointed_to,tempi->a1.reg,tempi->a1.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
@@ -193,16 +191,16 @@ U0 ICAssign(CIntermediateCode *tempi,I64 ip)
|
||||
~ICF_CODE_FINAL|ICF_DONT_RESTORE;
|
||||
tempi->a1.disp=tempi1->ic_data;
|
||||
OptSetNOP1(tempi1); //This better not be last pass!
|
||||
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,
|
||||
ICMov(tempi,MDF_DISP+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
}
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
ICMov(tempi,MDF_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
}
|
||||
@@ -217,135 +215,80 @@ U0 ICBrBitOps(CIntermediateCode *tempi,I64 ip,
|
||||
Bool short_jmp;
|
||||
CCodeMisc *lb;
|
||||
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (!(tempi->ic_flags&ICF_SWAP) && a1->type&TY_MASK!=TY_REG &&
|
||||
(a1->type&TY_MASK!=TY_IMM || a1->disp>63) ||
|
||||
tempi->ic_flags&ICF_SWAP && a1->type&TY_MASK==TY_IMM &&
|
||||
a1->disp<64 || a1->type&TY_MASK==TY_STK) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
t1=TY_REG+RT_I64;
|
||||
r1=REG_RCX;
|
||||
d1=0;
|
||||
} else {
|
||||
t1=a1->type;
|
||||
if (t1&TY_MASK==TY_IMM && a1->disp<64)
|
||||
r1=0;
|
||||
else
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
}
|
||||
if (tempi->ic_flags&ICF_SWAP && a2->type&TY_MASK!=TY_REG &&
|
||||
(a2->type&TY_MASK!=TY_IMM || a2->disp>63) ||
|
||||
!(tempi->ic_flags&ICF_SWAP) && a2->type&TY_MASK==TY_IMM &&
|
||||
a2->disp<64 || a2->type&TY_MASK==TY_STK) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
t2=TY_REG+RT_I64;
|
||||
r2=REG_RDX;
|
||||
d2=0;
|
||||
} else {
|
||||
t2=a2->type;
|
||||
if (t2&TY_MASK==TY_IMM && a2->disp<64)
|
||||
r2=0;
|
||||
else
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
}
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
if (tempi->ic_flags&ICF_SWAP && !(a2->type&MDF_REG) &&
|
||||
(!(a2->type&MDF_IMM) ||a2->disp>63)||
|
||||
!(tempi->ic_flags&ICF_SWAP) && a2->type&MDF_IMM &&
|
||||
a2->disp<64 || a2->type&MDF_STK) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
t2=MDF_REG+RT_I64;
|
||||
r2=REG_RCX;
|
||||
d2=0;
|
||||
} else {
|
||||
if (tempi->ic_flags&ICF_SWAP && a2->type&TY_MASK!=TY_REG &&
|
||||
(a2->type&TY_MASK!=TY_IMM ||a2->disp>63)||
|
||||
!(tempi->ic_flags&ICF_SWAP) && a2->type&TY_MASK==TY_IMM &&
|
||||
a2->disp<64 || a2->type&TY_MASK==TY_STK) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
t2=TY_REG+RT_I64;
|
||||
r2=REG_RCX;
|
||||
d2=0;
|
||||
} else {
|
||||
t2=a2->type;
|
||||
if (t2&TY_MASK==TY_IMM && a2->disp<64)
|
||||
r2=0;
|
||||
else
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
}
|
||||
if (!(tempi->ic_flags&ICF_SWAP) && a1->type&TY_MASK!=TY_REG &&
|
||||
(a1->type&TY_MASK!=TY_IMM || a1->disp>63) ||
|
||||
tempi->ic_flags&ICF_SWAP && a1->type&TY_MASK==TY_IMM &&
|
||||
a1->disp<64 || a1->type&TY_MASK==TY_STK) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
t1=TY_REG+RT_I64;
|
||||
r1=REG_RDX;
|
||||
d1=0;
|
||||
} else {
|
||||
t1=a1->type;
|
||||
if (t1&TY_MASK==TY_IMM && a1->disp<64)
|
||||
r1=0;
|
||||
else
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
}
|
||||
t2=a2->type;
|
||||
if (t2&MDF_IMM && a2->disp<64)
|
||||
r2=0;
|
||||
else
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
}
|
||||
if (!(tempi->ic_flags&ICF_SWAP) && !(a1->type&MDF_REG) &&
|
||||
(!(a1->type&MDF_IMM) || a1->disp>63) ||
|
||||
tempi->ic_flags&ICF_SWAP && a1->type&MDF_IMM &&
|
||||
a1->disp<64 || a1->type&MDF_STK) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
t1=MDF_REG+RT_I64;
|
||||
r1=REG_RDX;
|
||||
d1=0;
|
||||
} else {
|
||||
t1=a1->type;
|
||||
if (t1&MDF_IMM && a1->disp<64)
|
||||
r1=0;
|
||||
else
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
}
|
||||
} else {
|
||||
t1=TY_DISP+RT_I64;
|
||||
t2=TY_DISP+RT_I64;
|
||||
t1=MDF_DISP+RT_I64;
|
||||
t2=MDF_DISP+RT_I64;
|
||||
d1=0;
|
||||
d2=0;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (a1->type&TY_MASK==TY_REG)
|
||||
r1=a1->reg;
|
||||
else if (tempi->ic_flags&ICF_SWAP || a1->type&TY_MASK!=TY_IMM ||
|
||||
a1->disp>63) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
r1=REG_RCX;
|
||||
} else
|
||||
r1=0;
|
||||
if (a2->type&TY_MASK==TY_REG)
|
||||
r2=a2->reg;
|
||||
else if (!(tempi->ic_flags&ICF_SWAP) || a2->type&TY_MASK!=TY_IMM ||
|
||||
a2->disp>63) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
r2=REG_RDX;
|
||||
} else
|
||||
r2=0;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_REG)
|
||||
r2=a2->reg;
|
||||
else if (!(tempi->ic_flags&ICF_SWAP) || a2->type&TY_MASK!=TY_IMM ||
|
||||
a2->disp>63) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
r2=REG_RCX;
|
||||
} else
|
||||
r2=0;
|
||||
if (a1->type&TY_MASK==TY_REG)
|
||||
r1=a1->reg;
|
||||
else if (tempi->ic_flags&ICF_SWAP || a1->type&TY_MASK!=TY_IMM ||
|
||||
a1->disp>63) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
r1=REG_RDX;
|
||||
} else
|
||||
r1=0;
|
||||
}
|
||||
if (a2->type&MDF_REG)
|
||||
r2=a2->reg;
|
||||
else if (!(tempi->ic_flags&ICF_SWAP) || !(a2->type&MDF_IMM) ||
|
||||
a2->disp>63) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
r2=REG_RCX;
|
||||
} else
|
||||
r2=0;
|
||||
if (a1->type&MDF_REG)
|
||||
r1=a1->reg;
|
||||
else if (tempi->ic_flags&ICF_SWAP || !(a1->type&MDF_IMM) || a1->disp>63) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
r1=REG_RDX;
|
||||
} else
|
||||
r1=0;
|
||||
}
|
||||
if (tempi->ic_flags&ICF_LOCK && op!=0xA30F)
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
if (tempi->ic_flags&ICF_SWAP) {
|
||||
if (a2->type&TY_MASK==TY_IMM && a2->disp<32) {
|
||||
if (a2->type&MDF_IMM && a2->disp<32) {
|
||||
if (op==0xA30F && a2->disp<8) {
|
||||
t=t1&TY_MASK+RT_U8;
|
||||
t=t1&MDG_MASK+RT_U8;
|
||||
op_imm=0xF6; //TEST
|
||||
} else
|
||||
t=t1&TY_MASK+RT_U32;
|
||||
t=t1&MDG_MASK+RT_U32;
|
||||
} else
|
||||
t=t1;
|
||||
i=ICModr1(r2,t,r1,d1);
|
||||
SwapI64(&a1,&a2);
|
||||
} else {
|
||||
if (a1->type&TY_MASK==TY_IMM && a1->disp<32) {
|
||||
if (a1->type&MDF_IMM && a1->disp<32) {
|
||||
if (op==0xA30F && a1->disp<8) {
|
||||
t=t2&TY_MASK+RT_U8;
|
||||
t=t2&MDG_MASK+RT_U8;
|
||||
op_imm=0xF6; //TEST
|
||||
} else
|
||||
t=t2&TY_MASK+RT_U32;
|
||||
t=t2&MDG_MASK+RT_U32;
|
||||
} else
|
||||
t=t2;
|
||||
i=ICModr1(r1,t,r2,d2);
|
||||
@@ -359,7 +302,7 @@ U0 ICBrBitOps(CIntermediateCode *tempi,I64 ip,
|
||||
is=0x75850F;
|
||||
else
|
||||
is=0x74840F;
|
||||
} else if (a1->type&TY_MASK==TY_IMM && a1->disp<64) {
|
||||
} else if (a1->type&MDF_IMM && a1->disp<64) {
|
||||
ICU24(tempi,i.u8[2]<<16+op_imm);
|
||||
ICModr2(tempi,i,a2->disp,ip2+5);
|
||||
ICU8(tempi,a1->disp);
|
||||
@@ -398,111 +341,77 @@ U0 ICBrBitOps(CIntermediateCode *tempi,I64 ip,
|
||||
U0 ICQueInit(CIntermediateCode *tempi,I64 ip2)
|
||||
{
|
||||
I64 r1;
|
||||
if (tempi->a1.type==TY_REG+RT_I64)
|
||||
if (tempi->a1.type==MDF_REG+RT_I64)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
r1=REG_RAX;
|
||||
}
|
||||
ICMov(tempi,TY_DISP+RT_I64,r1,0,TY_REG+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,r1,sizeof(U8 *),TY_REG+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,r1,0,MDF_REG+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,r1,sizeof(U8 *),MDF_REG+RT_I64,r1,0,ip2);
|
||||
}
|
||||
|
||||
U0 ICQueIns(CIntermediateCode *tempi,I64 ip2)
|
||||
{
|
||||
I64 r1,r2;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (tempi->a1.type==TY_REG+RT_I64 && tempi->a1.reg!=REG_RAX)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
r1=REG_RDX;
|
||||
}
|
||||
if (tempi->a2.type==TY_REG+RT_I64)
|
||||
r2=tempi->a2.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
r2=REG_RAX;
|
||||
}
|
||||
} else {
|
||||
if (tempi->a2.type==TY_REG+RT_I64 && tempi->a2.reg!=REG_RDX)
|
||||
r2=tempi->a2.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
r2=REG_RAX;
|
||||
}
|
||||
if (tempi->a1.type==TY_REG+RT_I64)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
r1=REG_RDX;
|
||||
}
|
||||
if (tempi->a2.type==MDF_REG+RT_I64 && tempi->a2.reg!=REG_RDX)
|
||||
r2=tempi->a2.reg;
|
||||
else {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
r2=REG_RAX;
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,TY_DISP+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,r1,0,TY_REG+RT_I64,r2,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,r2,0,TY_REG+RT_I64,REG_RBX,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,r2,sizeof(U8 *),TY_REG+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,REG_RBX,sizeof(U8 *),TY_REG+RT_I64,r2,0,ip2);
|
||||
if (tempi->a1.type==MDF_REG+RT_I64)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
r1=REG_RDX;
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,MDF_DISP+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,r1,0,MDF_REG+RT_I64,r2,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,r2,0,MDF_REG+RT_I64,REG_RBX,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,r2,sizeof(U8 *),MDF_REG+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,REG_RBX,sizeof(U8 *),MDF_REG+RT_I64,r2,0,ip2);
|
||||
}
|
||||
|
||||
U0 ICQueInsRev(CIntermediateCode *tempi,I64 ip2)
|
||||
{
|
||||
I64 r1,r2;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (tempi->a1.type==TY_REG+RT_I64 && tempi->a1.reg!=REG_RAX)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
r1=REG_RDX;
|
||||
}
|
||||
if (tempi->a2.type==TY_REG+RT_I64)
|
||||
r2=tempi->a2.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
r2=REG_RAX;
|
||||
}
|
||||
} else {
|
||||
if (tempi->a2.type==TY_REG+RT_I64 && tempi->a2.reg!=REG_RDX)
|
||||
r2=tempi->a2.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
r2=REG_RAX;
|
||||
}
|
||||
if (tempi->a1.type==TY_REG+RT_I64)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
r1=REG_RDX;
|
||||
}
|
||||
if (tempi->a2.type==MDF_REG+RT_I64 && tempi->a2.reg!=REG_RDX)
|
||||
r2=tempi->a2.reg;
|
||||
else {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
r2=REG_RAX;
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,TY_DISP+RT_I64,r1,sizeof(U8 *),ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,REG_RBX,0,TY_REG+RT_I64,r2,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,r2,0,TY_REG+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,r2,sizeof(U8 *),TY_REG+RT_I64,REG_RBX,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,r1,sizeof(U8 *),TY_REG+RT_I64,r2,0,ip2);
|
||||
if (tempi->a1.type==MDF_REG+RT_I64)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
r1=REG_RDX;
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,MDF_DISP+RT_I64,r1,sizeof(U8 *),ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,REG_RBX,0,MDF_REG+RT_I64,r2,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,r2,0,MDF_REG+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,r2,sizeof(U8 *),MDF_REG+RT_I64,REG_RBX,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,r1,sizeof(U8 *),MDF_REG+RT_I64,r2,0,ip2);
|
||||
}
|
||||
|
||||
U0 ICQueRem(CIntermediateCode *tempi,I64 ip2)
|
||||
{
|
||||
I64 r1;
|
||||
if (tempi->a1.type==TY_REG+RT_I64)
|
||||
if (tempi->a1.type==MDF_REG+RT_I64)
|
||||
r1=tempi->a1.reg;
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
r1=REG_RAX;
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,TY_DISP+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,TY_DISP+RT_I64,r1,sizeof(U8 *),ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,MDF_DISP+RT_I64,r1,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,MDF_DISP+RT_I64,r1,sizeof(U8 *),ip2);
|
||||
ICU24(tempi,0x1A8948);
|
||||
ICU32(tempi,sizeof(U8 *)<<24+0x538948);
|
||||
}
|
||||
@@ -510,68 +419,34 @@ U0 ICQueRem(CIntermediateCode *tempi,I64 ip2)
|
||||
U0 ICMinMax(CIntermediateCode *tempi,I64 op,I64 ip2)
|
||||
{
|
||||
I64 r1,i1=0x48;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (tempi->a1.type==TY_REG+RT_I64 && tempi->a1.reg!=REG_RAX) {
|
||||
r1=tempi->a1.reg;
|
||||
if (r1>7) {
|
||||
i1++;
|
||||
r1&=7;
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
} else {
|
||||
if (tempi->a2.reg==REG_RAX && TY_REG<=tempi->a2.type&TY_MASK<=TY_SIB) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
r1=REG_RDX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
if (tempi->a2.type==TY_REG+RT_I64) {
|
||||
r1=tempi->a2.reg;
|
||||
if (r1>7) {
|
||||
i1++;
|
||||
r1&=7;
|
||||
}
|
||||
} else {
|
||||
r1=REG_RDX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
}
|
||||
}
|
||||
if (tempi->a2.type==MDF_REG+RT_I64 && tempi->a2.reg!=REG_RAX) {
|
||||
r1=tempi->a2.reg;
|
||||
if (r1>7) {
|
||||
i1++;
|
||||
r1&=7;
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
} else {
|
||||
if (tempi->a2.type==TY_REG+RT_I64 && tempi->a2.reg!=REG_RAX) {
|
||||
r1=tempi->a2.reg;
|
||||
if (r1>7) {
|
||||
i1++;
|
||||
r1&=7;
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
if (tempi->a1.reg==REG_RAX && tempi->a1.type&MDG_REG_DISP_SIB) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
r1=REG_RDX;
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
} else {
|
||||
if (tempi->a1.reg==REG_RAX && TY_REG<=tempi->a1.type&TY_MASK<=TY_SIB) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
r1=REG_RDX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
if (tempi->a1.type==TY_REG+RT_I64) {
|
||||
r1=tempi->a1.reg;
|
||||
if (r1>7) {
|
||||
i1++;
|
||||
r1&=7;
|
||||
}
|
||||
} else {
|
||||
r1=REG_RDX;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
if (tempi->a1.type==MDF_REG+RT_I64) {
|
||||
r1=tempi->a1.reg;
|
||||
if (r1>7) {
|
||||
i1++;
|
||||
r1&=7;
|
||||
}
|
||||
} else {
|
||||
r1=REG_RDX;
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -581,113 +456,83 @@ U0 ICMinMax(CIntermediateCode *tempi,I64 op,I64 ip2)
|
||||
|
||||
U0 ICSqr(CIntermediateCode *tempi,I64 op,I64 ip2)
|
||||
{
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
ICSlashOp(tempi,TY_REG+RT_I64,REG_RAX,0,op,ip2);
|
||||
ICSlashOp(tempi,MDF_REG+RT_I64,REG_RAX,0,op,ip2);
|
||||
}
|
||||
|
||||
U0 ICModU64(CIntermediateCode *tempi,I64 ip2)
|
||||
{
|
||||
I64 t1,r1,d1;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (tempi->a1.reg!=REG_RAX && tempi->a1.reg!=REG_RDX &&
|
||||
TY_REG<=tempi->a1.type&TY_MASK<=TY_SIB &&
|
||||
tempi->a1.type&RT_MASK>=RT_I64) {
|
||||
t1=tempi->a1.type;
|
||||
r1=tempi->a1.reg;
|
||||
d1=tempi->a1.disp;
|
||||
} else {
|
||||
t1=TY_REG+RT_I64;
|
||||
r1=REG_RBX;
|
||||
d1=0;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
CICType t1;
|
||||
I64 r1,d1;
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
if (tempi->a1.reg!=REG_RAX && tempi->a1.reg!=REG_RDX &&
|
||||
tempi->a1.type&MDG_REG_DISP_SIB &&
|
||||
tempi->a1.type.raw_type>=RT_I64) {
|
||||
t1=tempi->a1.type;
|
||||
r1=tempi->a1.reg;
|
||||
d1=tempi->a1.disp;
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
if (tempi->a1.reg!=REG_RAX && tempi->a1.reg!=REG_RDX &&
|
||||
TY_REG<=tempi->a1.type&TY_MASK<=TY_SIB &&
|
||||
tempi->a1.type&RT_MASK>=RT_I64) {
|
||||
t1=tempi->a1.type;
|
||||
r1=tempi->a1.reg;
|
||||
d1=tempi->a1.disp;
|
||||
} else {
|
||||
t1=TY_REG+RT_I64;
|
||||
r1=REG_RBX;
|
||||
d1=0;
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
}
|
||||
t1=MDF_REG+RT_I64;
|
||||
r1=REG_RBX;
|
||||
d1=0;
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,TY_DISP+RT_I64,REG_RCX,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,MDF_DISP+RT_I64,REG_RCX,0,ip2);
|
||||
ICZero(tempi,REG_RDX);
|
||||
ICSlashOp(tempi,t1,r1,d1,SLASH_OP_DIV,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_I64,REG_RCX,0,TY_REG+RT_I64,REG_RAX,0,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
TY_REG+RT_I64,REG_RDX,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,REG_RCX,0,MDF_REG+RT_I64,REG_RAX,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
MDF_REG+RT_I64,REG_RDX,0,ip2);
|
||||
}
|
||||
|
||||
U0 ICSwap(CIntermediateCode *tempi,I64 ip2)
|
||||
{
|
||||
I64 r1,r2;
|
||||
if (tempi->a1.type&TY_MASK==TY_REG)
|
||||
if (tempi->a1.type&MDF_REG)
|
||||
r1=tempi->a1.reg;
|
||||
else
|
||||
r1=REG_RAX;
|
||||
if (tempi->a2.type&TY_MASK==TY_REG)
|
||||
if (tempi->a2.type&MDF_REG)
|
||||
r2=tempi->a2.reg;
|
||||
else
|
||||
r2=REG_RAX;
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (r1==r2) {
|
||||
if (r2==REG_RAX)
|
||||
r2=REG_RBX;
|
||||
else
|
||||
r1=REG_RAX;
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,r1,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,r2,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
} else {
|
||||
if (r1==r2) {
|
||||
if (r1==REG_RAX)
|
||||
r1=REG_RBX;
|
||||
else
|
||||
r2=REG_RAX;
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,r2,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,r1,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
if (r1==r2) {
|
||||
if (r1==REG_RAX)
|
||||
r1=REG_RBX;
|
||||
else
|
||||
r2=REG_RAX;
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,r2,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,r1,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
switch (tempi->ic_code) {
|
||||
case IC_SWAP_U8:
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,TY_DISP+RT_U8,r1,0,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,TY_DISP+RT_U8,r2,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_U8,r2,0,TY_REG+RT_I64,REG_RCX,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_U8,r1,0,TY_REG+RT_I64,REG_RDX,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,MDF_DISP+RT_U8,r1,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,MDF_DISP+RT_U8,r2,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_U8,r2,0,MDF_REG+RT_I64,REG_RCX,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_U8,r1,0,MDF_REG+RT_I64,REG_RDX,0,ip2);
|
||||
break;
|
||||
case IC_SWAP_U16:
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,TY_DISP+RT_U16,r1,0,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,TY_DISP+RT_U16,r2,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_U16,r2,0,TY_REG+RT_I64,REG_RCX,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_U16,r1,0,TY_REG+RT_I64,REG_RDX,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,MDF_DISP+RT_U16,r1,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,MDF_DISP+RT_U16,r2,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_U16,r2,0,MDF_REG+RT_I64,REG_RCX,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_U16,r1,0,MDF_REG+RT_I64,REG_RDX,0,ip2);
|
||||
break;
|
||||
case IC_SWAP_U32:
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,TY_DISP+RT_U32,r1,0,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,TY_DISP+RT_U32,r2,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_U32,r2,0,TY_REG+RT_I64,REG_RCX,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_U32,r1,0,TY_REG+RT_I64,REG_RDX,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,MDF_DISP+RT_U32,r1,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,MDF_DISP+RT_U32,r2,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_U32,r2,0,MDF_REG+RT_I64,REG_RCX,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_U32,r1,0,MDF_REG+RT_I64,REG_RDX,0,ip2);
|
||||
break;
|
||||
case IC_SWAP_I64:
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,TY_DISP+RT_U64,r1,0,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,TY_DISP+RT_U64,r2,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_U64,r2,0,TY_REG+RT_I64,REG_RCX,0,ip2);
|
||||
ICMov(tempi,TY_DISP+RT_U64,r1,0,TY_REG+RT_I64,REG_RDX,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,MDF_DISP+RT_U64,r1,0,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,MDF_DISP+RT_U64,r2,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_U64,r2,0,MDF_REG+RT_I64,REG_RCX,0,ip2);
|
||||
ICMov(tempi,MDF_DISP+RT_U64,r1,0,MDF_REG+RT_I64,REG_RDX,0,ip2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -695,14 +540,14 @@ U0 ICSwap(CIntermediateCode *tempi,I64 ip2)
|
||||
U0 ICAndEqu(CIntermediateCode *tempi,I64 ip2)
|
||||
{
|
||||
I64 i,bit;
|
||||
if (tempi->a2.type&TY_MASK==TY_IMM && tempi->a1.type&TY_MASK!=TY_STK &&
|
||||
if (tempi->a2.type&MDF_IMM && !(tempi->a1.type&MDF_STK) &&
|
||||
tempi->ic_flags&ICF_NO_DEPEND_RESULT) {
|
||||
i=~tempi->a2.disp;
|
||||
bit=Bsf(i);
|
||||
if (0<=bit==Bsr(i)) {
|
||||
tempi->a2.disp=bit;
|
||||
tempi->a2.reg=0;
|
||||
tempi->a1.type=tempi->a1.type&TY_MASK+RT_I64;
|
||||
tempi->a1.type=tempi->a1.type&MDG_MASK+RT_I64;
|
||||
ICBitOps(tempi,&tempi->a2,&tempi->a1,tempi,0xB30F,0x30BA0F,ip2);
|
||||
return;
|
||||
}
|
||||
@@ -716,14 +561,14 @@ U0 ICAndEqu(CIntermediateCode *tempi,I64 ip2)
|
||||
U0 ICOrEqu(CIntermediateCode *tempi,I64 ip2)
|
||||
{
|
||||
I64 i,bit;
|
||||
if (tempi->a2.type&TY_MASK==TY_IMM && tempi->a1.type&TY_MASK!=TY_STK &&
|
||||
if (tempi->a2.type&MDF_IMM && !(tempi->a1.type&MDF_STK) &&
|
||||
tempi->ic_flags&ICF_NO_DEPEND_RESULT) {
|
||||
i=tempi->a2.disp;
|
||||
bit=Bsf(i);
|
||||
if (0<=bit==Bsr(i) && i>MAX_I8) {
|
||||
tempi->a2.disp=bit;
|
||||
tempi->a2.reg=0;
|
||||
tempi->a1.type=tempi->a1.type&TY_MASK+RT_I64;
|
||||
tempi->a1.type=tempi->a1.type&MDG_MASK+RT_I64;
|
||||
ICBitOps(tempi,&tempi->a2,&tempi->a1,tempi,0xAB0F,0x28BA0F,ip2);
|
||||
return;
|
||||
}
|
||||
@@ -737,14 +582,14 @@ U0 ICOrEqu(CIntermediateCode *tempi,I64 ip2)
|
||||
U0 ICXorEqu(CIntermediateCode *tempi,I64 ip2)
|
||||
{
|
||||
I64 i,bit;
|
||||
if (tempi->a2.type&TY_MASK==TY_IMM && tempi->a1.type&TY_MASK!=TY_STK &&
|
||||
if (tempi->a2.type&MDF_IMM && !(tempi->a1.type&MDF_STK) &&
|
||||
tempi->ic_flags&ICF_NO_DEPEND_RESULT) {
|
||||
i=tempi->a2.disp;
|
||||
bit=Bsf(i);
|
||||
if (0<=bit==Bsr(i)) {
|
||||
tempi->a2.disp=bit;
|
||||
tempi->a2.reg=0;
|
||||
tempi->a1.type=tempi->a1.type&TY_MASK+RT_I64;
|
||||
tempi->a1.type=tempi->a1.type&MDG_MASK+RT_I64;
|
||||
ICBitOps(tempi,&tempi->a2,&tempi->a1,tempi,0xBB0F,0x38BA0F,ip2);
|
||||
return;
|
||||
}
|
||||
@@ -762,17 +607,17 @@ U0 ICSwitch(CIntermediateCode *tempi,I64 ip,
|
||||
CCodeMisc *lb;
|
||||
Bool short_jmp;
|
||||
CAOTAbsAddr *tempa;
|
||||
if (tempi->a1.type&TY_MASK!=TY_REG || tempi->a1.reg&7==REG_RSP)
|
||||
if (!(tempi->a1.type&MDF_REG) || tempi->a1.reg&7==REG_RSP)
|
||||
r=REG_RDX;
|
||||
else
|
||||
r=tempi->a1.reg;
|
||||
if (nobound)
|
||||
ICMov(tempi,TY_REG+RT_I64,r,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,r,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
else {
|
||||
if (tempi->a2.type&TY_MASK==TY_IMM) {
|
||||
if (tempi->a2.type&MDF_IMM) {
|
||||
j=tempi->a2.disp;
|
||||
ICMov(tempi,TY_REG+RT_I64,r,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,r,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
if (MIN_I8<=j<=MAX_I8) {
|
||||
i=0xF88348+(r&7)<<16;
|
||||
@@ -785,24 +630,17 @@ U0 ICSwitch(CIntermediateCode *tempi,I64 ip,
|
||||
ICU24(tempi,i);
|
||||
ICU32(tempi,j);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
i=0xC13B48+(r&7)<<19;
|
||||
if (r>7) i+=4;
|
||||
ICU24(tempi,i);
|
||||
}
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,r,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,r,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,r,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip2);
|
||||
i=0xC13B48+(r&7)<<19;
|
||||
if (r>7) i+=4;
|
||||
ICU24(tempi,i);
|
||||
|
||||
+112
-169
@@ -21,17 +21,19 @@ U0 CmpNoteFloatOp(CCmpCtrl *cc,CIntermediateCode *tempi,
|
||||
case CN_MAIN:
|
||||
if (cc->last_float_op_ic!=tempi) {
|
||||
if (cc->dont_push_float) {
|
||||
if (!(tempi->ic_flags & ICF_A1_FIRST))
|
||||
tempi->ic_flags|=ICF_ALTERNATE_TEMPLATE;
|
||||
if (intermediate_code_table[tempi->ic_code].arg_cnt==IS_2_ARG &&
|
||||
cc->last_float_op_ic->r.reg!=REG_R8)
|
||||
tempi->ic_flags|=ICF_ALT_TEMPLATE;
|
||||
else
|
||||
tempi->ic_flags&=~ICF_ALTERNATE_TEMPLATE;
|
||||
tempi->ic_flags&=~ICF_ALT_TEMPLATE;
|
||||
link=TRUE;
|
||||
}
|
||||
} else {
|
||||
if (cc->last_float_op_pos==CN_A1 ^^ !(tempi->ic_flags & ICF_A1_FIRST))
|
||||
tempi->ic_flags|=ICF_ALTERNATE_TEMPLATE;
|
||||
if (intermediate_code_table[tempi->ic_code].arg_cnt==IS_2_ARG &&
|
||||
cc->last_float_op_pos!=CN_A1)
|
||||
tempi->ic_flags|=ICF_ALT_TEMPLATE;
|
||||
else
|
||||
tempi->ic_flags&=~ICF_ALTERNATE_TEMPLATE;
|
||||
tempi->ic_flags&=~ICF_ALT_TEMPLATE;
|
||||
link=TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -79,7 +81,7 @@ U0 ICCopyTemplate(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,
|
||||
U8 *ptr;
|
||||
I64 i=0;
|
||||
if (!off_the_record) {
|
||||
if (tempi->ic_flags&ICF_ALTERNATE_TEMPLATE)
|
||||
if (tempi->ic_flags&ICF_ALT_TEMPLATE)
|
||||
alt=TRUE;
|
||||
else
|
||||
alt=FALSE;
|
||||
@@ -118,8 +120,8 @@ U0 ICCopyTemplate(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,
|
||||
tempi->ic_cnt+=i;
|
||||
}
|
||||
|
||||
U0 ICFCvt(CCmpCtrl *cc,CIntermediateCode *tempi,
|
||||
I64 r1,I64 t2,I64 r2,I64 d2,Bool to_int,I64 pos,I64 ip)
|
||||
U0 ICFCvt(CCmpCtrl *cc,CIntermediateCode *tempi,I64 r1,
|
||||
CICType t2,I64 r2,I64 d2,Bool to_int,I64 pos,I64 ip)
|
||||
{
|
||||
I64 rsp_size=0,op1,op2;
|
||||
Bool dont_push_float,dont_pop_float;
|
||||
@@ -134,12 +136,9 @@ U0 ICFCvt(CCmpCtrl *cc,CIntermediateCode *tempi,
|
||||
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (!dont_push_float) {
|
||||
if (!(t2&RT_MASK>=RT_I64 &&
|
||||
(t2&TY_MASK==TY_DISP ||
|
||||
t2&TY_MASK==TY_RIP_DISP32 ||
|
||||
t2&TY_MASK==TY_SIB))) {
|
||||
if (!(t2.raw_type>=RT_I64 && t2&MDG_DISP_SIB_RIP)) {
|
||||
ICPush(tempi,t2,r2,d2,ip);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size=8;
|
||||
} else {
|
||||
if (!dont_pop_float) {
|
||||
@@ -162,13 +161,13 @@ U0 ICFCvt(CCmpCtrl *cc,CIntermediateCode *tempi,
|
||||
if (rsp_size)
|
||||
ICAddRSP(tempi,rsp_size);
|
||||
} else {
|
||||
ICSlashOp(tempi,TY_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,op2,ip);
|
||||
ICPop(tempi,TY_REG+RT_I64,r1,0,ip);
|
||||
ICSlashOp(tempi,MDF_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,op2,ip);
|
||||
ICPop(tempi,MDF_REG+RT_I64,r1,0,ip);
|
||||
}
|
||||
}
|
||||
|
||||
U0 ICFCvt2(CCmpCtrl *cc,CIntermediateCode *tempi,
|
||||
I64 r1,I64 t2,I64 r2,I64 d2,Bool to_int,I64 ip)
|
||||
U0 ICFCvt2(CCmpCtrl *cc,CIntermediateCode *tempi,I64 r1,
|
||||
CICType t2,I64 r2,I64 d2,Bool to_int,I64 ip)
|
||||
{
|
||||
I64 rsp_size=0,op1,op2;
|
||||
if (to_int) {
|
||||
@@ -178,20 +177,17 @@ U0 ICFCvt2(CCmpCtrl *cc,CIntermediateCode *tempi,
|
||||
op1=SLASH_OP_FILD;
|
||||
op2=SLASH_OP_FSTP;
|
||||
}
|
||||
if (!(t2&RT_MASK>=RT_I64 &&
|
||||
(t2&TY_MASK==TY_DISP ||
|
||||
t2&TY_MASK==TY_RIP_DISP32 ||
|
||||
t2&TY_MASK==TY_SIB))) {
|
||||
if (!(t2.raw_type>=RT_I64 && t2&MDG_DISP_SIB_RIP)) {
|
||||
ICPush(tempi,t2,r2,d2,ip);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size=8;
|
||||
} else {
|
||||
rsp_size=8;
|
||||
ICAddRSP(tempi,-8);
|
||||
}
|
||||
ICSlashOp(tempi,t2,r2,d2,op1,ip);
|
||||
ICSlashOp(tempi,TY_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,op2,ip);
|
||||
ICPop(tempi,TY_REG+RT_I64,r1,0,ip);
|
||||
ICSlashOp(tempi,MDF_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,op2,ip);
|
||||
ICPop(tempi,MDF_REG+RT_I64,r1,0,ip);
|
||||
cc->last_dont_pushable=cc->last_dont_popable=FALSE; //TODO: improve this
|
||||
}
|
||||
|
||||
@@ -206,23 +202,20 @@ U0 ICFUnaryMinus(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf2,I64 ip)
|
||||
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (!dont_push_float) {
|
||||
if (a1->type&RT_MASK>=RT_I64 &&
|
||||
(a1->type&TY_MASK==TY_DISP ||
|
||||
a1->type&TY_MASK==TY_RIP_DISP32 ||
|
||||
a1->type&TY_MASK==TY_SIB)) {
|
||||
if (a1->type.raw_type>=RT_I64 && a1->type&MDG_DISP_SIB_RIP) {
|
||||
t1=a1->type;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
} else {
|
||||
if (a1->type&TY_MASK==TY_IMM) {
|
||||
if (a1->type&MDF_IMM) {
|
||||
if (!(builtin1=ICBuiltInFloatConst(a1->disp(F64)))) {
|
||||
t1=TY_RIP_DISP32+RT_I64;
|
||||
t1=MDF_RIP_DISP32+RT_I64;
|
||||
r1=REG_RIP;
|
||||
d1=COCFloatConstFind(cc,a1->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a1->type,a1->reg,a1->disp,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
@@ -241,7 +234,7 @@ U0 ICFUnaryMinus(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf2,I64 ip)
|
||||
if (rsp_size)
|
||||
ICAddRSP(tempi,rsp_size);
|
||||
} else {
|
||||
ICSlashOp(tempi,TY_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,SLASH_OP_FSTP,ip);
|
||||
ICSlashOp(tempi,MDF_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,SLASH_OP_FSTP,ip);
|
||||
ICPop(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,ip);
|
||||
}
|
||||
}
|
||||
@@ -251,30 +244,23 @@ U0 ICFMod(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip)
|
||||
Bool dont_push_float,dont_pop_float;
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (dont_push_float) {
|
||||
if (tempi->ic_flags&ICF_ALTERNATE_TEMPLATE)
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
if (tempi->ic_flags&ICF_ALT_TEMPLATE)
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
else
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
//TODO: unpushable,unpop? Not sure
|
||||
ICCopyTemplate(cc,tempi,CMP_TEMPLATE_MOD,FALSE,FALSE,FALSE,CN_MAIN);
|
||||
if (!dont_pop_float)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICFPow(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
@@ -284,17 +270,10 @@ U0 ICFPow(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
CHashExport *tempex=HashFind("SYS_POW",
|
||||
cc->htc.hash_table_lst,HTT_EXPORT_SYS_SYM);
|
||||
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (cc->flags&CCF_AOT_COMPILE) {
|
||||
if (!tempex) {
|
||||
tempex=CAlloc(sizeof(CHashExport));
|
||||
@@ -354,17 +333,16 @@ U0 ICFPow(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
}
|
||||
tempi->ic_flags&=~ICF_CODE_FINAL;
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICFOp(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,U8 *buf2,I64 ip)
|
||||
{//for ADD,SUB,DIV,MUL
|
||||
CICArg *a1,*a2;
|
||||
Bool dont_push_float,dont_pop_float,alt;
|
||||
I64 rsp_size=0,builtin1=0,builtin2=0,
|
||||
t1,r1,d1,t2,r2,d2;
|
||||
I64 rsp_size=0,builtin1=0,builtin2=0,t1,r1,d1,t2,r2,d2;
|
||||
|
||||
if (tempi->ic_flags&ICF_ALTERNATE_TEMPLATE) {
|
||||
if (tempi->ic_flags&ICF_ALT_TEMPLATE) {
|
||||
a1=&tempi->a2;
|
||||
a2=&tempi->a1;
|
||||
alt=TRUE;
|
||||
@@ -379,122 +357,115 @@ U0 ICFOp(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,U8 *buf2,I64 ip)
|
||||
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (dont_push_float) {
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
if (a2->type.raw_type>=RT_I64 && a2->type&MDG_DISP_SIB_RIP) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (a2->type&MDF_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64)))) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
t2=MDF_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST^^alt) {
|
||||
if (a2->type&TY_MASK!=TY_STK) {
|
||||
if (a1->type&RT_MASK>=RT_I64 && (a1->type&TY_MASK==TY_DISP ||
|
||||
a1->type&TY_MASK==TY_RIP_DISP32 || a1->type&TY_MASK==TY_SIB)) {
|
||||
if (alt) {
|
||||
if (!(a2->type&MDF_STK)) {
|
||||
if (a1->type.raw_type>=RT_I64 && a1->type&MDG_DISP_SIB_RIP) {
|
||||
t1=a1->type;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
} else {
|
||||
if (a1->type&TY_MASK==TY_IMM) {
|
||||
if (a1->type&MDF_IMM) {
|
||||
if (!(builtin1=ICBuiltInFloatConst(a1->disp(F64)))) {
|
||||
t1=TY_RIP_DISP32+RT_I64;
|
||||
t1=MDF_RIP_DISP32+RT_I64;
|
||||
r1=REG_RIP;
|
||||
d1=COCFloatConstFind(cc,a1->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a1->type,a1->reg,a1->disp,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
if (a2->type.raw_type>=RT_I64 && a2->type&MDG_DISP_SIB_RIP) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (a2->type&MDF_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64)))) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
t2=MDF_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
if (r1==REG_RSP+REG_RSP<<8)
|
||||
d1+=8;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
a1->type,a1->reg,a1->disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
a2->type,a2->reg,a2->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
ICU16(tempi,0x5052); //PUSH EDX PUSH EAX
|
||||
rsp_size=16;
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
}
|
||||
} else {
|
||||
if (a1->type&TY_MASK!=TY_STK) {
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
if (!(a1->type&MDF_STK)) {
|
||||
if (a2->type.raw_type>=RT_I64 && a2->type&MDG_DISP_SIB_RIP) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (a2->type&MDF_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64)))) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
t2=MDF_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
if (a1->type&RT_MASK>=RT_I64 && (a1->type&TY_MASK==TY_DISP ||
|
||||
a1->type&TY_MASK==TY_RIP_DISP32 || a1->type&TY_MASK==TY_SIB)) {
|
||||
if (a1->type.raw_type>=RT_I64 && a1->type&MDG_DISP_SIB_RIP) {
|
||||
t1=a1->type;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
} else {
|
||||
if (a1->type&TY_MASK==TY_IMM) {
|
||||
if (a1->type&MDF_IMM) {
|
||||
if (!(builtin1=ICBuiltInFloatConst(a1->disp(F64)))) {
|
||||
t1=TY_RIP_DISP32+RT_I64;
|
||||
t1=MDF_RIP_DISP32+RT_I64;
|
||||
r1=REG_RIP;
|
||||
d1=COCFloatConstFind(cc,a1->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a1->type,a1->reg,a1->disp,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
if (r2==REG_RSP+REG_RSP<<8)
|
||||
d2+=8;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICU16(tempi,0x5052); //PUSH EDX PUSH EAX
|
||||
rsp_size=16;
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -531,10 +502,9 @@ U0 ICFOp(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,U8 *buf2,I64 ip)
|
||||
ICAddRSP(tempi,rsp_size);
|
||||
} else {
|
||||
if (rsp_size==8)
|
||||
ICSlashOp(tempi,TY_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,
|
||||
SLASH_OP_FSTP,ip);
|
||||
ICSlashOp(tempi,MDF_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,SLASH_OP_FSTP,ip);
|
||||
else if (rsp_size>8) {
|
||||
ICSlashOp(tempi,TY_SIB+RT_I64,REG_RSP+REG_RSP<<8,rsp_size-8,
|
||||
ICSlashOp(tempi,MDF_SIB+RT_I64,REG_RSP+REG_RSP<<8,rsp_size-8,
|
||||
SLASH_OP_FSTP,ip);
|
||||
ICAddRSP(tempi,rsp_size-8);
|
||||
}
|
||||
@@ -547,114 +517,87 @@ U0 ICFCmp(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
Bool dont_push_float,dont_pop_float;
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (dont_push_float) {
|
||||
if (tempi->ic_flags&ICF_ALTERNATE_TEMPLATE) {
|
||||
if (tempi->ic_flags&ICF_ALT_TEMPLATE) {
|
||||
if (tempi->ic_flags&ICF_POP_CMP)
|
||||
ICPopRegs(tempi,1<<REG_RAX);
|
||||
else
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
} else
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (tempi->ic_flags&ICF_POP_CMP)
|
||||
ICPopRegs(tempi,1<<REG_RDX);
|
||||
else
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->ic_flags&ICF_POP_CMP)
|
||||
ICPopRegs(tempi,1<<REG_RDX);
|
||||
else
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
if (tempi->ic_flags&ICF_POP_CMP)
|
||||
ICPopRegs(tempi,1<<REG_RDX);
|
||||
else
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
}
|
||||
if (tempi->ic_flags&ICF_PUSH_CMP)
|
||||
ICPushRegs(tempi,1<<REG_RAX);
|
||||
ICCopyTemplate(cc,tempi,op,FALSE,TRUE,FALSE,CN_MAIN);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICFModEqu(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
Bool dont_push_float,dont_pop_float;
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
if (dont_push_float) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempi->a1.type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RAX,TY_REG+RT_I64,REG_RAX,0,FALSE,ip);
|
||||
} else if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempi->a1.type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RDX,TY_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICFCvt2(cc,tempi,REG_RAX,MDF_REG+RT_I64,REG_RAX,0,FALSE,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempi->a1.type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RDX,TY_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICFCvt2(cc,tempi,REG_RDX,MDF_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
}
|
||||
//TODO: unpushable,unpop? Not sure
|
||||
ICCopyTemplate(cc,tempi,CMP_TEMPLATE_MOD,FALSE,FALSE,FALSE,CN_MAIN);
|
||||
if (tempi->a1.type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RAX,TY_REG+RT_I64,REG_RAX,0,TRUE,ip);
|
||||
ICMov(tempi,tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
ICFCvt2(cc,tempi,REG_RAX,MDF_REG+RT_I64,REG_RAX,0,TRUE,ip);
|
||||
ICMov(tempi,tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a1.type&TY_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.type&MDG_MASK+tempi->a1.type_pointed_to,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
} else {
|
||||
if (dont_push_float) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,tempi->a1.type,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,tempi->a1.type,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
MDF_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
|
||||
if (tempi->a1.type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RAX,TY_REG+RT_I64,REG_RAX,0,FALSE,ip);
|
||||
} else if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,tempi->a1.type,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
|
||||
if (tempi->a1.type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RDX,TY_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICFCvt2(cc,tempi,REG_RAX,MDF_REG+RT_I64,REG_RAX,0,FALSE,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,tempi->a1.type,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,tempi->a1.type,
|
||||
tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
MDF_DISP+tempi->a1.type_pointed_to,REG_RCX,0,ip);
|
||||
if (tempi->a1.type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RDX,TY_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICFCvt2(cc,tempi,REG_RDX,MDF_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
}
|
||||
//TODO: unpushable,unpop? Not sure
|
||||
ICCopyTemplate(cc,tempi,CMP_TEMPLATE_MOD,FALSE,FALSE,FALSE,CN_MAIN);
|
||||
if (tempi->a1.type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RAX,TY_REG+RT_I64,REG_RAX,0,TRUE,ip);
|
||||
ICMov(tempi,TY_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
ICFCvt2(cc,tempi,REG_RAX,MDF_REG+RT_I64,REG_RAX,0,TRUE,ip);
|
||||
ICMov(tempi,MDF_DISP+tempi->a1.type_pointed_to,REG_RCX,0,
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
}
|
||||
+139
-239
@@ -13,117 +13,67 @@ U0 ICFOpEqu(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,U8 *buf2,I64 ip)
|
||||
if (dont_pop_float)
|
||||
throw('Compiler');
|
||||
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
p1_mem=FALSE;
|
||||
if (dont_push_float) {
|
||||
if (a1->type_pointed_to!=RT_F64) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
a1->type&TY_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
ICFCvt2(cc,tempi,REG_RAX,TY_REG+RT_I64,REG_RAX,0,FALSE,ip);
|
||||
ICPush(tempi,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
a1->type&MDG_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
ICFCvt2(cc,tempi,REG_RAX,MDF_REG+RT_I64,REG_RAX,0,FALSE,ip);
|
||||
ICPush(tempi,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
} else {
|
||||
if (a1->type_pointed_to>=RT_I64 && (a1->type&TY_MASK==TY_DISP ||
|
||||
a1->type&TY_MASK==TY_RIP_DISP32 || a1->type&TY_MASK==TY_SIB)) {
|
||||
t1=a1->type_pointed_to+a1->type&TY_MASK;
|
||||
if (a1->type_pointed_to>=RT_I64 && a1->type&MDG_DISP_SIB_RIP) {
|
||||
t1=a1->type&MDG_MASK+a1->type_pointed_to;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
p1_mem=TRUE;
|
||||
} else {
|
||||
ICPush(tempi,
|
||||
a1->type_pointed_to+a1->type&TY_MASK,a1->reg,a1->disp,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
a1->type&MDG_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
} else if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
if (a1->type_pointed_to!=RT_F64 || a2->type&TY_MASK==TY_STK) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
a1->type&TY_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
if (a1->type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RDX,TY_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
a2->type,a2->reg,a2->disp,ip);
|
||||
|
||||
ICU16(tempi,0x5052); //PUSH EDX PUSH EAX
|
||||
rsp_size=16;
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
} else {
|
||||
if (a1->type_pointed_to>=RT_I64 && (a1->type&TY_MASK==TY_DISP ||
|
||||
a1->type&TY_MASK==TY_RIP_DISP32 || a1->type&TY_MASK==TY_SIB)) {
|
||||
t1=a1->type_pointed_to+a1->type&TY_MASK;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
p1_mem=TRUE;
|
||||
} else {
|
||||
ICPush(tempi,
|
||||
a1->type_pointed_to+a1->type&TY_MASK,a1->reg,a1->disp,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64)))) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
if (r1==REG_RSP+REG_RSP<<8)
|
||||
d1+=8;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (a1->type_pointed_to!=RT_F64 || a1->type&TY_MASK==TY_STK) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
a1->type&TY_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
if (a1->type_pointed_to!=RT_F64 || a1->type&MDF_STK) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
a1->type&MDG_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
if (a1->type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RDX,TY_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICFCvt2(cc,tempi,REG_RDX,MDF_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICU16(tempi,0x5052); //PUSH EDX PUSH EAX
|
||||
rsp_size=16;
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
} else {
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
if (a2->type.raw_type>=RT_I64 && a2->type&MDG_DISP_SIB_RIP) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (a2->type&MDF_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64)))) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
t2=MDF_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
if (a1->type_pointed_to>=RT_I64 && (a1->type&TY_MASK==TY_DISP ||
|
||||
a1->type&TY_MASK==TY_RIP_DISP32 || a1->type&TY_MASK==TY_SIB)) {
|
||||
t1=a1->type_pointed_to+a1->type&TY_MASK;
|
||||
if (a1->type_pointed_to>=RT_I64 && a1->type&MDG_DISP_SIB_RIP) {
|
||||
t1=a1->type&MDG_MASK+a1->type_pointed_to;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
p1_mem=TRUE;
|
||||
} else {
|
||||
ICPush(tempi,
|
||||
a1->type_pointed_to+a1->type&TY_MASK,a1->reg,a1->disp,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
a1->type&MDG_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
if (r2==REG_RSP+REG_RSP<<8)
|
||||
d2+=8;
|
||||
@@ -152,112 +102,72 @@ U0 ICFOpEqu(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,U8 *buf2,I64 ip)
|
||||
ICAddRSP(tempi,rsp_size);
|
||||
} else {
|
||||
if (rsp_size==8)
|
||||
ICSlashOp(tempi,TY_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,
|
||||
SLASH_OP_FSTP,ip);
|
||||
ICSlashOp(tempi,MDF_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,SLASH_OP_FSTP,ip);
|
||||
else if (rsp_size>8) {
|
||||
ICSlashOp(tempi,TY_SIB+RT_I64,REG_RSP+REG_RSP<<8,rsp_size-8,
|
||||
ICSlashOp(tempi,MDF_SIB+RT_I64,REG_RSP+REG_RSP<<8,rsp_size-8,
|
||||
SLASH_OP_FSTP,ip);
|
||||
ICAddRSP(tempi,rsp_size-8);
|
||||
}
|
||||
if (a1->type_pointed_to!=RT_F64) {
|
||||
ICPop(tempi,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICFCvt2(cc,tempi,REG_RAX,TY_REG+RT_I64,REG_RAX,0,TRUE,ip);
|
||||
ICMov(tempi,a1->type&TY_MASK+a1->type_pointed_to,a1->reg,a1->disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICPop(tempi,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICFCvt2(cc,tempi,REG_RAX,MDF_REG+RT_I64,REG_RAX,0,TRUE,ip);
|
||||
ICMov(tempi,a1->type&MDG_MASK+a1->type_pointed_to,a1->reg,a1->disp,
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else
|
||||
ICPop(tempi,a1->type_pointed_to+a1->type&TY_MASK,a1->reg,a1->disp,ip);
|
||||
ICPop(tempi,a1->type&MDG_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
}
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
a1->type&TY_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
a1->type&MDG_MASK+a1->type_pointed_to,a1->reg,a1->disp,ip);
|
||||
} else {
|
||||
if (a1->type_pointed_to>=RT_I64)
|
||||
p1_mem=TRUE;
|
||||
else
|
||||
p1_mem=FALSE;
|
||||
if (dont_push_float) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
if (a1->type_pointed_to!=RT_F64) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
TY_DISP+a1->type_pointed_to,REG_RCX,0,ip);
|
||||
ICFCvt2(cc,tempi,REG_RAX,TY_REG+RT_I64,REG_RAX,0,FALSE,ip);
|
||||
ICPush(tempi,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
MDF_DISP+a1->type_pointed_to,REG_RCX,0,ip);
|
||||
ICFCvt2(cc,tempi,REG_RAX,MDF_REG+RT_I64,REG_RAX,0,FALSE,ip);
|
||||
ICPush(tempi,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else
|
||||
ICPush(tempi,a1->type_pointed_to+TY_DISP,REG_RCX,0,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
ICPush(tempi,MDF_DISP+a1->type_pointed_to,REG_RCX,0,ip);
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
} else if (tempi->ic_flags & ICF_A1_FIRST) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
if (a1->type_pointed_to!=RT_F64 || a2->type&TY_MASK==TY_STK) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
TY_DISP+a1->type_pointed_to,REG_RCX,0,ip);
|
||||
if (a1->type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RDX,TY_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
|
||||
ICU16(tempi,0x5052); //PUSH EDX PUSH EAX
|
||||
rsp_size=16;
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
} else {
|
||||
ICPush(tempi,TY_DISP+a1->type_pointed_to,REG_RCX,0,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64)))) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
if (r1==REG_RSP+REG_RSP<<8)
|
||||
d1+=8;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (a1->type_pointed_to!=RT_F64 || a1->type&TY_MASK==TY_STK) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,
|
||||
TY_DISP+a1->type_pointed_to,REG_RCX,0,ip);
|
||||
if (a1->type_pointed_to!=RT_F64 || a1->type&MDF_STK) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,
|
||||
MDF_DISP+a1->type_pointed_to,REG_RCX,0,ip);
|
||||
if (a1->type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RDX,TY_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICFCvt2(cc,tempi,REG_RDX,MDF_REG+RT_I64,REG_RDX,0,FALSE,ip);
|
||||
ICU16(tempi,0x5052); //PUSH EDX PUSH EAX
|
||||
rsp_size=16;
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
} else {
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
if (a2->type.raw_type>=RT_I64 && a2->type&MDG_DISP_SIB_RIP) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (a2->type&MDF_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64)))) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
t2=MDF_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICPush(tempi,TY_DISP+a1->type_pointed_to,REG_RCX,0,ip);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,a1->type,a1->reg,a1->disp,ip);
|
||||
ICPush(tempi,MDF_DISP+a1->type_pointed_to,REG_RCX,0,ip);
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
if (r2==REG_RSP+REG_RSP<<8)
|
||||
d2+=8;
|
||||
@@ -281,28 +191,26 @@ U0 ICFOpEqu(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,U8 *buf2,I64 ip)
|
||||
ICSlashOp(tempi,t1,r1,d1,op,ip);
|
||||
CmpNoteFloatOp(cc,tempi,TRUE,FALSE,CN_MAIN);
|
||||
if (p1_mem && a1->type_pointed_to==RT_F64) {
|
||||
ICSlashOp(tempi,TY_DISP+a1->type_pointed_to,REG_RCX,0,
|
||||
SLASH_OP_FSTP,ip);
|
||||
ICSlashOp(tempi,MDF_DISP+a1->type_pointed_to,REG_RCX,0,SLASH_OP_FSTP,ip);
|
||||
if (rsp_size)
|
||||
ICAddRSP(tempi,rsp_size);
|
||||
} else {
|
||||
if (rsp_size==8)
|
||||
ICSlashOp(tempi,TY_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,
|
||||
SLASH_OP_FSTP,ip);
|
||||
ICSlashOp(tempi,MDF_SIB+RT_I64,REG_RSP+REG_RSP<<8,0,SLASH_OP_FSTP,ip);
|
||||
else if (rsp_size>8) {
|
||||
ICSlashOp(tempi,TY_SIB+RT_I64,REG_RSP+REG_RSP<<8,rsp_size-8,
|
||||
ICSlashOp(tempi,MDF_SIB+RT_I64,REG_RSP+REG_RSP<<8,rsp_size-8,
|
||||
SLASH_OP_FSTP,ip);
|
||||
ICAddRSP(tempi,rsp_size-8);
|
||||
}
|
||||
ICPop(tempi,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICPop(tempi,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
if (a1->type_pointed_to!=RT_F64)
|
||||
ICFCvt2(cc,tempi,REG_RAX,TY_REG+RT_I64,REG_RAX,0,TRUE,ip);
|
||||
ICMov(tempi,TY_DISP+a1->type_pointed_to,REG_RCX,0,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICFCvt2(cc,tempi,REG_RAX,MDF_REG+RT_I64,REG_RAX,0,TRUE,ip);
|
||||
ICMov(tempi,MDF_DISP+a1->type_pointed_to,REG_RCX,0,
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -315,7 +223,7 @@ U0 ICFCmpAndBranch(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip,
|
||||
CCodeMisc *lb;
|
||||
U8 *buf2;
|
||||
|
||||
if (tempi->ic_flags&ICF_ALTERNATE_TEMPLATE) {
|
||||
if (tempi->ic_flags&ICF_ALT_TEMPLATE) {
|
||||
a1=&tempi->a2;
|
||||
a2=&tempi->a1;
|
||||
alt=TRUE;
|
||||
@@ -333,71 +241,68 @@ U0 ICFCmpAndBranch(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip,
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (dont_push_float) {
|
||||
if (tempi->ic_flags&ICF_POP_CMP && alt) {
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
} else {
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
if (a2->type.raw_type>=RT_I64 && a2->type&MDG_DISP_SIB_RIP) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (a2->type&MDF_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64))) ||
|
||||
tempi->ic_flags&ICF_PUSH_CMP) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
t2=MDF_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip2);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (tempi->ic_flags & ICF_A1_FIRST^^alt) {
|
||||
if (a2->type&TY_MASK!=TY_STK) {
|
||||
if (alt) {
|
||||
if (!(a2->type&MDF_STK)) {
|
||||
if (tempi->ic_flags&ICF_POP_CMP) {
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
} else {
|
||||
if (a1->type&RT_MASK>=RT_I64 && (a1->type&TY_MASK==TY_DISP ||
|
||||
a1->type&TY_MASK==TY_RIP_DISP32 || a1->type&TY_MASK==TY_SIB)) {
|
||||
if (a1->type.raw_type>=RT_I64 && a1->type&MDG_DISP_SIB_RIP) {
|
||||
t1=a1->type;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
} else {
|
||||
if (a1->type&TY_MASK==TY_IMM) {
|
||||
if (a1->type&MDF_IMM) {
|
||||
if (!(builtin1=ICBuiltInFloatConst(a1->disp(F64)))) {
|
||||
t1=TY_RIP_DISP32+RT_I64;
|
||||
t1=MDF_RIP_DISP32+RT_I64;
|
||||
r1=REG_RIP;
|
||||
d1=COCFloatConstFind(cc,a1->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a1->type,a1->reg,a1->disp,ip2);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
if (a2->type.raw_type>=RT_I64 && a2->type&MDG_DISP_SIB_RIP) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (a2->type&MDF_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64))) ||
|
||||
tempi->ic_flags&ICF_PUSH_CMP) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
t2=MDF_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip2);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
if (r1==REG_RSP+REG_RSP<<8)
|
||||
d1+=8;
|
||||
@@ -407,55 +312,53 @@ U0 ICFCmpAndBranch(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip,
|
||||
if (tempi->ic_flags&ICF_POP_CMP)
|
||||
ICPopRegs(tempi,1<<REG_RDX);
|
||||
else
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
ICU16(tempi,0x5052); //PUSH EDX PUSH EAX
|
||||
rsp_size=16;
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
}
|
||||
} else {
|
||||
if (a1->type&TY_MASK!=TY_STK) {
|
||||
if (a2->type&RT_MASK>=RT_I64 && (a2->type&TY_MASK==TY_DISP ||
|
||||
a2->type&TY_MASK==TY_RIP_DISP32 || a2->type&TY_MASK==TY_SIB)) {
|
||||
if (!(a1->type&MDF_STK)) {
|
||||
if (a2->type.raw_type>=RT_I64 && a2->type&MDG_DISP_SIB_RIP) {
|
||||
t2=a2->type;
|
||||
r2=a2->reg;
|
||||
d2=a2->disp;
|
||||
} else {
|
||||
if (a2->type&TY_MASK==TY_IMM) {
|
||||
if (a2->type&MDF_IMM) {
|
||||
if (!(builtin2=ICBuiltInFloatConst(a2->disp(F64))) ||
|
||||
tempi->ic_flags&ICF_PUSH_CMP) {
|
||||
t2=TY_RIP_DISP32+RT_I64;
|
||||
t2=MDF_RIP_DISP32+RT_I64;
|
||||
r2=REG_RIP;
|
||||
d2=COCFloatConstFind(cc,a2->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a2->type,a2->reg,a2->disp,ip2);
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
rsp_size+=8;
|
||||
}
|
||||
}
|
||||
if (tempi->ic_flags&ICF_POP_CMP) {
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
if (r2==REG_RSP+REG_RSP<<8)
|
||||
d1+=8;
|
||||
} else {
|
||||
if (a1->type&RT_MASK>=RT_I64 && (a1->type&TY_MASK==TY_DISP ||
|
||||
a1->type&TY_MASK==TY_RIP_DISP32 || a1->type&TY_MASK==TY_SIB)) {
|
||||
if (a1->type.raw_type>=RT_I64 && a1->type&MDG_DISP_SIB_RIP) {
|
||||
t1=a1->type;
|
||||
r1=a1->reg;
|
||||
d1=a1->disp;
|
||||
} else {
|
||||
if (a1->type&TY_MASK==TY_IMM) {
|
||||
if (a1->type&MDF_IMM) {
|
||||
if (!(builtin1=ICBuiltInFloatConst(a1->disp(F64)))) {
|
||||
t1=TY_RIP_DISP32+RT_I64;
|
||||
t1=MDF_RIP_DISP32+RT_I64;
|
||||
r1=REG_RIP;
|
||||
d1=COCFloatConstFind(cc,a1->disp(F64))+buf2;
|
||||
}
|
||||
} else {
|
||||
ICPush(tempi,a1->type,a1->reg,a1->disp,ip2);
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=0;
|
||||
rsp_size+=8;
|
||||
if (r2==REG_RSP+REG_RSP<<8)
|
||||
d2+=8;
|
||||
@@ -463,15 +366,15 @@ U0 ICFCmpAndBranch(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip,
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,a2->type,a2->reg,a2->disp,ip2);
|
||||
if (tempi->ic_flags&ICF_POP_CMP)
|
||||
ICPopRegs(tempi,1<<REG_RDX);
|
||||
else
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,a1->type,a1->reg,a1->disp,ip2);
|
||||
ICU16(tempi,0x5052); //PUSH EDX PUSH EAX
|
||||
rsp_size=16;
|
||||
t1=TY_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t1=MDF_SIB+RT_I64; r1=REG_RSP+REG_RSP<<8; d1=8;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -488,7 +391,7 @@ U0 ICFCmpAndBranch(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip,
|
||||
else
|
||||
ICSlashOp(tempi,t2,r2,d2,SLASH_OP_FLD,ip2);
|
||||
if (tempi->ic_flags&ICF_PUSH_CMP) {
|
||||
t2=TY_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
t2=MDF_SIB+RT_I64; r2=REG_RSP+REG_RSP<<8; d2=0;
|
||||
if (!rsp_size) {
|
||||
rsp_size=8;
|
||||
ICAddRSP(tempi,-8);
|
||||
@@ -571,15 +474,13 @@ U0 ICFCmpAndBranch(CCmpCtrl *cc,CIntermediateCode *tempi,I64 ip,
|
||||
|
||||
U0 ICFMul(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
{
|
||||
if (tempi->a1.type&TY_MASK==TY_IMM &&
|
||||
tempi->a1.type_pointed_to&RT_MASK==RT_F64 &&
|
||||
if (tempi->a1.type&MDF_IMM && tempi->a1.type_pointed_to==RT_F64 &&
|
||||
tempi->a1.disp(F64)==1.0) {
|
||||
CmpNoteFloatOp(cc,tempi,FALSE,FALSE,CN_MAIN);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
} else if (tempi->a2.type&TY_MASK==TY_IMM &&
|
||||
tempi->a2.type_pointed_to&RT_MASK==RT_F64 &&
|
||||
tempi->a2.disp(F64)==1.0) {
|
||||
} else if (tempi->a2.type&MDF_IMM &&
|
||||
tempi->a2.type_pointed_to==RT_F64&& tempi->a2.disp(F64)==1.0) {
|
||||
CmpNoteFloatOp(cc,tempi,FALSE,FALSE,CN_MAIN);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
@@ -589,8 +490,7 @@ U0 ICFMul(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
|
||||
U0 ICFDiv(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
{
|
||||
if (tempi->a2.type&TY_MASK==TY_IMM &&
|
||||
tempi->a2.type_pointed_to&RT_MASK==RT_F64 &&
|
||||
if (tempi->a2.type&MDF_IMM && tempi->a2.type_pointed_to==RT_F64 &&
|
||||
tempi->a2.disp(F64)==1.0) {
|
||||
CmpNoteFloatOp(cc,tempi,FALSE,FALSE,CN_MAIN);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
@@ -603,13 +503,13 @@ U0 ICFAdd(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
{
|
||||
Bool dont_push_float,dont_pop_float;
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (tempi->a1.type&TY_MASK==TY_IMM && !tempi->a1.disp) {
|
||||
if (tempi->a1.type&MDF_IMM && !tempi->a1.disp) {
|
||||
if (dont_push_float) {
|
||||
ICCopyTemplate(cc,tempi,CMP_TEMPLATE_FSTP,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else if (dont_pop_float) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
ICCopyTemplate(cc,tempi,CMP_TEMPLATE_FLD,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
} else {
|
||||
@@ -617,13 +517,13 @@ U0 ICFAdd(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
tempi->a2.type,tempi->a2.reg,tempi->a2.disp,ip);
|
||||
}
|
||||
} else if (tempi->a2.type&TY_MASK==TY_IMM && !tempi->a2.disp) {
|
||||
} else if (tempi->a2.type&MDF_IMM && !tempi->a2.disp) {
|
||||
if (dont_push_float) {
|
||||
ICCopyTemplate(cc,tempi,CMP_TEMPLATE_FSTP,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else if (dont_pop_float) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICCopyTemplate(cc,tempi,CMP_TEMPLATE_FLD,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
} else {
|
||||
@@ -638,14 +538,14 @@ U0 ICFAdd(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
U0 ICFSub(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
{
|
||||
Bool dont_push_float,dont_pop_float;
|
||||
if (tempi->a2.type&TY_MASK==TY_IMM && !tempi->a2.disp) {
|
||||
if (tempi->a2.type&MDF_IMM && !tempi->a2.disp) {
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (dont_push_float) {
|
||||
ICCopyTemplate(cc,tempi,CMP_TEMPLATE_FSTP,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else if (dont_pop_float) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICCopyTemplate(cc,tempi,CMP_TEMPLATE_FLD,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
} else {
|
||||
@@ -659,46 +559,46 @@ U0 ICFSub(CCmpCtrl *cc,CIntermediateCode *tempi,U8 *buf,I64 ip)
|
||||
|
||||
U0 ICFPreIncDec(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
{
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&TY_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&MDG_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICCopyTemplate(cc,tempi,op,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
ICMov(tempi,tempi->a1.type,tempi->a1.reg,tempi->a1.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,TY_DISP+RT_I64,REG_RCX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,MDF_DISP+RT_I64,REG_RCX,0,ip);
|
||||
ICCopyTemplate(cc,tempi,op,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
ICMov(tempi,TY_DISP+RT_I64,REG_RCX,0,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,REG_RCX,0,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICFPostIncDec(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
{
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR) {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&TY_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
if (tempi->ic_flags & ICF_BY_VAL) {
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type&MDG_MASK+RT_I64,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICCopyTemplate(cc,tempi,op,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
ICMov(tempi,tempi->a1.type,tempi->a1.reg,tempi->a1.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,TY_DISP+RT_I64,REG_RCX,0,ip);
|
||||
if (tempi->r.type&TY_MASK)
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RDX,0,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,MDF_DISP+RT_I64,REG_RCX,0,ip);
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RDX,0,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICCopyTemplate(cc,tempi,op,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
ICMov(tempi,TY_DISP+RT_I64,REG_RCX,0,TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
ICMov(tempi,MDF_DISP+RT_I64,REG_RCX,0,MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
if (tempi->r.type&TY_MASK)
|
||||
if (tempi->r.type.mode)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RDX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RDX,0,ip);
|
||||
}
|
||||
|
||||
U0 ICFTemplateFun(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
@@ -707,12 +607,12 @@ U0 ICFTemplateFun(CCmpCtrl *cc,CIntermediateCode *tempi,I64 op,I64 ip)
|
||||
|
||||
CmpSetFloatOpPushPop(cc,tempi,&dont_push_float,&dont_pop_float);
|
||||
if (!dont_push_float)
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RAX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RAX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
|
||||
ICCopyTemplate(cc,tempi,op,FALSE,TRUE,TRUE,CN_MAIN);
|
||||
if (tempi->r.type&TY_MASK && !(tempi->ic_flags & ICF_R_TO_F64) &&
|
||||
if (tempi->r.type.mode && !(tempi->ic_flags & ICF_R_TO_F64) &&
|
||||
!(tempi->ic_flags & ICF_R_TO_INT))
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_REG+RT_I64,REG_RAX,0,ip);
|
||||
MDF_REG+RT_I64,REG_RAX,0,ip);
|
||||
}
|
||||
+111
-113
@@ -72,8 +72,7 @@ U0 ICAddRSP(CIntermediateCode *tempi,I64 i,Bool optimize=TRUE)
|
||||
CIntermediateCode *tempil1;
|
||||
if (optimize && (tempil1=ICLastIns(tempi))) {
|
||||
j=tempil1->ic_cnt;
|
||||
if (tempil1->ic_last_cnt==j-4 &&
|
||||
tempil1->ic_body[j-3]==0x83 &&
|
||||
if (tempil1->ic_last_cnt==j-4 && tempil1->ic_body[j-3]==0x83 &&
|
||||
tempil1->ic_body[j-4]==0x48) {
|
||||
if (tempil1->ic_body[j-2]==0xEC)
|
||||
j=-tempil1->ic_body[j-1](I8);
|
||||
@@ -81,8 +80,7 @@ U0 ICAddRSP(CIntermediateCode *tempi,I64 i,Bool optimize=TRUE)
|
||||
j=tempil1->ic_body[j-1](I8);
|
||||
else
|
||||
j=0;
|
||||
} else if (tempil1->ic_last_cnt==j-7 &&
|
||||
tempil1->ic_body[j-6]==0x81 &&
|
||||
} else if (tempil1->ic_last_cnt==j-7 && tempil1->ic_body[j-6]==0x81 &&
|
||||
tempil1->ic_body[j-7]==0x48) {
|
||||
if (tempil1->ic_body[j-5]==0xEC)
|
||||
j=-tempil1->ic_body[j-4](I32);
|
||||
@@ -127,28 +125,24 @@ U0 ICAddRSP(CIntermediateCode *tempi,I64 i,Bool optimize=TRUE)
|
||||
}
|
||||
|
||||
extern U0 ICMov(CIntermediateCode *tempi,
|
||||
I64 t1,I64 r1,I64 d1,I64 t2,I64 r2,I64 d2,I64 ip);
|
||||
CICType t1,I64 r1,I64 d1,CICType t2,I64 r2,I64 d2,I64 ip);
|
||||
|
||||
#define MDR_REG 0
|
||||
#define MDR_INDIRECT_REG 1
|
||||
#define MDR_D8_INDIRECT_REG 2
|
||||
#define MDR_D32_INDIRECT_REG 3
|
||||
#define MDR_SIB_INDIRECT_REG 4
|
||||
#define MDR_SIB_D8_INDIRECT_REG 5
|
||||
#define MDR_SIB_D32_INDIRECT_REG 6
|
||||
#define MDR_RIP_REL 7
|
||||
#define MODR_REG 0
|
||||
#define MODR_INDIRECT_REG 1
|
||||
#define MODR_D8_INDIRECT_REG 2
|
||||
#define MODR_D32_INDIRECT_REG 3
|
||||
#define MODR_SIB_INDIRECT_REG 4
|
||||
#define MODR_SIB_D8_INDIRECT_REG 5
|
||||
#define MODR_SIB_D32_INDIRECT_REG 6
|
||||
#define MODR_RIP_REL 7
|
||||
|
||||
I64 ICModr1(I64 r,I64 t2,I64 r2,I64 d2)
|
||||
I64 ICModr1(I64 r,CICType t2,I64 r2,I64 d2)
|
||||
{//result.u8[0] is type
|
||||
//result.u8[1] is REX
|
||||
//result.u8[2] is ModR
|
||||
//result.u8[3] is SIB
|
||||
I64 result=0;
|
||||
if (t2&TY_MASK>TY_RIP_DISP32) {
|
||||
"Callers:%P;%P\n",Caller,Caller(2);
|
||||
throw('Compiler');
|
||||
}
|
||||
if (t2&RT_MASK<RT_I64)
|
||||
if (t2.raw_type<RT_I64)
|
||||
result.u8[1]=0x40;
|
||||
else
|
||||
result.u8[1]=0x48;
|
||||
@@ -156,36 +150,36 @@ I64 ICModr1(I64 r,I64 t2,I64 r2,I64 d2)
|
||||
result.u8[1]+=4;
|
||||
r&=7;
|
||||
}
|
||||
switch (t2>>4) {
|
||||
case TY_REG>>4:
|
||||
switch (Bsr(t2)) {
|
||||
case MDf_REG:
|
||||
if (r2>7) {
|
||||
result.u8[1]++;
|
||||
r2&=7;
|
||||
}
|
||||
result.u8[2]=0xC0+r<<3+r2;
|
||||
result.u8[0]=MDR_REG;
|
||||
if (result.u8[1]==0x40 && (t2&RT_MASK>=RT_I16 || r<4 && r2<4))
|
||||
result.u8[0]=MODR_REG;
|
||||
if (result.u8[1]==0x40 && (t2.raw_type>=RT_I16 || r<4 && r2<4))
|
||||
result.u8[1]=0;
|
||||
break;
|
||||
case TY_DISP>>4:
|
||||
case MDf_DISP:
|
||||
if (r2>7) {
|
||||
result.u8[1]++;
|
||||
r2&=7;
|
||||
}
|
||||
if (!d2 && r2!=REG_RBP) {
|
||||
result.u8[2]=r<<3+r2;
|
||||
result.u8[0]=MDR_INDIRECT_REG;
|
||||
result.u8[0]=MODR_INDIRECT_REG;
|
||||
} else if (MIN_I8<=d2<=MAX_I8) {
|
||||
result.u8[2]=0x40+r<<3+r2;
|
||||
result.u8[0]=MDR_D8_INDIRECT_REG;
|
||||
result.u8[0]=MODR_D8_INDIRECT_REG;
|
||||
} else {
|
||||
result.u8[2]=0x80+r<<3+r2;
|
||||
result.u8[0]=MDR_D32_INDIRECT_REG;
|
||||
result.u8[0]=MODR_D32_INDIRECT_REG;
|
||||
}
|
||||
if (result.u8[1]==0x40 && (t2&RT_MASK>=RT_I16 || r<4))
|
||||
if (result.u8[1]==0x40 && (t2.raw_type>=RT_I16 || r<4))
|
||||
result.u8[1]=0;
|
||||
break;
|
||||
case TY_SIB>>4:
|
||||
case MDf_SIB:
|
||||
if (7<r2.u8[0]<REG_NONE)
|
||||
result.u8[1]++;
|
||||
if (r2.u8[1]&15>7)
|
||||
@@ -193,27 +187,27 @@ I64 ICModr1(I64 r,I64 t2,I64 r2,I64 d2)
|
||||
if (r2.u8[0]==REG_NONE) {
|
||||
result.u8[3]=5+(r2.u8[1]&7)<<3+r2.u8[1]&0xC0;
|
||||
result.u8[2]=4+r<<3;
|
||||
result.u8[0]=MDR_SIB_D32_INDIRECT_REG;
|
||||
result.u8[0]=MODR_SIB_D32_INDIRECT_REG;
|
||||
} else {
|
||||
result.u8[3]=r2.u8[0]&7+(r2.u8[1]&7)<<3+r2.u8[1]&0xC0;
|
||||
if (!d2 && r2.u8[0]&7!=REG_RBP) {
|
||||
result.u8[2]=4+r<<3;
|
||||
result.u8[0]=MDR_SIB_INDIRECT_REG;
|
||||
result.u8[0]=MODR_SIB_INDIRECT_REG;
|
||||
} else if (MIN_I8<=d2<=MAX_I8) {
|
||||
result.u8[2]=0x44+r<<3;
|
||||
result.u8[0]=MDR_SIB_D8_INDIRECT_REG;
|
||||
result.u8[0]=MODR_SIB_D8_INDIRECT_REG;
|
||||
} else {
|
||||
result.u8[2]=0x84+r<<3;
|
||||
result.u8[0]=MDR_SIB_D32_INDIRECT_REG;
|
||||
result.u8[0]=MODR_SIB_D32_INDIRECT_REG;
|
||||
}
|
||||
}
|
||||
if (result.u8[1]==0x40 && (t2&RT_MASK>=RT_I16 || r<4))
|
||||
if (result.u8[1]==0x40 && (t2.raw_type>=RT_I16 || r<4))
|
||||
result.u8[1]=0;
|
||||
break;
|
||||
case TY_RIP_DISP32>>4:
|
||||
case MDf_RIP_DISP32:
|
||||
result.u8[2]=0x05+r<<3;
|
||||
result.u8[0]=MDR_RIP_REL;
|
||||
if (result.u8[1]==0x40 && (t2&RT_MASK>=RT_I16 || r<4))
|
||||
result.u8[0]=MODR_RIP_REL;
|
||||
if (result.u8[1]==0x40 && (t2.raw_type>=RT_I16 || r<4))
|
||||
result.u8[1]=0;
|
||||
break;
|
||||
}
|
||||
@@ -223,28 +217,28 @@ I64 ICModr1(I64 r,I64 t2,I64 r2,I64 d2)
|
||||
U0 ICModr2(CIntermediateCode *tempi,I64 i,I64 d,I64 ip=0)
|
||||
{//t=0 means no SIB
|
||||
switch [i.u8[0]] {
|
||||
case MDR_REG:
|
||||
case MODR_REG:
|
||||
break;
|
||||
case MDR_INDIRECT_REG:
|
||||
case MODR_INDIRECT_REG:
|
||||
break;
|
||||
case MDR_D8_INDIRECT_REG:
|
||||
case MODR_D8_INDIRECT_REG:
|
||||
ICU8(tempi,d);
|
||||
break;
|
||||
case MDR_D32_INDIRECT_REG:
|
||||
case MODR_D32_INDIRECT_REG:
|
||||
ICU32(tempi,d);
|
||||
break;
|
||||
case MDR_SIB_INDIRECT_REG:
|
||||
case MODR_SIB_INDIRECT_REG:
|
||||
ICU8(tempi,i.u8[3]);
|
||||
break;
|
||||
case MDR_SIB_D8_INDIRECT_REG:
|
||||
case MODR_SIB_D8_INDIRECT_REG:
|
||||
ICU8(tempi,i.u8[3]);
|
||||
ICU8(tempi,d);
|
||||
break;
|
||||
case MDR_SIB_D32_INDIRECT_REG:
|
||||
case MODR_SIB_D32_INDIRECT_REG:
|
||||
ICU8(tempi,i.u8[3]);
|
||||
ICU32(tempi,d);
|
||||
break;
|
||||
case MDR_RIP_REL:
|
||||
case MODR_RIP_REL:
|
||||
ICU32(tempi,d-(ip+tempi->ic_cnt));
|
||||
tempi->ic_flags&=~ICF_CODE_FINAL;
|
||||
break;
|
||||
@@ -272,16 +266,16 @@ U0 ICModr2(CIntermediateCode *tempi,I64 i,I64 d,I64 ip=0)
|
||||
#define SLASH_OP_FISTTP 0x0000000001DDDD01
|
||||
#define SLASH_OP_FILD 0x0000000001DFDF05
|
||||
|
||||
U0 ICSlashOp(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,I64 op,I64 ip)
|
||||
U0 ICSlashOp(CIntermediateCode *tempi,CICType t1,I64 r1,I64 d1,I64 op,I64 ip)
|
||||
{
|
||||
I64 i;
|
||||
if (t1&TY_MASK==TY_REG && !op.u8[3])
|
||||
t1=t1&(TY_MASK|1)+RT_I64; //Set to 64 bit, preserving signed/unsigned
|
||||
if (t1&MDF_REG && !op.u8[3])
|
||||
t1=t1&(MDG_MASK|RTF_UNSIGNED)+RT_I64; //Set to 64 bit,preserving unsigned
|
||||
i=ICModr1(op.u8[0],t1,r1,d1);
|
||||
|
||||
if (tempi->ic_flags&ICF_LOCK && op!=SLASH_OP_MOV && t1&TY_MASK!=TY_REG)
|
||||
if (tempi->ic_flags&ICF_LOCK && op!=SLASH_OP_MOV && !(t1&MDF_REG))
|
||||
ICU8(tempi,OC_LOCK_PREFIX);
|
||||
switch (t1&RT_MASK) {
|
||||
switch (t1.raw_type) {
|
||||
case RT_I8:
|
||||
case RT_U8:
|
||||
ICRex(tempi,i.u8[1]);
|
||||
@@ -300,32 +294,32 @@ U0 ICSlashOp(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,I64 op,I64 ip)
|
||||
ICModr2(tempi,i,d1,ip+4);
|
||||
}
|
||||
|
||||
U0 ICPush(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,I64 ip)
|
||||
U0 ICPush(CIntermediateCode *tempi,CICType t1,I64 r1,I64 d1,I64 ip)
|
||||
{
|
||||
switch (t1>>4) {
|
||||
case TY_REG>>4:
|
||||
switch (Bsr(t1)) {
|
||||
case MDf_REG:
|
||||
if (r1>7)
|
||||
ICU16(tempi,0x5049+(r1&7)<<8);
|
||||
else
|
||||
ICU8(tempi,0x50+r1);
|
||||
return;
|
||||
case TY_IMM>>4:
|
||||
case MDf_IMM:
|
||||
if (MIN_I8<=d1<=MAX_I8)
|
||||
ICU16(tempi,0x6A+d1<<8);
|
||||
else if (MIN_I32<=d1<=MAX_I32) {
|
||||
ICU8(tempi,0x68);
|
||||
ICU32(tempi,d1);
|
||||
} else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,t1,r1,d1,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,t1,r1,d1,ip);
|
||||
ICU8(tempi,0x50+REG_RBX);
|
||||
}
|
||||
return;
|
||||
case TY_STK>>4:
|
||||
case MDf_STK:
|
||||
return;
|
||||
case TY_DISP>>4:
|
||||
case TY_SIB>>4:
|
||||
case TY_RIP_DISP32>>4:
|
||||
switch (t1&RT_MASK) {
|
||||
case MDf_DISP:
|
||||
case MDf_SIB:
|
||||
case MDf_RIP_DISP32:
|
||||
switch (t1.raw_type) {
|
||||
case RT_I64:
|
||||
case RT_U64:
|
||||
case RT_F64:
|
||||
@@ -334,7 +328,7 @@ U0 ICPush(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,I64 ip)
|
||||
}
|
||||
break;
|
||||
}
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,t1,r1,d1,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,t1,r1,d1,ip);
|
||||
ICU16(tempi,0x5048+REG_RBX<<8);
|
||||
}
|
||||
|
||||
@@ -351,30 +345,31 @@ U0 ICPushRegs(CIntermediateCode *tempi,I64 mask)
|
||||
}
|
||||
}
|
||||
|
||||
U0 ICPop(CIntermediateCode *tempi,I64 t1,I64 r1,I64 d1,I64 ip)
|
||||
U0 ICPop(CIntermediateCode *tempi,CICType t1,I64 r1,I64 d1,I64 ip)
|
||||
{
|
||||
switch (t1>>4) {
|
||||
case TY_NULL>>4:
|
||||
ICAddRSP(tempi,8);
|
||||
break;
|
||||
case TY_REG>>4:
|
||||
switch (Bsr(t1)) {
|
||||
case MDf_REG:
|
||||
if (r1>7)
|
||||
ICU16(tempi,0x5849+(r1&7)<<8);
|
||||
else
|
||||
ICU8(tempi,0x58+r1);
|
||||
break;
|
||||
case TY_DISP>>4:
|
||||
case TY_RIP_DISP32>>4:
|
||||
case TY_SIB>>4:
|
||||
if (t1&RT_MASK<RT_I64) {
|
||||
case MDf_DISP:
|
||||
case MDf_RIP_DISP32:
|
||||
case MDf_SIB:
|
||||
if (t1.raw_type<RT_I64) {
|
||||
ICU8(tempi,0x58+REG_RBX);
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,REG_RBX,0,ip);
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,REG_RBX,0,ip);
|
||||
} else
|
||||
ICSlashOp(tempi,t1,r1,d1,SLASH_OP_POP,ip);
|
||||
break;
|
||||
default:
|
||||
case MDf_STK:
|
||||
case MDf_IMM:
|
||||
ICU8(tempi,0x58+REG_RBX);
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,REG_RBX,0,ip);
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,REG_RBX,0,ip);
|
||||
break;
|
||||
default:
|
||||
ICAddRSP(tempi,8);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -433,14 +428,14 @@ I64 ICBuiltInFloatConst(F64 d)
|
||||
}
|
||||
|
||||
U0 ICMov(CIntermediateCode *tempi,
|
||||
I64 t1,I64 r1,I64 d1,I64 t2,I64 r2,I64 d2,I64 ip)
|
||||
CICType t1,I64 r1,I64 d1,CICType t2,I64 r2,I64 d2,I64 ip)
|
||||
{
|
||||
I64 i,j,last_cnt=tempi->ic_cnt;
|
||||
CIntermediateCode *tempil1;
|
||||
Bool old_lock=Btr(&tempi->ic_flags,ICf_LOCK);
|
||||
switch (t1>>4) {
|
||||
case TY_REG>>4:
|
||||
if (t2&TY_MASK==TY_IMM) {
|
||||
switch (Bsr(t1)) {
|
||||
case MDf_REG:
|
||||
if (t2&MDF_IMM) {
|
||||
if (!d2)
|
||||
ICZero(tempi,r1);
|
||||
else if (0<=d2<=MAX_U8) {
|
||||
@@ -492,13 +487,13 @@ U0 ICMov(CIntermediateCode *tempi,
|
||||
ICU16(tempi,i+r1<<8);
|
||||
ICU64(tempi,d2);
|
||||
}
|
||||
} else if (t2&TY_MASK==TY_STK)
|
||||
} else if (t2&MDF_STK)
|
||||
ICPop(tempi,t1,r1,d1,ip);
|
||||
else {
|
||||
if (r1==r2 && t2&TY_MASK==TY_REG)
|
||||
if (r1==r2 && t2&MDF_REG)
|
||||
goto move_done;
|
||||
if (t2&TY_MASK==TY_REG) {
|
||||
t2=TY_REG+RT_I64;
|
||||
if (t2&MDF_REG) {
|
||||
t2=MDF_REG+RT_I64;
|
||||
if (tempil1=ICLastIns(tempi)) {
|
||||
i=tempil1->ic_cnt;
|
||||
j=0x48+(r1>7);
|
||||
@@ -511,10 +506,10 @@ U0 ICMov(CIntermediateCode *tempi,
|
||||
}
|
||||
}
|
||||
i=ICModr1(r1,t2,r2,d2);
|
||||
if (t2&RT_MASK!=RT_U32)
|
||||
if (t2.raw_type!=RT_U32)
|
||||
i|=0x4800;
|
||||
ICRex(tempi,i.u8[1]);
|
||||
switch (t2&RT_MASK) {
|
||||
switch (t2.raw_type) {
|
||||
case RT_I8:
|
||||
ICU24(tempi,i.u8[2]<<16+0xBE0F);
|
||||
break;
|
||||
@@ -537,19 +532,22 @@ U0 ICMov(CIntermediateCode *tempi,
|
||||
ICModr2(tempi,i,d2,ip+4);
|
||||
}
|
||||
break;
|
||||
case TY_STK>>4:
|
||||
if (t1&RT_MASK<t2&RT_MASK)
|
||||
ICPush(tempi,t2&TY_MASK+t1&RT_MASK,r2,d2,ip);
|
||||
case MDf_STK:
|
||||
if (tempi->ic_flags&ICF_PUSH_CMP)
|
||||
ICPopRegs(tempi,1<<REG_RBX);
|
||||
if (t1.raw_type<t2.raw_type)
|
||||
ICPush(tempi,t2&MDG_MASK+t1.raw_type,r2,d2,ip);
|
||||
else
|
||||
ICPush(tempi,t2,r2,d2,ip);
|
||||
if (tempi->ic_flags&ICF_PUSH_CMP)
|
||||
ICPushRegs(tempi,1<<REG_RBX);
|
||||
break;
|
||||
case TY_DISP>>4:
|
||||
case TY_RIP_DISP32>>4:
|
||||
case TY_SIB>>4:
|
||||
if (t2&TY_MASK==TY_IMM && (t1&RT_MASK<RT_I64 ||
|
||||
(MIN_I32<=d2<=MAX_I32))) {
|
||||
case MDf_DISP:
|
||||
case MDf_RIP_DISP32:
|
||||
case MDf_SIB:
|
||||
if (t2&MDF_IMM && (t1.raw_type<RT_I64 || (MIN_I32<=d2<=MAX_I32))) {
|
||||
i=ICModr1(0,t1,r1,d1);
|
||||
switch (t1&RT_MASK) {
|
||||
switch (t1.raw_type) {
|
||||
case RT_I8:
|
||||
case RT_U8:
|
||||
ICRex(tempi,i.u8[1]);
|
||||
@@ -564,11 +562,11 @@ U0 ICMov(CIntermediateCode *tempi,
|
||||
ICRex(tempi,i.u8[1]);
|
||||
ICU16(tempi,i.u8[2]<<8+0xC7);
|
||||
}
|
||||
if (i.u8[0]!=MDR_RIP_REL)
|
||||
if (i.u8[0]!=MODR_RIP_REL)
|
||||
ICModr2(tempi,i,d1,);
|
||||
else {
|
||||
i=d1-(ip+tempi->ic_cnt+4);
|
||||
switch (t1&RT_MASK) {
|
||||
switch (t1.raw_type) {
|
||||
case RT_I8:
|
||||
case RT_U8:
|
||||
i--;
|
||||
@@ -584,7 +582,7 @@ U0 ICMov(CIntermediateCode *tempi,
|
||||
tempi->ic_flags&=~ICF_CODE_FINAL;
|
||||
}
|
||||
|
||||
switch (t1&RT_MASK) {
|
||||
switch (t1.raw_type) {
|
||||
case RT_I8:
|
||||
case RT_U8:
|
||||
ICU8(tempi,d2);
|
||||
@@ -597,11 +595,11 @@ U0 ICMov(CIntermediateCode *tempi,
|
||||
ICU32(tempi,d2);
|
||||
}
|
||||
} else {
|
||||
if (t2&TY_MASK==TY_REG)
|
||||
if (t2&MDF_REG)
|
||||
ICSlashOp(tempi,t1,r1,d1,r2+SLASH_OP_MOV,ip);
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RBX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,REG_RBX,0,ip);
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RBX,0,t2,r2,d2,ip);
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,REG_RBX,0,ip);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -612,20 +610,20 @@ move_done:
|
||||
tempi->ic_last_cnt=last_cnt;
|
||||
}
|
||||
|
||||
U0 ICLea(CIntermediateCode *tempi,
|
||||
I64 t1,I64 r1,I64 d1,I64 t2,I64 r2,I64 d2,CCmpCtrl *cc,U8 *buf,I64 ip)
|
||||
U0 ICLea(CIntermediateCode *tempi,CICType t1,I64 r1,I64 d1,
|
||||
CICType t2,I64 r2,I64 d2,CCmpCtrl *cc,U8 *buf,I64 ip)
|
||||
{
|
||||
I64 i;
|
||||
CAOTAbsAddr *tempa;
|
||||
switch (t1>>4) {
|
||||
case TY_REG>>4:
|
||||
switch (Bsr(t1)) {
|
||||
case MDf_REG:
|
||||
i=ICModr1(r1,t2,r2,d2);
|
||||
i.u8[1]|=0x48;
|
||||
ICU24(tempi,i.u8[2]<<16+0x8D00+i.u8[1]);
|
||||
ICModr2(tempi,i,d2,ip+4);
|
||||
break;
|
||||
case TY_STK>>4:
|
||||
if (t2&TY_MASK==TY_RIP_DISP32) {
|
||||
case MDf_STK:
|
||||
if (t2&MDF_RIP_DISP32) {
|
||||
ICU8(tempi,0x68);
|
||||
ICU32(tempi,d2);
|
||||
if (cc->flags&CCF_AOT_COMPILE && buf && !(cc->flags&CCF_NO_ABSS)) {
|
||||
@@ -639,24 +637,24 @@ U0 ICLea(CIntermediateCode *tempi,
|
||||
break;
|
||||
} // Fall thru
|
||||
default:
|
||||
ICLea(tempi,TY_REG+RT_I64,REG_RCX,0,t2,r2,d2,cc,buf,ip);
|
||||
ICMov(tempi,t1,r1,d1,TY_REG+RT_I64,REG_RCX,0,ip);
|
||||
ICLea(tempi,MDF_REG+RT_I64,REG_RCX,0,t2,r2,d2,cc,buf,ip);
|
||||
ICMov(tempi,t1,r1,d1,MDF_REG+RT_I64,REG_RCX,0,ip);
|
||||
}
|
||||
}
|
||||
|
||||
U0 ICDeref(CIntermediateCode *tempi,I64 ip)
|
||||
{
|
||||
I64 t;
|
||||
t=tempi->r.type&RT_MASK;
|
||||
CICType t;
|
||||
t=tempi->r.type.raw_type;
|
||||
if (t>tempi->a1.type_pointed_to)
|
||||
t=tempi->a1.type_pointed_to;
|
||||
if (tempi->a1.type&TY_MASK==TY_REG)
|
||||
if (tempi->a1.type&MDF_REG)
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_DISP+t,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
MDF_DISP+t,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
else {
|
||||
ICMov(tempi,TY_REG+RT_I64,REG_RCX,0,
|
||||
ICMov(tempi,MDF_REG+RT_I64,REG_RCX,0,
|
||||
tempi->a1.type,tempi->a1.reg,tempi->a1.disp,ip);
|
||||
ICMov(tempi,tempi->r.type,tempi->r.reg,tempi->r.disp,
|
||||
TY_DISP+t,REG_RCX,0,ip);
|
||||
MDF_DISP+t,REG_RCX,0,ip);
|
||||
}
|
||||
}
|
||||
+21
-23
@@ -3,7 +3,7 @@ U0 LexPutToken(CCmpCtrl *cc)
|
||||
'"';
|
||||
if (cc->token==TK_IDENT || cc->token==TK_STR)
|
||||
"%s",cc->cur_str;
|
||||
else if (cc->token==TK_INTEGER)
|
||||
else if (cc->token==TK_INT)
|
||||
"INT:%X",cc->cur_i64;
|
||||
else if (cc->token==TK_CHAR_CONST)
|
||||
"U8:%X",cc->cur_i64;
|
||||
@@ -141,31 +141,29 @@ U0 ICClassPut(CHashClass *c)
|
||||
U0 ICArgPut(CICArg *a)
|
||||
{
|
||||
if (a->type_pointed_to)
|
||||
"%Z %Z %Z ",
|
||||
a->type&RT_MASK,"ST_RAW_TYPES",
|
||||
a->type_pointed_to&RT_MASK,"ST_RAW_TYPES",
|
||||
a->type>>4,"ST_TY_TYPES";
|
||||
"%Z %Z %Z ",a->type.raw_type,"ST_RAW_TYPES",
|
||||
a->type_pointed_to,"ST_RAW_TYPES",
|
||||
Bsr(a->type>>8)+1,"ST_TY_TYPES";
|
||||
else
|
||||
"%Z %Z ",
|
||||
a->type&RT_MASK,"ST_RAW_TYPES",
|
||||
a->type>>4,"ST_TY_TYPES";
|
||||
switch (a->type>>4) {
|
||||
case TY_STK>>4:
|
||||
"%Z %Z ",a->type.raw_type,"ST_RAW_TYPES",
|
||||
Bsr(a->type>>8)+1,"ST_TY_TYPES";
|
||||
switch (Bsr(a->type)) {
|
||||
case MDf_STK:
|
||||
"STK";
|
||||
break;
|
||||
case TY_IMM>>4:
|
||||
case MDf_IMM:
|
||||
"#%X",a->disp;
|
||||
break;
|
||||
case TY_REG>>4:
|
||||
case MDf_REG:
|
||||
"%Z",a->reg,"ST_U64_REGS";
|
||||
break;
|
||||
case TY_DISP>>4:
|
||||
case MDf_DISP:
|
||||
"%X[%Z]",a->disp,a->reg,"ST_U64_REGS";
|
||||
break;
|
||||
case TY_RIP_DISP32>>4:
|
||||
case MDf_RIP_DISP32:
|
||||
"[%X]",a->disp;
|
||||
break;
|
||||
case TY_SIB>>4:
|
||||
case MDf_SIB:
|
||||
if (a->disp)
|
||||
"%X",a->disp;
|
||||
if (a->reg==REG_RIP)
|
||||
@@ -189,14 +187,14 @@ U0 ICPut(CCmpCtrl *cc,CIntermediateCode *tempi)
|
||||
if (opcode>=IC_END_EXP && opcode!=IC_NOP2) {
|
||||
"%15ts %016X ",intermediate_code_table[opcode].name,tempi->ic_data;
|
||||
if (cc->pass) {
|
||||
if (tempi->r.type&TY_MASK) {
|
||||
if (tempi->r.type.mode) {
|
||||
ICArgPut(&tempi->r);
|
||||
"<-";
|
||||
}
|
||||
if (tempi->a1.type&TY_MASK)
|
||||
if (tempi->a1.type.mode)
|
||||
ICArgPut(&tempi->a1);
|
||||
',';
|
||||
if (tempi->a2.type&TY_MASK)
|
||||
if (tempi->a2.type.mode)
|
||||
ICArgPut(&tempi->a2);
|
||||
'' CH_SPACE;
|
||||
}
|
||||
@@ -225,8 +223,8 @@ U0 ICPut(CCmpCtrl *cc,CIntermediateCode *tempi)
|
||||
"-DEP ";
|
||||
if (tempi->ic_flags & ICF_DEPEND_RESULT)
|
||||
"+DEP ";
|
||||
if (tempi->ic_flags & ICF_NOT_ADDR)
|
||||
"NOT_ADDR ";
|
||||
if (tempi->ic_flags & ICF_BY_VAL)
|
||||
"BY_VAL ";
|
||||
if (tempi->ic_flags & ICF_PUSH_RESULT)
|
||||
"PUSH ";
|
||||
if (tempi->ic_flags & ICF_PUSH_CMP)
|
||||
@@ -234,16 +232,16 @@ U0 ICPut(CCmpCtrl *cc,CIntermediateCode *tempi)
|
||||
if (tempi->ic_flags & ICF_POP_CMP)
|
||||
"POP_CMP ";
|
||||
if (tempi->ic_flags & ICF_DEL_PREVIOUS_INS)
|
||||
"DELPREV ";
|
||||
"DEL_PREV ";
|
||||
if (tempi->ic_flags & ICF_PREVIOUS_DELETED)
|
||||
"PREVDEL ";
|
||||
"PREV_DEL ";
|
||||
for (i=0;i<3;i++) {
|
||||
if (Bt(&tempi->ic_flags,ICf_DONT_PUSH_FLOAT0+i))
|
||||
"DONT_PUSH#%d ",i;
|
||||
if (Bt(&tempi->ic_flags,ICf_DONT_POP_FLOAT0+i))
|
||||
"DONT_POP#%d ",i;
|
||||
}
|
||||
if (tempi->ic_flags & ICF_ALTERNATE_TEMPLATE)
|
||||
if (tempi->ic_flags & ICF_ALT_TEMPLATE)
|
||||
"ALT_TEMP ";
|
||||
'\n';
|
||||
}
|
||||
|
||||
+4
-49
@@ -211,7 +211,7 @@ U0 CmpLoadDefines()
|
||||
"I8\0U8\0I16\0U16\0I32\0U32\0I64\0U64\0F64\0String\0");
|
||||
DefineLstLoad("ST_INT_SIZE_TYPES",
|
||||
"I8\0U8\0I16\0U16\0I32\0U32\0I64\0U64\0");
|
||||
DefineLstLoad("ST_TY_TYPES","NULL\0IMM\0REG\0DISP\0SIB\0RIP\0STK\0");
|
||||
DefineLstLoad("ST_TY_TYPES","NULL\0STK\0IMM\0REG\0DISP\0SIB\0RIP\0");
|
||||
DefineLstLoad("ST_U8_REGS","AL\0CL\0DL\0BL\0AH\0CH\0DH\0BH\0"
|
||||
"R8u8\0R9u8\0R10u8\0R11u8\0R12u8\0R13u8\0R14u8\0R15u8\0");
|
||||
DefineLstLoad("ST_U8_REX_REGS","AL\0CL\0DL\0BL\0RSPu8\0RBPu8\0RSIu8\0RDIu8\0"
|
||||
@@ -239,68 +239,23 @@ U0 CmpLoadDefines()
|
||||
|
||||
U0 CmpFillTables()
|
||||
{
|
||||
I64 i,k;
|
||||
I64 i;
|
||||
U32 *d;
|
||||
|
||||
cmp.to_reg_vars_map=CAlloc(NUM_REGS*sizeof(U8));
|
||||
cmp.num_reg_vars=0;
|
||||
cmp.reg_vars_mask=REGG_C_LOCAL_VARS;
|
||||
cmp.reg_vars_mask=REGG_LOCAL_VARS;
|
||||
for (i=0;i<NUM_REGS;i++)
|
||||
if (Bt(&cmp.reg_vars_mask,i))
|
||||
cmp.to_reg_vars_map[cmp.num_reg_vars++]=i;
|
||||
|
||||
cmp.non_ptr_vars_map=CAlloc(NUM_REGS*sizeof(U8));
|
||||
cmp.num_non_ptr_vars=0;
|
||||
cmp.non_ptr_vars_mask=REGG_C_LOCAL_NON_PTR_VARS;
|
||||
cmp.non_ptr_vars_mask=REGG_LOCAL_NON_PTR_VARS;
|
||||
for (i=0;i<NUM_REGS;i++)
|
||||
if (Bt(&cmp.non_ptr_vars_mask,i))
|
||||
cmp.non_ptr_vars_map[cmp.num_non_ptr_vars++]=i;
|
||||
|
||||
/* STK TEMP ALLOCATION: See $LK,"::/Compiler/OptPass6.CPP"$.
|
||||
|
||||
Expressions are evaluated with a stack machine.
|
||||
|
||||
1+(2+3)*4
|
||||
|
||||
STK[2]: 1 1 1 1 1 1 21
|
||||
STK[1]: 2 2 5 5 20
|
||||
STK[0]: 3 4
|
||||
|
||||
The top of the stack is stored in RAX.
|
||||
|
||||
STK[2]: RAX 1 1 1 1 1 RAX
|
||||
STK[1]: RAX 2 RAX 5 RAX
|
||||
STK[0]: RAX RAX
|
||||
|
||||
Two regs are alloced for stk temps.
|
||||
|
||||
STK[0]:
|
||||
R9 : RAX R9 R9 R9 R9 R9 RAX
|
||||
R8 : RAX R8 RAX R8 RAX
|
||||
: RAX RAX
|
||||
|
||||
Every other funtion, the regs are reversed. This is to reduce
|
||||
pushes before function calls. R8 is used in even numbered functions
|
||||
while R9 is used in odd, so maybe we can avoid pushes if only one
|
||||
stk temp reg is used.
|
||||
|
||||
STK[0]:
|
||||
R9 : RAX R8 R8 R8 R8 R8 RAX
|
||||
R8 : RAX R9 RAX R9 RAX
|
||||
: RAX RAX
|
||||
*/
|
||||
cmp.to_stk_temps_map_odd =CAlloc(NUM_REGS*sizeof(U8));
|
||||
cmp.to_stk_temps_map_even=CAlloc(NUM_REGS*sizeof(U8));
|
||||
cmp.num_stk_temps=0;
|
||||
cmp.stk_temps_mask=REGG_C_TEMP_CLOBBERED;
|
||||
for (i=0;i<NUM_REGS;i++)
|
||||
if (Bt(&cmp.stk_temps_mask,i))
|
||||
cmp.to_stk_temps_map_even[cmp.num_stk_temps++]=i;
|
||||
k=cmp.num_stk_temps;
|
||||
for (i=0;i<NUM_REGS;i++)
|
||||
if (Bt(&cmp.stk_temps_mask,i))
|
||||
cmp.to_stk_temps_map_odd[--k]=i;
|
||||
|
||||
cmp.dual_U16_tokens1=d=CAlloc(sizeof(U32)*TK_NUM_TK);
|
||||
d['!']=TK_NOT_EQU<<16+'=';
|
||||
d['&']=TK_AND_AND<<16+'&';
|
||||
|
||||
+9
-10
@@ -256,7 +256,7 @@ U0 CmpFixUpJITAsm(CCmpCtrl *cc,CAOT *tempaot)
|
||||
break;
|
||||
case IET_REL_I8:
|
||||
if (!(MIN_I8<=i-ptr-1<=MAX_I8))
|
||||
LexExcept(cc,"branch out of range at ");
|
||||
LexExcept(cc,"Branch out of range at ");
|
||||
*ptr(U8 *) =i-ptr-1;
|
||||
break;
|
||||
case IET_IMM_U8:
|
||||
@@ -264,7 +264,7 @@ U0 CmpFixUpJITAsm(CCmpCtrl *cc,CAOT *tempaot)
|
||||
break;
|
||||
case IET_REL_I16:
|
||||
if (!(MIN_I16<=i-ptr-2<=MAX_I16))
|
||||
LexExcept(cc,"branch out of range at ");
|
||||
LexExcept(cc,"Branch out of range at ");
|
||||
*ptr(U16 *)=i-ptr-2;
|
||||
break;
|
||||
case IET_IMM_U16:
|
||||
@@ -272,7 +272,7 @@ U0 CmpFixUpJITAsm(CCmpCtrl *cc,CAOT *tempaot)
|
||||
break;
|
||||
case IET_REL_I32:
|
||||
if (!(MIN_I32<=i-ptr-4<=MAX_I32))
|
||||
LexExcept(cc,"branch out of range at ");
|
||||
LexExcept(cc,"Branch out of range at ");
|
||||
*ptr(U32 *)=i-ptr-4;
|
||||
break;
|
||||
case IET_IMM_U32:
|
||||
@@ -356,7 +356,7 @@ U0 CmpFixUpAOTAsm(CCmpCtrl *cc,CAOT *tempaot)
|
||||
break;
|
||||
case IET_REL_I8:
|
||||
if (!(MIN_I8<=i-ptr-1<=MAX_I8))
|
||||
LexExcept(cc,"branch out of range at ");
|
||||
LexExcept(cc,"Branch out of range at ");
|
||||
*ptr(U8 *) =i-ptr-1;
|
||||
break;
|
||||
case IET_IMM_U8:
|
||||
@@ -364,7 +364,7 @@ U0 CmpFixUpAOTAsm(CCmpCtrl *cc,CAOT *tempaot)
|
||||
break;
|
||||
case IET_REL_I16:
|
||||
if (!(MIN_I16<=i-ptr-2<=MAX_I16))
|
||||
LexExcept(cc,"branch out of range at ");
|
||||
LexExcept(cc,"Branch out of range at ");
|
||||
*ptr(U16 *)=i-ptr-2;
|
||||
break;
|
||||
case IET_IMM_U16:
|
||||
@@ -372,7 +372,7 @@ U0 CmpFixUpAOTAsm(CCmpCtrl *cc,CAOT *tempaot)
|
||||
break;
|
||||
case IET_REL_I32:
|
||||
if (!(MIN_I32<=i-ptr-4<=MAX_I32))
|
||||
LexExcept(cc,"branch out of range at ");
|
||||
LexExcept(cc,"Branch out of range at ");
|
||||
*ptr(U32 *)=i-ptr-4;
|
||||
break;
|
||||
case IET_IMM_U32:
|
||||
@@ -440,7 +440,7 @@ I64 Cmp(U8 *filename,U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0)
|
||||
cnt=0;
|
||||
tempa=tempaot->abss;
|
||||
while (tempa) {
|
||||
if (!(tempa->type&1))
|
||||
if (!(tempa->type&IEF_IMM_NOT_REL))
|
||||
cnt++;
|
||||
tempa=tempa->next;
|
||||
}
|
||||
@@ -451,7 +451,7 @@ I64 Cmp(U8 *filename,U8 *map_name=NULL,U8 *out_name=NULL,U8 mapfile_drv_let=0)
|
||||
tempa=tempaot->abss;
|
||||
while (tempa) {
|
||||
tempa1=tempa->next;
|
||||
if (!(tempa->type&1))
|
||||
if (!(tempa->type&IEF_IMM_NOT_REL))
|
||||
*ptr(U32 *)++ =tempa->ip;
|
||||
Free(tempa);
|
||||
tempa=tempa1;
|
||||
@@ -655,8 +655,7 @@ I64 ExePrint2(U8 *fmt,...)
|
||||
I64 ExeFile2(U8 *name,Bool just_load=FALSE)
|
||||
{//throws exceptions
|
||||
I64 result;
|
||||
U8 *name2=DftExt(name,"CPP.Z"),
|
||||
*st=MStrPrint("#include \"%s\";",name2);
|
||||
U8 *name2=DftExt(name,"CPP.Z"),*st=MStrPrint("#include \"%s\";",name2);
|
||||
result=ExePutS2(st,name,just_load);
|
||||
Free(st);
|
||||
Free(name2);
|
||||
|
||||
+8
-8
@@ -16,7 +16,7 @@ I64 PassTrace(I64 i=0b10001111101)
|
||||
return old;
|
||||
}
|
||||
|
||||
Bool Trace(Bool val)
|
||||
Bool Trace(Bool val=ON)
|
||||
{//Displays assembly code output from compiler.
|
||||
return Option(OPTf_TRACE,val);
|
||||
}
|
||||
@@ -52,15 +52,15 @@ U0 StreamDir()
|
||||
CD2I32 *LexD2I32(CCmpCtrl *cc,CD2I32 *p)
|
||||
{//Not HolyC. Sprite-like lex 2D point.
|
||||
if (cc->token!='(')
|
||||
LexExcept(cc,"expecting '(' at ");
|
||||
LexExcept(cc,"Expecting '(' at ");
|
||||
Lex(cc); //Skip (
|
||||
p->x=LexExpressionI64(cc);
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"expecting ',' at ");
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
Lex(cc); //Skip ,
|
||||
p->y=LexExpressionI64(cc);
|
||||
if (cc->token!=')')
|
||||
LexExcept(cc,"expecting ')' at ");
|
||||
LexExcept(cc,"Expecting ')' at ");
|
||||
Lex(cc); //Skip )
|
||||
return p;
|
||||
}
|
||||
@@ -68,19 +68,19 @@ CD2I32 *LexD2I32(CCmpCtrl *cc,CD2I32 *p)
|
||||
CD3I32 *LexD3I32(CCmpCtrl *cc,CD3I32 *p)
|
||||
{//Not HolyC. Sprite-like lex 3D point.
|
||||
if (cc->token!='(')
|
||||
LexExcept(cc,"expecting '(' at ");
|
||||
LexExcept(cc,"Expecting '(' at ");
|
||||
Lex(cc); //Skip (
|
||||
p->x=LexExpressionI64(cc);
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"expecting ',' at ");
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
Lex(cc); //Skip ,
|
||||
p->y=LexExpressionI64(cc);
|
||||
if (cc->token!=',')
|
||||
LexExcept(cc,"expecting ',' at ");
|
||||
LexExcept(cc,"Expecting ',' at ");
|
||||
Lex(cc); //Skip ,
|
||||
p->z=LexExpressionI64(cc);
|
||||
if (cc->token!=')')
|
||||
LexExcept(cc,"expecting ')' at ");
|
||||
LexExcept(cc,"Expecting ')' at ");
|
||||
Lex(cc); //Skip )
|
||||
return p;
|
||||
}
|
||||
|
||||
Binary file not shown.
+289
-257
@@ -1,31 +1,29 @@
|
||||
$LK,"LexPutPos",A="FL:::/Compiler/CExcept.CPP.Z,50",BI=1$
|
||||
$LK,"ICAssignPostIncDec",A="FL:::/Compiler/BackB.CPP.Z,517",BI=2$
|
||||
$LK,"CmpSetFloatOpPushPop",A="FL:::/Compiler/BackFA.CPP.Z,60",BI=3$
|
||||
$LK,"ICFCvt2",A="FL:::/Compiler/BackFA.CPP.Z,170",BI=4$
|
||||
$LK,"CmpRawTypePointed",A="FL:::/Compiler/OptLib.CPP.Z,518",BI=5$
|
||||
$LK,"ICAssignPostIncDec",A="FL:::/Compiler/BackB.CPP.Z,429",BI=2$
|
||||
$LK,"CmpSetFloatOpPushPop",A="FL:::/Compiler/BackFA.CPP.Z,62",BI=3$
|
||||
$LK,"ICFCvt2",A="FL:::/Compiler/BackFA.CPP.Z,169",BI=4$
|
||||
$LK,"CmpRawTypePointed",A="FL:::/Compiler/OptLib.CPP.Z,517",BI=5$
|
||||
$LK,"OptFixupBinaryOp1",A="FL:::/Compiler/OptLib.CPP.Z,96",BI=6$
|
||||
$LK,"OptFixupBinaryOp2",A="FL:::/Compiler/OptLib.CPP.Z,182",BI=7$
|
||||
$LK,"COCInit",A="FL:::/Compiler/PrsLib.CPP.Z,99",BI=8$
|
||||
$LK,"IsLexExpression2Bin",A="FL:::/Compiler/PrsExp.CPP.Z,1130",BI=9$
|
||||
$LK,"CSubSwitch",A="FL:::/Compiler/PrsStmt.CPP.Z,563"$
|
||||
$LK,"IsLexExpression2Bin",A="FL:::/Compiler/PrsExp.CPP.Z,1128",BI=9$
|
||||
$LK,"CSubSwitch",A="FL:::/Compiler/PrsStmt.CPP.Z,562"$
|
||||
$LK,"LexFilePop",A="FL:::/Compiler/Lex.CPP.Z,11",BI=10$
|
||||
$LK,"ExePutS",A="FL:::/Compiler/CMain.CPP.Z,571",BI=11$
|
||||
$LK,"PrsStaticInit",A="FL:::/Compiler/PrsVar.CPP.Z,215",BI=12$
|
||||
$LK,"LexPutLine",A="FL:::/Compiler/CExcept.CPP.Z,22",BI=13$
|
||||
$LK,"PrsKeyWord",A="FL:::/Compiler/PrsLib.CPP.Z,31",BI=14$
|
||||
$LK,"AsmLineLst",A="FL:::/Compiler/AsmLib.CPP.Z,149",BI=15$
|
||||
$LK,"AsmLineLst",A="FL:::/Compiler/AsmLib.CPP.Z,147",BI=15$
|
||||
$LK,"ICOpSizeRex",A="FL:::/Compiler/BackLib.CPP.Z,28",BI=16$
|
||||
$LK,"CVI2",A="FL:::/Compiler/PrsVar.CPP.Z,117"$
|
||||
$LK,"ICU8",A="FL:::/Compiler/BackLib.CPP.Z,17",BI=17$
|
||||
$LK,"AsmStoreNum",A="FL:::/Compiler/Asm.CPP.Z,263",BI=18$
|
||||
$LK,"MDR_SIB_D8_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,137"$
|
||||
$LK,"OptPass012",A="FL:::/Compiler/OptPass012.CPP.Z,23",BI=19$
|
||||
$LK,"MemberLstSize",A="FL:::/Compiler/LexLib.CPP.Z,191",BI=20$
|
||||
$LK,"ICQueIns",A="FL:::/Compiler/BackC.CPP.Z,412",BI=21$
|
||||
$LK,"ICQueIns",A="FL:::/Compiler/BackC.CPP.Z,355",BI=21$
|
||||
$LK,"ICAndBranch",A="FL:::/Compiler/BackC.CPP.Z,1",BI=22$
|
||||
$LK,"MDR_D8_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,134"$
|
||||
$LK,"U",A="FL:::/Compiler/UAsm.CPP.Z,649",BI=23$
|
||||
$LK,"ICQueRem",A="FL:::/Compiler/BackC.CPP.Z,494",BI=24$
|
||||
$LK,"U",A="FL:::/Compiler/UAsm.CPP.Z,645",BI=23$
|
||||
$LK,"ICQueRem",A="FL:::/Compiler/BackC.CPP.Z,403",BI=24$
|
||||
$LK,"CN_R",A="FL:::/Compiler/BackFA.CPP.Z,4"$
|
||||
$LK,"OptLead1",A="FL:::/Compiler/OptLib.CPP.Z,73",BI=25$
|
||||
$LK,"CmpNoteFloatOp",A="FL:::/Compiler/BackFA.CPP.Z,6",BI=26$
|
||||
@@ -33,24 +31,25 @@ $LK,"AOTGlblsResolve",A="FL:::/Compiler/AsmResolve.CPP.Z,76",BI=27$
|
||||
$LK,"ExePutS2",A="FL:::/Compiler/CMain.CPP.Z,627",BI=28$
|
||||
$LK,"HashEntrySize",A="FL:::/Compiler/CHash.CPP.Z,1",BI=29$
|
||||
$LK,"COCPush",A="FL:::/Compiler/PrsLib.CPP.Z,107",BI=30$
|
||||
$LK,"SLASH_OP_DEC",A="FL:::/Compiler/BackLib.CPP.Z,255"$
|
||||
$LK,"ICPushRegs",A="FL:::/Compiler/BackLib.CPP.Z,341",BI=31$
|
||||
$LK,"SLASH_OP_DEC",A="FL:::/Compiler/BackLib.CPP.Z,249"$
|
||||
$LK,"MODR_SIB_D32_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,136"$
|
||||
$LK,"ICPushRegs",A="FL:::/Compiler/BackLib.CPP.Z,335",BI=31$
|
||||
$LK,"PE_POP_HIGHER",A="FL:::/Compiler/PrsExp.CPP.Z,10"$
|
||||
$LK,"SLASH_OP_FLD",A="FL:::/Compiler/BackLib.CPP.Z,270"$
|
||||
$LK,"SLASH_OP_FLD",A="FL:::/Compiler/BackLib.CPP.Z,264"$
|
||||
$LK,"ICU32",A="FL:::/Compiler/BackLib.CPP.Z,47",BI=32$
|
||||
$LK,"ICU24",A="FL:::/Compiler/BackLib.CPP.Z,41",BI=33$
|
||||
$LK,"ICU16",A="FL:::/Compiler/BackLib.CPP.Z,35",BI=34$
|
||||
$LK,"SLASH_OP_DIV",A="FL:::/Compiler/BackLib.CPP.Z,260"$
|
||||
$LK,"SLASH_OP_DIV",A="FL:::/Compiler/BackLib.CPP.Z,254"$
|
||||
$LK,"CmpFillTables",A="FL:::/Compiler/CInit.CPP.Z,240",BI=35$
|
||||
$LK,"AOTStoreCodeU32",A="FL:::/Compiler/AsmLib.CPP.Z,30",BI=36$
|
||||
$LK,"ICU64",A="FL:::/Compiler/BackLib.CPP.Z,53",BI=37$
|
||||
$LK,"SLASH_OP_INC",A="FL:::/Compiler/BackLib.CPP.Z,254"$
|
||||
$LK,"AOTStoreCodeU64",A="FL:::/Compiler/AsmLib.CPP.Z,69",BI=38$
|
||||
$LK,"SLASH_OP_INC",A="FL:::/Compiler/BackLib.CPP.Z,248"$
|
||||
$LK,"AOTStoreCodeU64",A="FL:::/Compiler/AsmLib.CPP.Z,68",BI=38$
|
||||
$LK,"LexPopNoRestore",A="FL:::/Compiler/LexLib.CPP.Z,38",BI=39$
|
||||
$LK,"ExePrint",A="FL:::/Compiler/CMain.CPP.Z,607",BI=40$
|
||||
$LK,"SLASH_OP_NEG",A="FL:::/Compiler/BackLib.CPP.Z,257"$
|
||||
$LK,"SLASH_OP_NEG",A="FL:::/Compiler/BackLib.CPP.Z,251"$
|
||||
$LK,"PrsVarLst",A="FL:::/Compiler/PrsVar.CPP.Z,416",BI=41$
|
||||
$LK,"PrsAsmDefine",A="FL:::/Compiler/Asm.CPP.Z,811",BI=42$
|
||||
$LK,"PrsAsmDefine",A="FL:::/Compiler/Asm.CPP.Z,809",BI=42$
|
||||
$LK,"PrsAddOp",A="FL:::/Compiler/PrsExp.CPP.Z,15",BI=43$
|
||||
$LK,"LexWarn",A="FL:::/Compiler/CExcept.CPP.Z,65",BI=44$
|
||||
$LK,"PE_POP_ALL1",A="FL:::/Compiler/PrsExp.CPP.Z,12"$
|
||||
@@ -58,163 +57,162 @@ $LK,"PE_POP_ALL2",A="FL:::/Compiler/PrsExp.CPP.Z,13"$
|
||||
$LK,"COCAppend",A="FL:::/Compiler/PrsLib.CPP.Z,126",BI=45$
|
||||
$LK,"LexFilePush",A="FL:::/Compiler/Lex.CPP.Z,1",BI=46$
|
||||
$LK,"CN_MAIN",A="FL:::/Compiler/BackFA.CPP.Z,3"$
|
||||
$LK,"PrsUnaryModifier",A="FL:::/Compiler/PrsExp.CPP.Z,956",BI=47$
|
||||
$LK,"PrsUnaryModifier",A="FL:::/Compiler/PrsExp.CPP.Z,954",BI=47$
|
||||
$LK,"OptFixupUnaryOp",A="FL:::/Compiler/OptLib.CPP.Z,196",BI=48$
|
||||
$LK,"LexPush",A="FL:::/Compiler/LexLib.CPP.Z,12",BI=49$
|
||||
$LK,"SLASH_OP_MOV",A="FL:::/Compiler/BackLib.CPP.Z,261"$
|
||||
$LK,"ICPopRegs",A="FL:::/Compiler/BackLib.CPP.Z,381",BI=50$
|
||||
$LK,"SLASH_OP_MUL",A="FL:::/Compiler/BackLib.CPP.Z,258"$
|
||||
$LK,"SLASH_OP_NOT",A="FL:::/Compiler/BackLib.CPP.Z,256"$
|
||||
$LK,"SLASH_OP_MOV",A="FL:::/Compiler/BackLib.CPP.Z,255"$
|
||||
$LK,"ICPopRegs",A="FL:::/Compiler/BackLib.CPP.Z,376",BI=50$
|
||||
$LK,"SLASH_OP_MUL",A="FL:::/Compiler/BackLib.CPP.Z,252"$
|
||||
$LK,"SLASH_OP_NOT",A="FL:::/Compiler/BackLib.CPP.Z,250"$
|
||||
$LK,"NUM_INTERNAL_TYPES",A="FL:::/Compiler/CInit.CPP.Z,1"$
|
||||
$LK,"SLASH_OP_POP",A="FL:::/Compiler/BackLib.CPP.Z,263"$
|
||||
$LK,"ICFOp",A="FL:::/Compiler/BackFA.CPP.Z,360",BI=51$
|
||||
$LK,"SLASH_OP_POP",A="FL:::/Compiler/BackLib.CPP.Z,257"$
|
||||
$LK,"ICFOp",A="FL:::/Compiler/BackFA.CPP.Z,339",BI=51$
|
||||
$LK,"CN_A1",A="FL:::/Compiler/BackFA.CPP.Z,2"$
|
||||
$LK,"CN_A2",A="FL:::/Compiler/BackFA.CPP.Z,1"$
|
||||
$LK,"LexExpressionF64",A="FL:::/Compiler/PrsExp.CPP.Z,1149",BI=52$
|
||||
$LK,"LexExpressionF64",A="FL:::/Compiler/PrsExp.CPP.Z,1147",BI=52$
|
||||
$LK,"ICAdd",A="FL:::/Compiler/PrsLib.CPP.Z,79",BI=53$
|
||||
$LK,"CmpRawType",A="FL:::/Compiler/OptLib.CPP.Z,509",BI=54$
|
||||
$LK,"CmpRawType",A="FL:::/Compiler/OptLib.CPP.Z,508",BI=54$
|
||||
$LK,"ICFOpEqu",A="FL:::/Compiler/BackFB.CPP.Z,1",BI=55$
|
||||
$LK,"LexExpressionI64",A="FL:::/Compiler/PrsExp.CPP.Z,1135",BI=56$
|
||||
$LK,"ICQueInsRev",A="FL:::/Compiler/BackC.CPP.Z,453",BI=57$
|
||||
$LK,"LexExpression",A="FL:::/Compiler/PrsExp.CPP.Z,1163",BI=58$
|
||||
$LK,"LexExpressionI64",A="FL:::/Compiler/PrsExp.CPP.Z,1133",BI=56$
|
||||
$LK,"ICQueInsRev",A="FL:::/Compiler/BackC.CPP.Z,379",BI=57$
|
||||
$LK,"LexExpression",A="FL:::/Compiler/PrsExp.CPP.Z,1161",BI=58$
|
||||
$LK,"PrsExpression",A="FL:::/Compiler/PrsExp.CPP.Z,264",BI=59$
|
||||
$LK,"PrsClassNew",A="FL:::/Compiler/PrsLib.CPP.Z,40",BI=60$
|
||||
$LK,"LexInStr",A="FL:::/Compiler/Lex.CPP.Z,372",BI=61$
|
||||
$LK,"LexInStr",A="FL:::/Compiler/Lex.CPP.Z,373",BI=61$
|
||||
$LK,"internal_types_table",A="FL:::/Compiler/CInit.CPP.Z,6"$
|
||||
$LK,"OptPass3",A="FL:::/Compiler/OptPass3.CPP.Z,1",BI=62$
|
||||
$LK,"OptPass4",A="FL:::/Compiler/OptPass4.CPP.Z,171",BI=63$
|
||||
$LK,"OptPass4",A="FL:::/Compiler/OptPass4.CPP.Z,163",BI=63$
|
||||
$LK,"OptPass5",A="FL:::/Compiler/OptPass5.CPP.Z,1",BI=64$
|
||||
$LK,"OptPass6",A="FL:::/Compiler/OptPass6.CPP.Z,111",BI=65$
|
||||
$LK,"OptPass6",A="FL:::/Compiler/OptPass6.CPP.Z,96",BI=65$
|
||||
$LK,"MODR_REG",A="FL:::/Compiler/BackLib.CPP.Z,130"$
|
||||
$LK,"Echo",A="FL:::/Compiler/CMisc.CPP.Z,24",BI=66$
|
||||
$LK,"PrsGlblVarLst",A="FL:::/Compiler/PrsStmt.CPP.Z,201",BI=67$
|
||||
$LK,"ICQueInit",A="FL:::/Compiler/BackC.CPP.Z,398",BI=68$
|
||||
$LK,"ICCmp",A="FL:::/Compiler/BackB.CPP.Z,136",BI=69$
|
||||
$LK,"ICQueInit",A="FL:::/Compiler/BackC.CPP.Z,341",BI=68$
|
||||
$LK,"ICCmp",A="FL:::/Compiler/BackB.CPP.Z,102",BI=69$
|
||||
$LK,"ICAddRSP",A="FL:::/Compiler/BackLib.CPP.Z,69",BI=70$
|
||||
$LK,"ICDiv",A="FL:::/Compiler/BackA.CPP.Z,428",BI=71$
|
||||
$LK,"ICDeref",A="FL:::/Compiler/BackLib.CPP.Z,647",BI=72$
|
||||
$LK,"ICLea",A="FL:::/Compiler/BackLib.CPP.Z,615",BI=73$
|
||||
$LK,"ICDiv",A="FL:::/Compiler/BackA.CPP.Z,391",BI=71$
|
||||
$LK,"ICDeref",A="FL:::/Compiler/BackLib.CPP.Z,645",BI=72$
|
||||
$LK,"ICLea",A="FL:::/Compiler/BackLib.CPP.Z,613",BI=73$
|
||||
$LK,"CmpBuf",A="FL:::/Compiler/CMain.CPP.Z,157",BI=74$
|
||||
$LK,"CMP_TEMPLATES_DONT_PUSH_POP",A="FL:::/Compiler/Templates.CPP.Z,394"$
|
||||
$LK,"ICAddEct",A="FL:::/Compiler/BackA.CPP.Z,1",BI=75$
|
||||
$LK,"ICToF64",A="FL:::/Compiler/BackB.CPP.Z,372",BI=76$
|
||||
$LK,"PrsBinFile",A="FL:::/Compiler/Asm.CPP.Z,885",BI=77$
|
||||
$LK,"ICToF64",A="FL:::/Compiler/BackB.CPP.Z,283",BI=76$
|
||||
$LK,"PrsBinFile",A="FL:::/Compiler/Asm.CPP.Z,883",BI=77$
|
||||
$LK,"HashTableSize2",A="FL:::/Compiler/CHash.CPP.Z,72",BI=78$
|
||||
$LK,"HashEntrySize2",A="FL:::/Compiler/CHash.CPP.Z,33",BI=79$
|
||||
$LK,"Ui",A="FL:::/Compiler/UAsm.CPP.Z,238",BI=80$
|
||||
$LK,"ICSlashOp",A="FL:::/Compiler/BackLib.CPP.Z,275",BI=81$
|
||||
$LK,"OptBrZero",A="FL:::/Compiler/OptLib.CPP.Z,231",BI=82$
|
||||
$LK,"Un",A="FL:::/Compiler/UAsm.CPP.Z,664",BI=83$
|
||||
$LK,"ICSlashOp",A="FL:::/Compiler/BackLib.CPP.Z,269",BI=81$
|
||||
$LK,"OptBrZero",A="FL:::/Compiler/OptLib.CPP.Z,230",BI=82$
|
||||
$LK,"Un",A="FL:::/Compiler/UAsm.CPP.Z,660",BI=83$
|
||||
$LK,"PrsSizeOf",A="FL:::/Compiler/PrsExp.CPP.Z,298",BI=84$
|
||||
$LK,"ICToI64",A="FL:::/Compiler/BackB.CPP.Z,366",BI=85$
|
||||
$LK,"ICMod",A="FL:::/Compiler/BackA.CPP.Z,521",BI=86$
|
||||
$LK,"ICToI64",A="FL:::/Compiler/BackB.CPP.Z,277",BI=85$
|
||||
$LK,"ICMod",A="FL:::/Compiler/BackA.CPP.Z,461",BI=86$
|
||||
$LK,"OptSetNOP1",A="FL:::/Compiler/OptLib.CPP.Z,17",BI=87$
|
||||
$LK,"OptPass789A",A="FL:::/Compiler/OptPass789A.CPP.Z,1",BI=88$
|
||||
$LK,"OptSetNOP2",A="FL:::/Compiler/OptLib.CPP.Z,25",BI=89$
|
||||
$LK,"FBO1_F64",A="FL:::/Compiler/OptLib.CPP.Z,94"$
|
||||
$LK,"ICXorEqu",A="FL:::/Compiler/BackC.CPP.Z,737",BI=90$
|
||||
$LK,"ICToUpper",A="FL:::/Compiler/BackB.CPP.Z,355",BI=91$
|
||||
$LK,"AsmLexExpression",A="FL:::/Compiler/AsmLib.CPP.Z,129",BI=92$
|
||||
$LK,"ICMov",A="FL:::/Compiler/BackLib.CPP.Z,435",BI=93$
|
||||
$LK,"ICXorEqu",A="FL:::/Compiler/BackC.CPP.Z,582",BI=90$
|
||||
$LK,"ICToUpper",A="FL:::/Compiler/BackB.CPP.Z,266",BI=91$
|
||||
$LK,"AsmLexExpression",A="FL:::/Compiler/AsmLib.CPP.Z,127",BI=92$
|
||||
$LK,"ICMov",A="FL:::/Compiler/BackLib.CPP.Z,430",BI=93$
|
||||
$LK,"ICNot",A="FL:::/Compiler/BackB.CPP.Z,10",BI=94$
|
||||
$LK,"ICMul",A="FL:::/Compiler/BackA.CPP.Z,286",BI=95$
|
||||
$LK,"ICMul",A="FL:::/Compiler/BackA.CPP.Z,263",BI=95$
|
||||
$LK,"ICRex",A="FL:::/Compiler/BackLib.CPP.Z,22",BI=96$
|
||||
$LK,"ICPop",A="FL:::/Compiler/BackLib.CPP.Z,354",BI=97$
|
||||
$LK,"MDR_RIP_REL",A="FL:::/Compiler/BackLib.CPP.Z,139"$
|
||||
$LK,"SLASH_OP_FADD",A="FL:::/Compiler/BackLib.CPP.Z,264"$
|
||||
$LK,"ICPop",A="FL:::/Compiler/BackLib.CPP.Z,348",BI=97$
|
||||
$LK,"SLASH_OP_FADD",A="FL:::/Compiler/BackLib.CPP.Z,258"$
|
||||
$LK,"MODR_RIP_REL",A="FL:::/Compiler/BackLib.CPP.Z,137"$
|
||||
$LK,"LexStmt2Bin",A="FL:::/Compiler/CMain.CPP.Z,1",BI=98$
|
||||
$LK,"ICSub",A="FL:::/Compiler/BackA.CPP.Z,207",BI=99$
|
||||
$LK,"ICSub",A="FL:::/Compiler/BackA.CPP.Z,205",BI=99$
|
||||
$LK,"COCFloatConstFind",A="FL:::/Compiler/PrsLib.CPP.Z,164",BI=100$
|
||||
$LK,"ICPut",A="FL:::/Compiler/CExcept.CPP.Z,186",BI=101$
|
||||
$LK,"ICPut",A="FL:::/Compiler/CExcept.CPP.Z,184",BI=101$
|
||||
$LK,"PrsArrayDims",A="FL:::/Compiler/PrsVar.CPP.Z,247",BI=102$
|
||||
$LK,"ICSqr",A="FL:::/Compiler/BackC.CPP.Z,582",BI=103$
|
||||
$LK,"ICSqr",A="FL:::/Compiler/BackC.CPP.Z,457",BI=103$
|
||||
$LK,"FBO1_NOT_CONST",A="FL:::/Compiler/OptLib.CPP.Z,92"$
|
||||
$LK,"CMP_TEMPLATES_DONT_POP",A="FL:::/Compiler/Templates.CPP.Z,178"$
|
||||
$LK,"PrsClass",A="FL:::/Compiler/PrsStmt.CPP.Z,1",BI=104$
|
||||
$LK,"MemberMetaData",A="FL:::/Compiler/LexLib.CPP.Z,45",BI=105$
|
||||
$LK,"ICSwitch",A="FL:::/Compiler/BackC.CPP.Z,758",BI=106$
|
||||
$LK,"OptBrNotZero",A="FL:::/Compiler/OptLib.CPP.Z,358",BI=107$
|
||||
$LK,"ICSwitch",A="FL:::/Compiler/BackC.CPP.Z,603",BI=106$
|
||||
$LK,"OptBrNotZero",A="FL:::/Compiler/OptLib.CPP.Z,357",BI=107$
|
||||
$LK,"LexPutToken",A="FL:::/Compiler/CExcept.CPP.Z,1",BI=108$
|
||||
$LK,"SLASH_OP_FDIV",A="FL:::/Compiler/BackLib.CPP.Z,268"$
|
||||
$LK,"SLASH_OP_FDIV",A="FL:::/Compiler/BackLib.CPP.Z,262"$
|
||||
$LK,"AsmHashLoad",A="FL:::/Compiler/AsmInit.CPP.Z,50",BI=109$
|
||||
$LK,"UAsmHashLoad",A="FL:::/Compiler/UAsm.CPP.Z,188",BI=110$
|
||||
$LK,"UnusedExternWarning",A="FL:::/Compiler/CExcept.CPP.Z,104",BI=111$
|
||||
$LK,"SLASH_OP_FILD",A="FL:::/Compiler/BackLib.CPP.Z,273"$
|
||||
$LK,"ICXorXor",A="FL:::/Compiler/BackB.CPP.Z,98",BI=112$
|
||||
$LK,"SLASH_OP_FILD",A="FL:::/Compiler/BackLib.CPP.Z,267"$
|
||||
$LK,"ICXorXor",A="FL:::/Compiler/BackB.CPP.Z,75",BI=112$
|
||||
$LK,"PrsTryBlk",A="FL:::/Compiler/PrsStmt.CPP.Z,838",BI=113$
|
||||
$LK,"CInit",A="FL:::/Compiler/CMain.CPP.Z,684",BI=114$
|
||||
$LK,"CInit",A="FL:::/Compiler/CMain.CPP.Z,683",BI=114$
|
||||
$LK,"MemberMetaFind",A="FL:::/Compiler/LexLib.CPP.Z,56",BI=115$
|
||||
$LK,"ExePrint2",A="FL:::/Compiler/CMain.CPP.Z,646",BI=116$
|
||||
$LK,"FBO1_INT",A="FL:::/Compiler/OptLib.CPP.Z,93"$
|
||||
$LK,"PE_DO_UNARY_OP",A="FL:::/Compiler/PrsExp.CPP.Z,8"$
|
||||
$LK,"PrsVarInit",A="FL:::/Compiler/PrsVar.CPP.Z,1",BI=117$
|
||||
$LK,"ICOrEqu",A="FL:::/Compiler/BackC.CPP.Z,716",BI=118$
|
||||
$LK,"ICModr1",A="FL:::/Compiler/BackLib.CPP.Z,141",BI=119$
|
||||
$LK,"ICModr2",A="FL:::/Compiler/BackLib.CPP.Z,223",BI=120$
|
||||
$LK,"SLASH_OP_FMUL",A="FL:::/Compiler/BackLib.CPP.Z,267"$
|
||||
$LK,"ICPreIncDec",A="FL:::/Compiler/BackB.CPP.Z,393",BI=121$
|
||||
$LK,"PrsAsmInstruction",A="FL:::/Compiler/Asm.CPP.Z,390",BI=122$
|
||||
$LK,"PrsUnaryTerm",A="FL:::/Compiler/PrsExp.CPP.Z,588",BI=123$
|
||||
$LK,"MemberLstDel",A="FL:::/Compiler/LexLib.CPP.Z,157",BI=124$
|
||||
$LK,"SLASH_OP_FSUB",A="FL:::/Compiler/BackLib.CPP.Z,265"$
|
||||
$LK,"ICAndAnd",A="FL:::/Compiler/BackB.CPP.Z,31",BI=125$
|
||||
$LK,"InstEntriesCompare",A="FL:::/Compiler/UAsm.CPP.Z,1",BI=126$
|
||||
$LK,"SLASH_OP_IMUL",A="FL:::/Compiler/BackLib.CPP.Z,259"$
|
||||
$LK,"SLASH_OP_FSTP",A="FL:::/Compiler/BackLib.CPP.Z,271"$
|
||||
$LK,"COCDel",A="FL:::/Compiler/PrsLib.CPP.Z,186",BI=127$
|
||||
$LK,"ICOrEqu",A="FL:::/Compiler/BackC.CPP.Z,561",BI=118$
|
||||
$LK,"ICModr1",A="FL:::/Compiler/BackLib.CPP.Z,139",BI=119$
|
||||
$LK,"ICModr2",A="FL:::/Compiler/BackLib.CPP.Z,217",BI=120$
|
||||
$LK,"SLASH_OP_FMUL",A="FL:::/Compiler/BackLib.CPP.Z,261"$
|
||||
$LK,"ICPreIncDec",A="FL:::/Compiler/BackB.CPP.Z,304",BI=121$
|
||||
$LK,"PrsUnaryTerm",A="FL:::/Compiler/PrsExp.CPP.Z,588",BI=122$
|
||||
$LK,"MemberLstDel",A="FL:::/Compiler/LexLib.CPP.Z,157",BI=123$
|
||||
$LK,"SLASH_OP_FSUB",A="FL:::/Compiler/BackLib.CPP.Z,259"$
|
||||
$LK,"ICAndAnd",A="FL:::/Compiler/BackB.CPP.Z,30",BI=124$
|
||||
$LK,"InstEntriesCompare",A="FL:::/Compiler/UAsm.CPP.Z,1",BI=125$
|
||||
$LK,"SLASH_OP_IMUL",A="FL:::/Compiler/BackLib.CPP.Z,253"$
|
||||
$LK,"SLASH_OP_FSTP",A="FL:::/Compiler/BackLib.CPP.Z,265"$
|
||||
$LK,"COCDel",A="FL:::/Compiler/PrsLib.CPP.Z,186",BI=126$
|
||||
$LK,"PE_UNARY_TERM1",A="FL:::/Compiler/PrsExp.CPP.Z,1"$
|
||||
$LK,"ICFAdd",A="FL:::/Compiler/BackFB.CPP.Z,602",BI=128$
|
||||
$LK,"ICFAdd",A="FL:::/Compiler/BackFB.CPP.Z,502",BI=127$
|
||||
$LK,"PE_UNARY_TERM2",A="FL:::/Compiler/PrsExp.CPP.Z,2"$
|
||||
$LK,"CmdLinePmt",A="FL:::/Compiler/CMisc.CPP.Z,88",BI=129$
|
||||
$LK,"AsmMakeArgMask",A="FL:::/Compiler/Asm.CPP.Z,172",BI=130$
|
||||
$LK,"COCHeaderPut",A="FL:::/Compiler/PrsLib.CPP.Z,229",BI=131$
|
||||
$LK,"PrsGlblInit",A="FL:::/Compiler/PrsVar.CPP.Z,206",BI=132$
|
||||
$LK,"ICAndEqu",A="FL:::/Compiler/BackC.CPP.Z,695",BI=133$
|
||||
$LK,"LexD2I32",A="FL:::/Compiler/CMisc.CPP.Z,52",BI=134$
|
||||
$LK,"MemberLstNew",A="FL:::/Compiler/LexLib.CPP.Z,150",BI=135$
|
||||
$LK,"LexD3I32",A="FL:::/Compiler/CMisc.CPP.Z,68",BI=136$
|
||||
$LK,"OptClassFwd",A="FL:::/Compiler/OptLib.CPP.Z,9",BI=137$
|
||||
$LK,"ICFCmp",A="FL:::/Compiler/BackFA.CPP.Z,545",BI=138$
|
||||
$LK,"PrsSwitch",A="FL:::/Compiler/PrsStmt.CPP.Z,575",BI=139$
|
||||
$LK,"ICFDiv",A="FL:::/Compiler/BackFB.CPP.Z,590",BI=140$
|
||||
$LK,"AOTStoreCodeU8At",A="FL:::/Compiler/AsmLib.CPP.Z,108",BI=141$
|
||||
$LK,"CmdLinePmt",A="FL:::/Compiler/CMisc.CPP.Z,88",BI=128$
|
||||
$LK,"AsmMakeArgMask",A="FL:::/Compiler/Asm.CPP.Z,172",BI=129$
|
||||
$LK,"COCHeaderPut",A="FL:::/Compiler/PrsLib.CPP.Z,229",BI=130$
|
||||
$LK,"PrsGlblInit",A="FL:::/Compiler/PrsVar.CPP.Z,206",BI=131$
|
||||
$LK,"ICAndEqu",A="FL:::/Compiler/BackC.CPP.Z,540",BI=132$
|
||||
$LK,"LexD2I32",A="FL:::/Compiler/CMisc.CPP.Z,52",BI=133$
|
||||
$LK,"MemberLstNew",A="FL:::/Compiler/LexLib.CPP.Z,150",BI=134$
|
||||
$LK,"LexD3I32",A="FL:::/Compiler/CMisc.CPP.Z,68",BI=135$
|
||||
$LK,"OptClassFwd",A="FL:::/Compiler/OptLib.CPP.Z,9",BI=136$
|
||||
$LK,"ICFCmp",A="FL:::/Compiler/BackFA.CPP.Z,515",BI=137$
|
||||
$LK,"PrsSwitch",A="FL:::/Compiler/PrsStmt.CPP.Z,574",BI=138$
|
||||
$LK,"ICFDiv",A="FL:::/Compiler/BackFB.CPP.Z,491",BI=139$
|
||||
$LK,"AOTStoreCodeU8At",A="FL:::/Compiler/AsmLib.CPP.Z,106",BI=140$
|
||||
$LK,"PE_PUSH_LOWER",A="FL:::/Compiler/PrsExp.CPP.Z,11"$
|
||||
$LK,"OptPass6Lag",A="FL:::/Compiler/OptPass6.CPP.Z,28",BI=142$
|
||||
$LK,"OptLag1",A="FL:::/Compiler/OptLib.CPP.Z,51",BI=143$
|
||||
$LK,"OptLag2",A="FL:::/Compiler/OptLib.CPP.Z,62",BI=144$
|
||||
$LK,"StreamPrint",A="FL:::/Compiler/CMisc.CPP.Z,29",BI=145$
|
||||
$LK,"ICFCvt",A="FL:::/Compiler/BackFA.CPP.Z,121",BI=146$
|
||||
$LK,"StreamDir",A="FL:::/Compiler/CMisc.CPP.Z,43",BI=147$
|
||||
$LK,"PrsOffsetOf",A="FL:::/Compiler/PrsExp.CPP.Z,348",BI=148$
|
||||
$LK,"MDR_REG",A="FL:::/Compiler/BackLib.CPP.Z,132"$
|
||||
$LK,"GetOption",A="FL:::/Compiler/CMisc.CPP.Z,6",BI=149$
|
||||
$LK,"PrsDoWhile",A="FL:::/Compiler/PrsStmt.CPP.Z,503",BI=150$
|
||||
$LK,"ICShift",A="FL:::/Compiler/BackA.CPP.Z,694",BI=151$
|
||||
$LK,"ICFMod",A="FL:::/Compiler/BackFA.CPP.Z,249",BI=152$
|
||||
$LK,"COCPop",A="FL:::/Compiler/PrsLib.CPP.Z,121",BI=153$
|
||||
$LK,"PrsExpression2",A="FL:::/Compiler/PrsExp.CPP.Z,65",BI=154$
|
||||
$LK,"SLASH_OP_PUSH",A="FL:::/Compiler/BackLib.CPP.Z,262"$
|
||||
$LK,"OptPass6Lag",A="FL:::/Compiler/OptPass6.CPP.Z,28",BI=141$
|
||||
$LK,"OptLag1",A="FL:::/Compiler/OptLib.CPP.Z,51",BI=142$
|
||||
$LK,"OptLag2",A="FL:::/Compiler/OptLib.CPP.Z,62",BI=143$
|
||||
$LK,"StreamPrint",A="FL:::/Compiler/CMisc.CPP.Z,29",BI=144$
|
||||
$LK,"ICFCvt",A="FL:::/Compiler/BackFA.CPP.Z,123",BI=145$
|
||||
$LK,"StreamDir",A="FL:::/Compiler/CMisc.CPP.Z,43",BI=146$
|
||||
$LK,"PrsOffsetOf",A="FL:::/Compiler/PrsExp.CPP.Z,348",BI=147$
|
||||
$LK,"GetOption",A="FL:::/Compiler/CMisc.CPP.Z,6",BI=148$
|
||||
$LK,"PrsDoWhile",A="FL:::/Compiler/PrsStmt.CPP.Z,502",BI=149$
|
||||
$LK,"ICShift",A="FL:::/Compiler/BackA.CPP.Z,609",BI=150$
|
||||
$LK,"ICFMod",A="FL:::/Compiler/BackFA.CPP.Z,242",BI=151$
|
||||
$LK,"COCPop",A="FL:::/Compiler/PrsLib.CPP.Z,121",BI=152$
|
||||
$LK,"PrsExpression2",A="FL:::/Compiler/PrsExp.CPP.Z,65",BI=153$
|
||||
$LK,"SLASH_OP_PUSH",A="FL:::/Compiler/BackLib.CPP.Z,256"$
|
||||
$LK,"PE_DEREFERENCE",A="FL:::/Compiler/PrsExp.CPP.Z,5"$
|
||||
$LK,"LexPopRestore",A="FL:::/Compiler/LexLib.CPP.Z,23",BI=155$
|
||||
$LK,"ICUnaries",A="FL:::/Compiler/BackB.CPP.Z,1",BI=156$
|
||||
$LK,"ICFMul",A="FL:::/Compiler/BackFB.CPP.Z,572",BI=157$
|
||||
$LK,"ICShiftEqu",A="FL:::/Compiler/BackA.CPP.Z,727",BI=158$
|
||||
$LK,"LexExpression2Bin",A="FL:::/Compiler/PrsExp.CPP.Z,1112",BI=159$
|
||||
$LK,"ICFPow",A="FL:::/Compiler/BackFA.CPP.Z,280",BI=160$
|
||||
$LK,"MapFileWrite",A="FL:::/Compiler/CHash.CPP.Z,90",BI=161$
|
||||
$LK,"ICFSub",A="FL:::/Compiler/BackFB.CPP.Z,638",BI=162$
|
||||
$LK,"ICFModEqu",A="FL:::/Compiler/BackFA.CPP.Z,585",BI=163$
|
||||
$LK,"CmpF1PushPop",A="FL:::/Compiler/OptLib.CPP.Z,529",BI=164$
|
||||
$LK,"OptFree",A="FL:::/Compiler/OptLib.CPP.Z,33",BI=165$
|
||||
$LK,"LexPopRestore",A="FL:::/Compiler/LexLib.CPP.Z,23",BI=154$
|
||||
$LK,"ICUnaries",A="FL:::/Compiler/BackB.CPP.Z,1",BI=155$
|
||||
$LK,"ICFMul",A="FL:::/Compiler/BackFB.CPP.Z,475",BI=156$
|
||||
$LK,"ICShiftEqu",A="FL:::/Compiler/BackA.CPP.Z,639",BI=157$
|
||||
$LK,"LexExpression2Bin",A="FL:::/Compiler/PrsExp.CPP.Z,1110",BI=158$
|
||||
$LK,"ICFPow",A="FL:::/Compiler/BackFA.CPP.Z,266",BI=159$
|
||||
$LK,"MapFileWrite",A="FL:::/Compiler/CHash.CPP.Z,90",BI=160$
|
||||
$LK,"ICFSub",A="FL:::/Compiler/BackFB.CPP.Z,538",BI=161$
|
||||
$LK,"ICFModEqu",A="FL:::/Compiler/BackFA.CPP.Z,545",BI=162$
|
||||
$LK,"CmpF1PushPop",A="FL:::/Compiler/OptLib.CPP.Z,528",BI=163$
|
||||
$LK,"OptFree",A="FL:::/Compiler/OptLib.CPP.Z,33",BI=164$
|
||||
$LK,"CMP_TEMPLATES_DONT_PUSH2",A="FL:::/Compiler/Templates.CPP.Z,458"$
|
||||
$LK,"CInternalType",A="FL:::/Compiler/CInit.CPP.Z,3"$
|
||||
$LK,"LexDollar",A="FL:::/Compiler/Lex.CPP.Z,93",BI=166$
|
||||
$LK,"AsmUnresolvedAdd",A="FL:::/Compiler/AsmResolve.CPP.Z,189",BI=167$
|
||||
$LK,"AOTStoreCodeU8",A="FL:::/Compiler/AsmLib.CPP.Z,1",BI=168$
|
||||
$LK,"MDR_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,133"$
|
||||
$LK,"ICBitOps",A="FL:::/Compiler/BackB.CPP.Z,256",BI=169$
|
||||
$LK,"LexDollar",A="FL:::/Compiler/Lex.CPP.Z,93",BI=165$
|
||||
$LK,"AsmUnresolvedAdd",A="FL:::/Compiler/AsmResolve.CPP.Z,188",BI=166$
|
||||
$LK,"AOTStoreCodeU8",A="FL:::/Compiler/AsmLib.CPP.Z,1",BI=167$
|
||||
$LK,"ICBitOps",A="FL:::/Compiler/BackB.CPP.Z,202",BI=168$
|
||||
$LK,"lex_zeros",A="FL:::/Compiler/Lex.CPP.Z,91"$
|
||||
$LK,"CSwitchCase",A="FL:::/Compiler/PrsStmt.CPP.Z,568"$
|
||||
$LK,"AsmResolve",A="FL:::/Compiler/AsmResolve.CPP.Z,1",BI=170$
|
||||
$LK,"CSwitchCase",A="FL:::/Compiler/PrsStmt.CPP.Z,567"$
|
||||
$LK,"AsmResolve",A="FL:::/Compiler/AsmResolve.CPP.Z,1",BI=169$
|
||||
$LK,"PrsAsmInst",A="FL:::/Compiler/Asm.CPP.Z,390",BI=170$
|
||||
$LK,"COCCompile",A="FL:::/Compiler/PrsLib.CPP.Z,249",BI=171$
|
||||
$LK,"Cmp",A="FL:::/Compiler/CMain.CPP.Z,419",BI=172$
|
||||
$LK,"PrsPush2",A="FL:::/Compiler/PrsLib.CPP.Z,11",BI=173$
|
||||
@@ -222,164 +220,188 @@ $LK,"ICArgPut",A="FL:::/Compiler/CExcept.CPP.Z,141",BI=174$
|
||||
$LK,"UndefinedExtern",A="FL:::/Compiler/CExcept.CPP.Z,98",BI=175$
|
||||
$LK,"OptIC4",A="FL:::/Compiler/OptPass4.CPP.Z,1",BI=176$
|
||||
$LK,"OptIC6",A="FL:::/Compiler/OptPass6.CPP.Z,1",BI=177$
|
||||
$LK,"ICCmpAndBranch",A="FL:::/Compiler/BackB.CPP.Z,556",BI=178$
|
||||
$LK,"ICDivEqu",A="FL:::/Compiler/BackA.CPP.Z,452",BI=179$
|
||||
$LK,"PrsWhile",A="FL:::/Compiler/PrsStmt.CPP.Z,483",BI=180$
|
||||
$LK,"ICFCmpAndBranch",A="FL:::/Compiler/BackFB.CPP.Z,309",BI=181$
|
||||
$LK,"Lex",A="FL:::/Compiler/Lex.CPP.Z,442",BI=182$
|
||||
$LK,"ICTestAndBranch",A="FL:::/Compiler/BackB.CPP.Z,736",BI=183$
|
||||
$LK,"ICCmpAndBranch",A="FL:::/Compiler/BackB.CPP.Z,468",BI=178$
|
||||
$LK,"ICDivEqu",A="FL:::/Compiler/BackA.CPP.Z,408",BI=179$
|
||||
$LK,"PrsWhile",A="FL:::/Compiler/PrsStmt.CPP.Z,482",BI=180$
|
||||
$LK,"ICFCmpAndBranch",A="FL:::/Compiler/BackFB.CPP.Z,217",BI=181$
|
||||
$LK,"Lex",A="FL:::/Compiler/Lex.CPP.Z,443",BI=182$
|
||||
$LK,"ICTestAndBranch",A="FL:::/Compiler/BackB.CPP.Z,634",BI=183$
|
||||
$LK,"uasm",A="FL:::/Compiler/Compiler.PRJ.Z,21"$
|
||||
$LK,"MDR_SIB_D32_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,138"$
|
||||
$LK,"MODR_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,131"$
|
||||
$LK,"PE_MAYBE_MODIFIERS",A="FL:::/Compiler/PrsExp.CPP.Z,3"$
|
||||
$LK,"PE_UNARY_MODIFIERS",A="FL:::/Compiler/PrsExp.CPP.Z,4"$
|
||||
$LK,"AOTLocalsResolve",A="FL:::/Compiler/AsmResolve.CPP.Z,42",BI=184$
|
||||
$LK,"PE_DO_BINARY_OP",A="FL:::/Compiler/PrsExp.CPP.Z,9"$
|
||||
$LK,"CmpFixUpAOTAsm",A="FL:::/Compiler/CMain.CPP.Z,302",BI=185$
|
||||
$LK,"OptLabelFwd",A="FL:::/Compiler/OptLib.CPP.Z,1",BI=186$
|
||||
$LK,"ICOrOr",A="FL:::/Compiler/BackB.CPP.Z,63",BI=187$
|
||||
$LK,"ICOrOr",A="FL:::/Compiler/BackB.CPP.Z,51",BI=187$
|
||||
$LK,"LexExcept",A="FL:::/Compiler/CExcept.CPP.Z,81",BI=188$
|
||||
$LK,"cmp_templates",A="FL:::/Compiler/CExts.CPP.Z,42"$
|
||||
$LK,"CmpF2PushPop",A="FL:::/Compiler/OptLib.CPP.Z,536",BI=189$
|
||||
$LK,"MDR_D32_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,135"$
|
||||
$LK,"CmpF2PushPop",A="FL:::/Compiler/OptLib.CPP.Z,535",BI=189$
|
||||
$LK,"CmpJoin",A="FL:::/Compiler/CMain.CPP.Z,35",BI=190$
|
||||
$LK,"MDR_SIB_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,136"$
|
||||
$LK,"PrsPop2",A="FL:::/Compiler/PrsLib.CPP.Z,16",BI=191$
|
||||
$LK,"CMP_TEMPLATES",A="FL:::/Compiler/Templates.CPP.Z,4"$
|
||||
$LK,"PrsAsmBlk",A="FL:::/Compiler/Asm.CPP.Z,901",BI=192$
|
||||
$LK,"MODR_D8_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,132"$
|
||||
$LK,"PrsAsmBlk",A="FL:::/Compiler/Asm.CPP.Z,899",BI=192$
|
||||
$LK,"PrsAsmArg",A="FL:::/Compiler/Asm.CPP.Z,35",BI=193$
|
||||
$LK,"LexFirstRem",A="FL:::/Compiler/Lex.CPP.Z,276",BI=194$
|
||||
$LK,"LexFirstRem",A="FL:::/Compiler/Lex.CPP.Z,277",BI=194$
|
||||
$LK,"MemberClassBaseFind",A="FL:::/Compiler/LexLib.CPP.Z,87",BI=195$
|
||||
$LK,"MemberFind",A="FL:::/Compiler/LexLib.CPP.Z,67",BI=196$
|
||||
$LK,"cmp",A="FL:::/Compiler/Compiler.PRJ.Z,16"$
|
||||
$LK,"OptLag",A="FL:::/Compiler/OptLib.CPP.Z,40",BI=197$
|
||||
$LK,"ICPostIncDec",A="FL:::/Compiler/BackB.CPP.Z,434",BI=198$
|
||||
$LK,"ICFPostIncDec",A="FL:::/Compiler/BackFB.CPP.Z,680",BI=199$
|
||||
$LK,"ICTest",A="FL:::/Compiler/BackLib.CPP.Z,403",BI=200$
|
||||
$LK,"ICModU64",A="FL:::/Compiler/BackC.CPP.Z,589",BI=201$
|
||||
$LK,"ICPostIncDec",A="FL:::/Compiler/BackB.CPP.Z,345",BI=198$
|
||||
$LK,"ICFPostIncDec",A="FL:::/Compiler/BackFB.CPP.Z,580",BI=199$
|
||||
$LK,"ICTest",A="FL:::/Compiler/BackLib.CPP.Z,398",BI=200$
|
||||
$LK,"ICModU64",A="FL:::/Compiler/BackC.CPP.Z,464",BI=201$
|
||||
$LK,"ICLastIns",A="FL:::/Compiler/BackLib.CPP.Z,59",BI=202$
|
||||
$LK,"PrsAsmImm",A="FL:::/Compiler/Asm.CPP.Z,1",BI=203$
|
||||
$LK,"LexExtStr",A="FL:::/Compiler/LexLib.CPP.Z,218",BI=204$
|
||||
$LK,"ICAddSubEctEqu",A="FL:::/Compiler/BackA.CPP.Z,545",BI=205$
|
||||
$LK,"ICAddSubEctImm",A="FL:::/Compiler/BackA.CPP.Z,57",BI=206$
|
||||
$LK,"ICPush",A="FL:::/Compiler/BackLib.CPP.Z,303",BI=207$
|
||||
$LK,"ICSwap",A="FL:::/Compiler/BackC.CPP.Z,633",BI=208$
|
||||
$LK,"ICAddSubEctEqu",A="FL:::/Compiler/BackA.CPP.Z,478",BI=205$
|
||||
$LK,"ICAddSubEctImm",A="FL:::/Compiler/BackA.CPP.Z,56",BI=206$
|
||||
$LK,"ICPush",A="FL:::/Compiler/BackLib.CPP.Z,297",BI=207$
|
||||
$LK,"ICSwap",A="FL:::/Compiler/BackC.CPP.Z,491",BI=208$
|
||||
$LK,"CMP_TEMPLATES_DONT_PUSH",A="FL:::/Compiler/Templates.CPP.Z,267"$
|
||||
$LK,"intermediate_code_table",A="FL:::/Compiler/CInit.CPP.Z,16"$
|
||||
$LK,"ICZero",A="FL:::/Compiler/BackLib.CPP.Z,394",BI=209$
|
||||
$LK,"ICZero",A="FL:::/Compiler/BackLib.CPP.Z,389",BI=209$
|
||||
$LK,"CmpCtrlDel",A="FL:::/Compiler/Lex.CPP.Z,58",BI=210$
|
||||
$LK,"ICClassPut",A="FL:::/Compiler/CExcept.CPP.Z,117",BI=211$
|
||||
$LK,"ICAssign",A="FL:::/Compiler/BackC.CPP.Z,159",BI=212$
|
||||
$LK,"ICFTemplateFun",A="FL:::/Compiler/BackFB.CPP.Z,704",BI=213$
|
||||
$LK,"ICFTemplateFun",A="FL:::/Compiler/BackFB.CPP.Z,604",BI=213$
|
||||
$LK,"MemberAdd",A="FL:::/Compiler/LexLib.CPP.Z,103",BI=214$
|
||||
$LK,"PrsPush",A="FL:::/Compiler/PrsLib.CPP.Z,1",BI=215$
|
||||
$LK,"SLASH_OP_FDIVR",A="FL:::/Compiler/BackLib.CPP.Z,269"$
|
||||
$LK,"SLASH_OP_FISTTP",A="FL:::/Compiler/BackLib.CPP.Z,272"$
|
||||
$LK,"SLASH_OP_FDIVR",A="FL:::/Compiler/BackLib.CPP.Z,263"$
|
||||
$LK,"SLASH_OP_FISTTP",A="FL:::/Compiler/BackLib.CPP.Z,266"$
|
||||
$LK,"CmpCtrlSize",A="FL:::/Compiler/Lex.CPP.Z,70",BI=216$
|
||||
$LK,"ICLocalVarInit",A="FL:::/Compiler/BackC.CPP.Z,924",BI=217$
|
||||
$LK,"PrsFor",A="FL:::/Compiler/PrsStmt.CPP.Z,526",BI=218$
|
||||
$LK,"ICLocalVarInit",A="FL:::/Compiler/BackC.CPP.Z,762",BI=217$
|
||||
$LK,"PrsFor",A="FL:::/Compiler/PrsStmt.CPP.Z,525",BI=218$
|
||||
$LK,"PassTrace",A="FL:::/Compiler/CMisc.CPP.Z,11",BI=219$
|
||||
$LK,"PrsPopDeref",A="FL:::/Compiler/PrsLib.CPP.Z,21",BI=220$
|
||||
$LK,"ICCopyTemplate",A="FL:::/Compiler/BackFA.CPP.Z,75",BI=221$
|
||||
$LK,"ICCopyTemplate",A="FL:::/Compiler/BackFA.CPP.Z,77",BI=221$
|
||||
$LK,"PrsStmt",A="FL:::/Compiler/PrsStmt.CPP.Z,900",BI=222$
|
||||
$LK,"PrsFun",A="FL:::/Compiler/PrsStmt.CPP.Z,132",BI=223$
|
||||
$LK,"LexIncludeStr",A="FL:::/Compiler/Lex.CPP.Z,298",BI=224$
|
||||
$LK,"LexIncludeStr",A="FL:::/Compiler/Lex.CPP.Z,299",BI=224$
|
||||
$LK,"PrsType",A="FL:::/Compiler/PrsVar.CPP.Z,287",BI=225$
|
||||
$LK,"CmpCtrlNew",A="FL:::/Compiler/Lex.CPP.Z,28",BI=226$
|
||||
$LK,"cmp_type_flags_src_code",A="FL:::/Compiler/Lex.CPP.Z,327"$
|
||||
$LK,"MODR_SIB_D8_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,135"$
|
||||
$LK,"cmp_type_flags_src_code",A="FL:::/Compiler/Lex.CPP.Z,328"$
|
||||
$LK,"PrsVarInit2",A="FL:::/Compiler/PrsVar.CPP.Z,123",BI=227$
|
||||
$LK,"PrsPop",A="FL:::/Compiler/PrsLib.CPP.Z,6",BI=228$
|
||||
$LK,"asm_seg_prefixes",A="FL:::/Compiler/Asm.CPP.Z,388"$
|
||||
$LK,"ICMinMax",A="FL:::/Compiler/BackC.CPP.Z,510",BI=229$
|
||||
$LK,"ICMinMax",A="FL:::/Compiler/BackC.CPP.Z,419",BI=229$
|
||||
$LK,"CmpLoadDefines",A="FL:::/Compiler/CInit.CPP.Z,205",BI=230$
|
||||
$LK,"PrsIf",A="FL:::/Compiler/PrsStmt.CPP.Z,456",BI=231$
|
||||
$LK,"ICBuiltInFloatConst",A="FL:::/Compiler/BackLib.CPP.Z,413",BI=232$
|
||||
$LK,"ICFUnaryMinus",A="FL:::/Compiler/BackFA.CPP.Z,198",BI=233$
|
||||
$LK,"LexDocRead",A="FL:::/Compiler/Lex.CPP.Z,310",BI=234$
|
||||
$LK,"PrsIf",A="FL:::/Compiler/PrsStmt.CPP.Z,455",BI=231$
|
||||
$LK,"ICBuiltInFloatConst",A="FL:::/Compiler/BackLib.CPP.Z,408",BI=232$
|
||||
$LK,"ICFUnaryMinus",A="FL:::/Compiler/BackFA.CPP.Z,194",BI=233$
|
||||
$LK,"LexDocRead",A="FL:::/Compiler/Lex.CPP.Z,311",BI=234$
|
||||
$LK,"CmpFixUpJITAsm",A="FL:::/Compiler/CMain.CPP.Z,174",BI=235$
|
||||
$LK,"COCPopNoFree",A="FL:::/Compiler/PrsLib.CPP.Z,114",BI=236$
|
||||
$LK,"ParenWarning",A="FL:::/Compiler/CExcept.CPP.Z,110",BI=237$
|
||||
$LK,"PrsFunCall",A="FL:::/Compiler/PrsExp.CPP.Z,378",BI=238$
|
||||
$LK,"ICDerefPostIncDec",A="FL:::/Compiler/BackB.CPP.Z,473",BI=239$
|
||||
$LK,"ICDerefPostIncDec",A="FL:::/Compiler/BackB.CPP.Z,384",BI=239$
|
||||
$LK,"Option",A="FL:::/Compiler/CMisc.CPP.Z,1",BI=240$
|
||||
$LK,"ExeFile2",A="FL:::/Compiler/CMain.CPP.Z,655",BI=241$
|
||||
$LK,"COptMemberVar",A="FL:::/Compiler/OptLib.CPP.Z,550"$
|
||||
$LK,"COptMemberVar",A="FL:::/Compiler/OptLib.CPP.Z,549"$
|
||||
$LK,"PE_CHECK_BINARY_OPS1",A="FL:::/Compiler/PrsExp.CPP.Z,6"$
|
||||
$LK,"PE_CHECK_BINARY_OPS2",A="FL:::/Compiler/PrsExp.CPP.Z,7"$
|
||||
$LK,"LexBackupLastChar",A="FL:::/Compiler/LexLib.CPP.Z,1",BI=242$
|
||||
$LK,"Trace",A="FL:::/Compiler/CMisc.CPP.Z,19",BI=243$
|
||||
$LK,"ICBrBitOps",A="FL:::/Compiler/BackC.CPP.Z,212",BI=244$
|
||||
$LK,"ICBrBitOps",A="FL:::/Compiler/BackC.CPP.Z,210",BI=244$
|
||||
$LK,"MODR_D32_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,133"$
|
||||
$LK,"LexGetChar",A="FL:::/Compiler/Lex.CPP.Z,107",BI=245$
|
||||
$LK,"LexSkipEol",A="FL:::/Compiler/Lex.CPP.Z,269",BI=246$
|
||||
$LK,"ICFlagBranch",A="FL:::/Compiler/BackB.CPP.Z,785",BI=247$
|
||||
$LK,"SLASH_OP_FSUBR",A="FL:::/Compiler/BackLib.CPP.Z,266"$
|
||||
$LK,"ICFPreIncDec",A="FL:::/Compiler/BackFB.CPP.Z,660",BI=248$
|
||||
$LK,"LexSkipEol",A="FL:::/Compiler/Lex.CPP.Z,270",BI=246$
|
||||
$LK,"ICFlagBranch",A="FL:::/Compiler/BackB.CPP.Z,682",BI=247$
|
||||
$LK,"SLASH_OP_FSUBR",A="FL:::/Compiler/BackLib.CPP.Z,260"$
|
||||
$LK,"ICFPreIncDec",A="FL:::/Compiler/BackFB.CPP.Z,560",BI=248$
|
||||
$LK,"MODR_SIB_INDIRECT_REG",A="FL:::/Compiler/BackLib.CPP.Z,134"$
|
||||
$LK,"ExeFile",A="FL:::/Compiler/CMain.CPP.Z,616",BI=249$
|
||||
$LK,"COCMiscNew",A="FL:::/Compiler/PrsLib.CPP.Z,143",BI=250$
|
||||
$LK,"cmp_templates_dont_pop",A="FL:::/Compiler/CExts.CPP.Z,43"$
|
||||
$LK,"CmpOffset2Reg",A="FL:::/Compiler/OptLib.CPP.Z,83",BI=251$
|
||||
$LK,"PrsFunNew",A="FL:::/Compiler/PrsLib.CPP.Z,62",BI=252$
|
||||
$LK,"StreamExePrint",A="FL:::/Compiler/CMain.CPP.Z,666",BI=253$
|
||||
$LK,"StreamExePrint",A="FL:::/Compiler/CMain.CPP.Z,665",BI=253$
|
||||
$LK,"COCGoToLabelFind",A="FL:::/Compiler/PrsLib.CPP.Z,152",BI=254$
|
||||
$LK,"OptMVCompare",A="FL:::/Compiler/OptLib.CPP.Z,556",BI=255$
|
||||
$LK,"ICToBool",A="FL:::/Compiler/BackB.CPP.Z,378",BI=256$
|
||||
$LK,"OptMVCompare",A="FL:::/Compiler/OptLib.CPP.Z,555",BI=255$
|
||||
$LK,"ICToBool",A="FL:::/Compiler/BackB.CPP.Z,289",BI=256$
|
||||
$LK,"PrsFunJoin",A="FL:::/Compiler/PrsStmt.CPP.Z,68",BI=257$
|
||||
$LK,"PrsNoUnusedWarn",A="FL:::/Compiler/PrsStmt.CPP.Z,787",BI=258$
|
||||
$LK,"OptFixSizeOf",A="FL:::/Compiler/OptLib.CPP.Z,485",BI=259$
|
||||
$LK,"OptFixSizeOf",A="FL:::/Compiler/OptLib.CPP.Z,484",BI=259$
|
||||
$LK,"cmp_templates_dont_push",A="FL:::/Compiler/CExts.CPP.Z,45"$
|
||||
$LK,"cmp_templates_dont_push_pop",A="FL:::/Compiler/CExts.CPP.Z,46"$
|
||||
$LK,"LexAttachDoc",A="FL:::/Compiler/Lex.CPP.Z,330",BI=260$
|
||||
$LK,"LexAttachDoc",A="FL:::/Compiler/Lex.CPP.Z,331",BI=260$
|
||||
$LK,"PrsStreamBlk",A="FL:::/Compiler/PrsStmt.CPP.Z,801",BI=261$
|
||||
$LK,"cmp_templates_dont_push2",A="FL:::/Compiler/CExts.CPP.Z,44"$
|
||||
$LK,"InstEntryFind",A="FL:::/Compiler/UAsm.CPP.Z,66",BI=262$
|
||||
$LK,"PrsDotDotDot",A="FL:::/Compiler/PrsVar.CPP.Z,381",BI=263$
|
||||
$LK,"ICMulEqu",A="FL:::/Compiler/BackA.CPP.Z,344",BI=264$
|
||||
$LK,"ICMulEqu",A="FL:::/Compiler/BackA.CPP.Z,322",BI=264$
|
||||
$LK,"AsmPrsInsFlags",A="FL:::/Compiler/AsmInit.CPP.Z,1",BI=265$
|
||||
| ||||