Reformat BackLib.CC

This commit is contained in:
TomAwezome 2020-07-24 18:50:18 -05:00 committed by VoidNV
parent 7e61c50954
commit 4fc49522b0
3 changed files with 531 additions and 442 deletions

View file

@ -60,36 +60,43 @@ U0 ICAddRSP(CIntermediateCode *tmpi,I64 i,Bool optimize=TRUE)
{
I64 j, last_start;
CIntermediateCode *tmpil1;
if (optimize) {
if (optimize)
{
tmpil1 = tmpi;
if (tmpi->ic_last_start<0 && !tmpi->ic_count &&
(tmpil1=OptLag1(tmpi)) && tmpil1->ic_last_start<0)
if (tmpi->ic_last_start < 0 && !tmpi->ic_count && (tmpil1 = OptLag1(tmpi)) && tmpil1->ic_last_start < 0)
tmpil1 = NULL;
if (tmpil1) {
if (tmpil1)
{
j = tmpil1->ic_count;
if (tmpil1->ic_last_start==j-4 && tmpil1->ic_body[j-3]==0x83 &&
tmpil1->ic_body[j-4]==0x48) {
if (tmpil1->ic_last_start == j - 4 && tmpil1->ic_body[j - 3] == 0x83 && tmpil1->ic_body[j - 4] == 0x48)
{
if (tmpil1->ic_body[j - 2] == 0xEC)
j = -tmpil1->ic_body[j - 1](I8);
else if (tmpil1->ic_body[j - 2] == 0xC4)
j = tmpil1->ic_body[j - 1](I8);
else
j = 0;
} else if (tmpil1->ic_last_start==j-7 && tmpil1->ic_body[j-6]==0x81 &&
tmpil1->ic_body[j-7]==0x48) {
}
else if (tmpil1->ic_last_start == j - 7 && tmpil1->ic_body[j - 6] == 0x81 && tmpil1->ic_body[j - 7] == 0x48)
{
if (tmpil1->ic_body[j - 5] == 0xEC)
j = -tmpil1->ic_body[j - 4](I32);
else if (tmpil1->ic_body[j - 5] == 0xC4)
j = tmpil1->ic_body[j - 4](I32);
else
j = 0;
} else
}
else
j = 0;
if (j) {
if (tmpi==tmpil1) {
if (j)
{
if (tmpi == tmpil1)
{
tmpi->ic_count = tmpi->ic_last_start;
i += j;
} else if (!(tmpi->ic_flags&ICF_PREV_DELETED)) {
}
else if (!(tmpi->ic_flags & ICF_PREV_DELETED))
{
tmpil1->ic_flags |= ICF_DEL_PREV_INS;
tmpi->ic_flags = tmpi->ic_flags & ~ICF_CODE_FINAL|ICF_PREV_DELETED;
i += j;
@ -98,30 +105,36 @@ U0 ICAddRSP(CIntermediateCode *tmpi,I64 i,Bool optimize=TRUE)
}
}
last_start = tmpi->ic_count;
if (i>0) {
if (i > 0)
{
if (i <= I8_MAX)
ICU32(tmpi, 0xC48348 + i << 24);
else if (i<=I32_MAX) {
else if (i <= I32_MAX)
{
ICU24(tmpi, 0xC48148);
ICU32(tmpi, i);
} else
}
else
throw('Compiler');
} else if (i<0) {
}
else if (i < 0)
{
i = -i;
if (i <= I8_MAX)
ICU32(tmpi, 0xEC8348 + i << 24);
else if (i<=I32_MAX) {
else if (i <= I32_MAX)
{
ICU24(tmpi, 0xEC8148);
ICU32(tmpi, i);
} else
}
else
throw('Compiler');
}
if (optimize && tmpi->ic_count > last_start)
tmpi->ic_last_start = last_start;
}
extern U0 ICMov(CIntermediateCode *tmpi,
CICType t1,I64 r1,I64 d1,CICType t2,I64 r2,I64 d2,I64 rip);
extern U0 ICMov(CIntermediateCode *tmpi, CICType t1, I64 r1, I64 d1, CICType t2, I64 r2, I64 d2, I64 rip);
#define MODR_REG 0
#define MODR_INDIRECT_REG 1
@ -143,11 +156,13 @@ I64 ICModr1(I64 r,CICType t2,I64 r2,I64 d2)
res.u8[1] = 0x40;
else
res.u8[1] = 0x48;
if (r>7) {
if (r > 7)
{
res.u8[1] += 4;
r &= 7;
}
switch (Bsr(t2)) {
switch (Bsr(t2))
{
case MDf_REG:
if (r2 > 7) {
res.u8[1]++;
@ -159,17 +174,23 @@ I64 ICModr1(I64 r,CICType t2,I64 r2,I64 d2)
res.u8[1] = 0;
break;
case MDf_DISP:
if (r2>7) {
if (r2 > 7)
{
res.u8[1]++;
r2 &= 7;
}
if (!d2 && r2!=REG_RBP) {
if (!d2 && r2 != REG_RBP)
{
res.u8[2] = r << 3 + r2;
res.u8[0] = MODR_INDIRECT_REG;
} else if (I8_MIN<=d2<=I8_MAX) {
}
else if (I8_MIN <= d2 <= I8_MAX)
{
res.u8[2] = 0x40 + r << 3 + r2;
res.u8[0] = MODR_D8_INDIRECT_REG;
} else {
}
else
{
res.u8[2] = 0x80 + r << 3 + r2;
res.u8[0] = MODR_D32_INDIRECT_REG;
}
@ -181,19 +202,27 @@ I64 ICModr1(I64 r,CICType t2,I64 r2,I64 d2)
res.u8[1]++;
if (r2.u8[1] & 15 > 7)
res.u8[1] += 2;
if (r2.u8[0]==REG_NONE) {
if (r2.u8[0] == REG_NONE)
{
res.u8[3] = 5 + (r2.u8[1] & 7) << 3 + r2.u8[1] & 0xC0;
res.u8[2] = 4 + r << 3;
res.u8[0] = MODR_SIB_D32_INDIRECT_REG;
} else {
}
else
{
res.u8[3] = r2.u8[0] & 7 + (r2.u8[1] & 7) << 3 + r2.u8[1] & 0xC0;
if (!d2 && r2.u8[0]&7!=REG_RBP) {
if (!d2 && r2.u8[0] & 7 != REG_RBP)
{
res.u8[2] = 4 + r << 3;
res.u8[0] = MODR_SIB_INDIRECT_REG;
} else if (I8_MIN<=d2<=I8_MAX) {
}
else if (I8_MIN <= d2 <= I8_MAX)
{
res.u8[2] = 0x44 + r << 3;
res.u8[0] = MODR_SIB_D8_INDIRECT_REG;
} else {
}
else
{
res.u8[2] = 0x84 + r << 3;
res.u8[0] = MODR_SIB_D32_INDIRECT_REG;
}
@ -213,7 +242,8 @@ I64 ICModr1(I64 r,CICType t2,I64 r2,I64 d2)
U0 ICModr2(CIntermediateCode *tmpi, I64 i, CICType t=0, I64 d, I64 rip=0)
{
switch [i.u8[0]] {
switch [i.u8[0]]
{
case MODR_REG:
break;
case MODR_INDIRECT_REG:
@ -236,7 +266,8 @@ U0 ICModr2(CIntermediateCode *tmpi,I64 i,CICType t=0,I64 d,I64 rip=0)
ICU32(tmpi, d);
break;
case MODR_RIP_REL_IMM_U32:
switch (t.raw_type) {
switch (t.raw_type)
{
case RT_I8:
case RT_U8:
d--;
@ -285,10 +316,10 @@ U0 ICSlashOp(CIntermediateCode *tmpi,CICType t1,I64 r1,I64 d1,I64 op,I64 rip)
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 (tmpi->ic_flags&ICF_LOCK && !(t1&MDF_REG) &&
op&~7!=SLASH_OP_MOV && op!=SLASH_OP_MOV_IMM)
if (tmpi->ic_flags & ICF_LOCK && !(t1 & MDF_REG) && op & ~7 != SLASH_OP_MOV && op != SLASH_OP_MOV_IMM)
ICU8(tmpi, OC_LOCK_PREFIX);
switch (t1.raw_type) {
switch (t1.raw_type)
{
case RT_I8:
case RT_U8:
ICRex(tmpi, i.u8[1]);
@ -311,7 +342,8 @@ U0 ICSlashOp(CIntermediateCode *tmpi,CICType t1,I64 r1,I64 d1,I64 op,I64 rip)
U0 ICPush(CIntermediateCode *tmpi, CICType t1, I64 r1, I64 d1, I64 rip)
{
switch (Bsr(t1)) {
switch (Bsr(t1))
{
case MDf_REG:
if (r1 > 7)
ICU16(tmpi, 0x5049 + (r1 & 7) << 8);
@ -321,10 +353,13 @@ U0 ICPush(CIntermediateCode *tmpi,CICType t1,I64 r1,I64 d1,I64 rip)
case MDf_IMM:
if (I8_MIN <= d1 <= I8_MAX)
ICU16(tmpi, 0x6A + d1 << 8);
else if (I32_MIN<=d1<=I32_MAX) {
else if (I32_MIN <= d1 <= I32_MAX)
{
ICU8(tmpi, 0x68);
ICU32(tmpi, d1);
} else {
}
else
{
ICMov(tmpi, MDF_REG + RT_I64, REG_RBX, 0, t1, r1, d1, rip);
ICU8(tmpi, 0x50 + REG_RBX);
}
@ -334,7 +369,8 @@ U0 ICPush(CIntermediateCode *tmpi,CICType t1,I64 r1,I64 d1,I64 rip)
case MDf_DISP:
case MDf_SIB:
case MDf_RIP_DISP32:
switch (t1.raw_type) {
switch (t1.raw_type)
{
case RT_I64:
case RT_U64:
case RT_F64:
@ -350,8 +386,10 @@ U0 ICPush(CIntermediateCode *tmpi,CICType t1,I64 r1,I64 d1,I64 rip)
U0 ICPushRegs(CIntermediateCode *tmpi, I64 mask)
{
I64 i;
for (i=0;i<REG_REGS_NUM;i++) {
if (Bt(&mask,i)) {
for (i = 0; i < REG_REGS_NUM; i++)
{
if (Bt(&mask, i))
{
if (i > 7)
ICU16(tmpi, 0x5049 + (i & 7) << 8);
else
@ -362,7 +400,8 @@ U0 ICPushRegs(CIntermediateCode *tmpi,I64 mask)
U0 ICPop(CIntermediateCode *tmpi, CICType t1, I64 r1, I64 d1, I64 rip)
{
switch (Bsr(t1)) {
switch (Bsr(t1))
{
case MDf_REG:
if (r1 > 7)
ICU16(tmpi, 0x5849 + (r1 & 7) << 8);
@ -372,10 +411,12 @@ U0 ICPop(CIntermediateCode *tmpi,CICType t1,I64 r1,I64 d1,I64 rip)
case MDf_DISP:
case MDf_RIP_DISP32:
case MDf_SIB:
if (t1.raw_type<RT_I64) {
if (t1.raw_type < RT_I64)
{
ICU8(tmpi, 0x58 + REG_RBX);
ICMov(tmpi, t1, r1, d1, MDF_REG + RT_I64, REG_RBX, 0, rip);
} else
}
else
ICSlashOp(tmpi, t1, r1, d1, SLASH_OP_POP, rip);
break;
case MDf_STACK:
@ -391,8 +432,10 @@ U0 ICPop(CIntermediateCode *tmpi,CICType t1,I64 r1,I64 d1,I64 rip)
U0 ICPopRegs(CIntermediateCode *tmpi, I64 mask)
{
I64 i;
for (i=REG_REGS_NUM-1;i>=0;i--) {
if (Bt(&mask,i)) {
for (i = REG_REGS_NUM - 1; i >= 0; i--)
{
if (Bt(&mask,i))
{
if (i > 7)
ICU16(tmpi, 0x5849 + (i & 7) << 8);
else
@ -403,17 +446,20 @@ U0 ICPopRegs(CIntermediateCode *tmpi,I64 mask)
U0 ICZero(CIntermediateCode *tmpi, I64 r)
{
if (r>7) {
if (r > 7)
{
r &= 7;
ICU24(tmpi, 0xC0334D + r << 16 + r << 19);
} else
}
else
ICU16(tmpi, 0xC033 + r << 8 + r << 11);
}
U0 ICTest(CIntermediateCode *tmpi, I64 r)
{
I64 i = 0xC08548; // TEST R,R
if (r>7) {
if (r > 7)
{
i += 5;
r &= 7;
}
@ -442,19 +488,20 @@ I64 ICBuiltInFloatConst(F64 d)
return 0;
}
U0 ICMov(CIntermediateCode *tmpi,
CICType t1,I64 r1,I64 d1,CICType t2,I64 r2,I64 d2,I64 rip)
U0 ICMov(CIntermediateCode *tmpi, CICType t1, I64 r1, I64 d1, CICType t2, I64 r2, I64 d2, I64 rip)
{
I64 i,count1,count2,b1_rex,b2_rex,b1,b2,b1_modr,b2_modr,
b1_r1,b1_r2,b2_r1,b2_r2,last_start=tmpi->ic_count;
I64 i, count1, count2, b1_rex, b2_rex, b1, b2, b1_modr, b2_modr, b1_r1, b1_r2, b2_r1, b2_r2, last_start = tmpi->ic_count;
CIntermediateCode *tmpil1;
Bool old_lock = Btr(&tmpi->ic_flags, ICf_LOCK);
switch (Bsr(t1)) {
switch (Bsr(t1))
{
case MDf_REG:
if (t2&MDF_IMM) {
if (t2 & MDF_IMM)
{
if (!d2)
ICZero(tmpi, r1);
else if (0<=d2<=U8_MAX) {
else if (0 <= d2 <= U8_MAX)
{
ICZero(tmpi, r1);
if (r1 > 7)
ICU24(tmpi, d2 << 16 + (0xB0 + r1 & 7) << 8 + 0x41);
@ -462,50 +509,70 @@ U0 ICMov(CIntermediateCode *tmpi,
ICU24(tmpi, d2 << 16 + (0xB0 + r1) << 8 + 0x40);
else
ICU16(tmpi, d2 << 8 + 0xB0 + r1);
} else if (I8_MIN<=d2<0) {
if (r1>7) {
}
else if (I8_MIN <= d2 < 0)
{
if (r1 > 7)
{
r1 &= 7;
ICU24(tmpi, d2 << 16 + (0xB0 + r1) << 8 + 0x41);
ICU32(tmpi, 0xC0BE0F4D + r1 << 24 + r1 << 27);
} else {
}
else
{
if (r1 > 3)
ICU24(tmpi, d2 << 16 + (0xB0 + r1) << 8 + 0x40);
else
ICU16(tmpi, d2 << 8 + 0xB0 + r1);
ICU32(tmpi, 0xC0BE0F48 + r1 << 24 + r1 << 27);
}
} else if (0<=d2<=U32_MAX) {
if (r1>7) {
}
else if (0 <= d2 <= U32_MAX)
{
if (r1 > 7)
{
r1 &= 7;
ICU16(tmpi, (0xB8 + r1) << 8 + 0x41);
ICU32(tmpi, d2);
} else {
}
else
{
ICU8(tmpi, 0xB8 + r1);
ICU32(tmpi, d2);
}
} else if (I32_MIN<=d2<0) {
if (r1>7) {
}
else if (I32_MIN <= d2 < 0)
{
if (r1 > 7)
{
r1 &= 7;
ICU16(tmpi, (0xB8 + r1) << 8 + 0x41);
ICU32(tmpi, d2);
ICU24(tmpi, 0xC0634D + r1 << 16 + r1 << 19);
} else {
}
else
{
ICU8(tmpi, 0xB8 + r1);
ICU32(tmpi, d2);
ICU24(tmpi, 0xC06348 + r1 << 16 + r1 << 19);
}
} else {
}
else
{
i = 0xB848;
if (r1>7) {
if (r1 > 7)
{
i++;
r1 &= 7;
}
ICU16(tmpi, i + r1 << 8);
ICU64(tmpi, d2);
}
} else if (t2&MDF_STACK)
}
else if (t2 & MDF_STACK)
ICPop(tmpi, t1, r1, d1, rip);
else {
else
{
if (r1 == r2 && t2 & MDF_REG)
goto move_done;
if (t2 & MDF_REG)
@ -514,7 +581,8 @@ U0 ICMov(CIntermediateCode *tmpi,
if (t2.raw_type != RT_U32)
i |= 0x4800;
ICRex(tmpi, i.u8[1]);
switch (t2.raw_type) {
switch (t2.raw_type)
{
case RT_I8:
ICU24(tmpi, i.u8[2] << 16 + 0xBE0F);
break;
@ -550,9 +618,11 @@ U0 ICMov(CIntermediateCode *tmpi,
case MDf_DISP:
case MDf_RIP_DISP32:
case MDf_SIB:
if (t2&MDF_IMM && (t1.raw_type<RT_I64 || (I32_MIN<=d2<=I32_MAX))) {
if (t2 & MDF_IMM && (t1.raw_type < RT_I64 || (I32_MIN <= d2 <= I32_MAX)))
{
ICSlashOp(tmpi, t1, r1, d1, SLASH_OP_MOV_IMM, rip);
switch (t1.raw_type) {
switch (t1.raw_type)
{
case RT_I8:
case RT_U8:
ICU8(tmpi, d2);
@ -564,10 +634,13 @@ U0 ICMov(CIntermediateCode *tmpi,
default:
ICU32(tmpi, d2);
}
} else {
}
else
{
if (t2 & MDF_REG)
ICSlashOp(tmpi, t1, r1, d1, r2 + SLASH_OP_MOV, rip);
else {
else
{
ICMov(tmpi, MDF_REG + RT_I64, REG_RBX, 0, t2, r2, d2, rip);
ICMov(tmpi, t1, r1, d1, MDF_REG + RT_I64, REG_RBX, 0, rip);
}
@ -575,15 +648,17 @@ U0 ICMov(CIntermediateCode *tmpi,
break;
}
move_done:
if (!((t1|t2)&(MDF_STACK|MDF_RIP_DISP32))) {
if (!((t1 | t2) & (MDF_STACK | MDF_RIP_DISP32)))
{
tmpil1 = tmpi;
if (tmpi->ic_last_start<0 && (tmpil1=OptLag1(tmpi)) &&
tmpil1->ic_last_start<0)
if (tmpi->ic_last_start < 0 && (tmpil1 = OptLag1(tmpi)) && tmpil1->ic_last_start < 0)
tmpil1 = NULL;
if (tmpil1) {
if (tmpil1)
{
if (tmpil1 == tmpi)
count1 = last_start - tmpil1->ic_last_start;
else {
else
{
if (!(tmpil1->ic_flags & ICF_CODE_FINAL))
tmpi->ic_flags &= ~ICF_CODE_FINAL;
if (last_start)
@ -592,60 +667,73 @@ move_done:
count1 = tmpil1->ic_count - tmpil1->ic_last_start;
}
count2 = tmpi->ic_count - last_start;
if (count1 && count1==count2) {
if (count1 && count1 == count2)
{
b1_rex = tmpil1->ic_body[tmpil1->ic_last_start];
b2_rex = tmpi->ic_body[last_start];
if (b1_rex&0x48==0x48 && b2_rex&0x48==0x48) {
if (b1_rex & 0x48 == 0x48 && b2_rex & 0x48 == 0x48)
{
for (i = 1; i < count1; i++)
if ((b1=tmpil1->ic_body[tmpil1->ic_last_start+i])==
(b2=tmpi->ic_body[last_start+i])) {
if (i==1 && (b2==0x89 || b2==0x8B)) {
if ((b1 = tmpil1->ic_body[tmpil1->ic_last_start + i]) == (b2 = tmpi->ic_body[last_start + i]))
{
if (i == 1 && (b2 == 0x89 || b2 == 0x8B))
{
b1_modr = tmpil1->ic_body[tmpil1->ic_last_start + 2];
b1_r1 = b1_modr & 7 + Bt(&b1_rex, 0) << 3;
b1_r2 = b1_modr >> 3 & 7 + Bt(&b1_rex, 2) << 3;
b2_modr = tmpi->ic_body[last_start+2];
b2_r1 = b2_modr & 7 + Bt(&b2_rex, 0) << 3;
b2_r2 = b2_modr >> 3 & 7 + Bt(&b2_rex, 2) << 3;
if (count1==3 && b2_modr&0xC0==0xC0) {
if (count1 == 3 && b2_modr & 0xC0 == 0xC0)
{
if (b2_r1 == b2_r2)
goto move_redundant;
if (b1_modr & 0xC0 == 0xC0) {
if (b1_r1 == b2_r2 && b2_r1 == b1_r2)
goto move_redundant;
}
} else if (b1_rex!=b2_rex || b1_r1==b1_r2 || (t1|t2)&MDF_SIB)
}
else if (b1_rex != b2_rex || b1_r1 == b1_r2 || (t1 | t2) & MDF_SIB)
break;
} else if (b1_rex!=b2_rex)
}
else if (b1_rex != b2_rex)
break;
} else if (i!=1)
}
else if (i != 1)
break;
else if (b2 != 0x89 && b2 != 0x8B)
break;
else {
else
{
b1_modr = tmpil1->ic_body[tmpil1->ic_last_start + 2];
b1_r1 = b1_modr & 7 + Bt(&b1_rex, 0) << 3;
b1_r2 = b1_modr >> 3 & 7 + Bt(&b1_rex, 2) << 3;
b2_modr = tmpi->ic_body[last_start + 2];
b2_r1 = b2_modr & 7 + Bt(&b2_rex, 0) << 3;
b2_r2 = b2_modr >> 3 & 7 + Bt(&b2_rex, 2) << 3;
if (count1==3 && b2_modr&0xC0==0xC0) {
if (count1 == 3 && b2_modr & 0xC0 == 0xC0)
{
if (b2_r1 == b2_r2)
goto move_redundant;
if (b1==0x89 && b2==0x8B || b1==0x8B && b2==0x89) {
if (b1_modr&0xC0==0xC0) {
if (b1_r1==b2_r1 && b1_r2==b2_r2 ||
b1_r1==b2_r2 && b2_r1==b1_r2)
if (b1 == 0x89 && b2 == 0x8B || b1 == 0x8B && b2 == 0x89)
{
if (b1_modr & 0xC0 == 0xC0)
{
if (b1_r1 == b2_r1 && b1_r2 == b2_r2 || b1_r1 == b2_r2 && b2_r1 == b1_r2)
goto move_redundant;
}
if (b1_rex != b2_rex)
break;
} else
}
else
break;
} else if (b1_r1==b1_r2 || (t1|t2)&MDF_SIB || b1_rex!=b2_rex ||
}
else if (b1_r1 == b1_r2 || (t1 | t2) & MDF_SIB || b1_rex != b2_rex ||
!(b1 == 0x89 && b2 == 0x8B || b1 == 0x8B && b2 == 0x89))
break;
}
if (i==count1) {
if (i == count1)
{
move_redundant:
tmpi->ic_count = last_start;
}
@ -658,12 +746,12 @@ move_redundant:
BEqual(&tmpi->ic_flags, ICf_LOCK, old_lock);
}
U0 ICLea(CIntermediateCode *tmpi,CICType t1,I64 r1,I64 d1,
CICType t2,I64 r2,I64 d2,CCompCtrl *cc,U8 *buf,I64 rip)
U0 ICLea(CIntermediateCode *tmpi, CICType t1, I64 r1, I64 d1, CICType t2, I64 r2, I64 d2, CCompCtrl *cc, U8 *buf, I64 rip)
{
I64 i;
CAOTAbsAddr *tmpa;
switch (Bsr(t1)) {
switch (Bsr(t1))
{
case MDf_REG:
i = ICModr1(r1, t2, r2, d2);
i.u8[1] |= 0x48;
@ -671,10 +759,12 @@ U0 ICLea(CIntermediateCode *tmpi,CICType t1,I64 r1,I64 d1,
ICModr2(tmpi, i,, d2, rip);
break;
case MDf_STACK:
if (t2&MDF_RIP_DISP32) {
if (t2 & MDF_RIP_DISP32)
{
ICU8(tmpi, 0x68);
ICU32(tmpi, d2);
if (cc->flags&CCF_AOT_COMPILE && buf && !(cc->flags&CCF_NO_ABSS)) {
if (cc->flags & CCF_AOT_COMPILE && buf && !(cc->flags & CCF_NO_ABSS))
{
tmpa = CAlloc(sizeof(CAOTAbsAddr));
tmpa->next = cc->aotc->abss;
tmpa->type = AAT_ADD_U32;
@ -697,12 +787,10 @@ U0 ICDeref(CIntermediateCode *tmpi,I64 rip)
if (t > tmpi->arg1_type_pointed_to)
t = tmpi->arg1_type_pointed_to;
if (tmpi->arg1.type & MDF_REG)
ICMov(tmpi,tmpi->res.type,tmpi->res.reg,tmpi->res.disp,
MDF_DISP+t,tmpi->arg1.reg,tmpi->arg1.disp,rip);
else {
ICMov(tmpi,MDF_REG+RT_I64,REG_RCX,0,
tmpi->arg1.type,tmpi->arg1.reg,tmpi->arg1.disp,rip);
ICMov(tmpi,tmpi->res.type,tmpi->res.reg,tmpi->res.disp,
MDF_DISP+t,REG_RCX,0,rip);
ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_DISP + t, tmpi->arg1.reg, tmpi->arg1.disp, rip);
else
{
ICMov(tmpi, MDF_REG + RT_I64, REG_RCX, 0, tmpi->arg1.type, tmpi->arg1.reg, tmpi->arg1.disp, rip);
ICMov(tmpi, tmpi->res.type, tmpi->res.reg, tmpi->res.disp, MDF_DISP + t, REG_RCX, 0, rip);
}
}

View file

@ -46,6 +46,7 @@ StartOS.CC
BackC.CC
BackFA.CC
BackFB.CC
BackLib.CC
CExcept.CC
CExterns.CC
CHash.CC