Quick Search:

Mode

Context

Displaying 3 lines of context. None | Less | More | Full

Other Diffs

Ignore

Blank Lines Whitespace: Expand:

Diff

1.29
 
1.30
 
MAIN:ragge:20101108193430
 
local2.c
_>10141014 int
 10151015 myxasm(struct interpass *ip, NODE *p)
 10161016 {
<>1017 -        return 0;
 1018 -#if 0
10191017         struct interpass *ip2;
<> 1018+        int Cmax[] = { 31, 63, 127, 0xffff, 3, 255 };
10201019         NODE *in = 0, *ut = 0;
 10211020         TWORD t;
 10221021         char *w;
 10231022         int reg;
<>1024 -        int cw;
  1023+        int c, cw, v;
10251024 
 10261025         cw = xasmcode(p->n_name);
 10271026         if (cw & (XASMASG|XASMINOUT))
     
 !
10301029                 in = p->n_left;
 10311030 
 10321031         switch (XASMVAL(cw)) {
<>1033 -        case 'D': reg = EDI; break;
 1034 -        case 'S': reg = ESI; break;
 1035 -        case 'a': reg = EAX; break;
 1036 -        case 'b': reg = EBX; break;
 1037 -        case 'c': reg = ECX; break;
 1038 -        case 'd': reg = EDX; break;
 1039 -        case 't': reg = 0; break;
 1040 -        case 'u': reg = 1; break;
 1041 -        case 'A': reg = EAXEDX; break;
 1042 -        case 'q': /* XXX let it be CLASSA as for now */
  1032+        case 'D': reg = RDI; break;
  1033+        case 'S': reg = RSI; break;
  1034+        case 'a': reg = RAX; break;
  1035+        case 'b': reg = RBX; break;
  1036+        case 'c': reg = RCX; break;
  1037+        case 'd': reg = RDX; break;
  1038+
  1039+        case 't':
  1040+        case 'u':
10431041                 p->n_name = tmpstrdup(p->n_name);
<>1044 -                w = strchr(p->n_name, 'q');
 1045 -                *w = 'r';
 1046 -                return 0;
  1042+                w = strchr(p->n_name, XASMVAL(cw));
  1043+                *w = 'r'; /* now reg */
  1044+                return 1;
  1045+
  1046+        case 'A':
  1047+                uerror("unsupported xasm constraint 'A'");
  1048+
  1049+        case 'q': /* Handle in MYSETXARG */
  1050+                return 1;
  1051+
  1052+        case 'I':
  1053+        case 'J':
  1054+        case 'K':
  1055+        case 'L':
  1056+        case 'M':
  1057+        case 'N':
  1058+                if (p->n_left->n_op != ICON)
  1059+                        uerror("xasm arg not constant");
  1060+                v = p->n_left->n_lval;
  1061+                if ((c == 'K' && v < -128) ||
  1062+                    (c == 'L' && v != 0xff && v != 0xffff) ||
  1063+                    (c != 'K' && v < 0) ||
  1064+                    (v > Cmax[c-'I']))
  1065+                        uerror("xasm val out of range");
  1066+                p->n_name = "i";
  1067+                return 1;
  1068+
10471069         default:
 10481070                 return 0;
 10491071         }
     
 !
10521074                 ;
 10531075         w[-1] = 'r'; /* now reg */
 10541076         t = p->n_left->n_type;
<>1055 -        if (reg == EAXEDX) {
  1077+
  1078+        if (t == FLOAT || t == DOUBLE) {
  1079+                p->n_label = CLASSB;
  1080+                reg += 16;
  1081+        } else if (t == LDOUBLE) {
10561082                 p->n_label = CLASSC;
<>1057 -        } else {
  1083+                reg += 32;
  1084+        } else
10581085                 p->n_label = CLASSA;
<>1059 -                if (t == CHAR || t == UCHAR) {
 1060 -                        p->n_label = CLASSB;
 1061 -                        reg = reg * 2 + 8;
 1062 -                }
 1063 -        }
 1064 -        if (t == FLOAT || t == DOUBLE || t == LDOUBLE) {
 1065 -                p->n_label = CLASSD;
 1066 -                reg += 037;
 1067 -        }
10681086 
 10691087         if (in && ut)
 10701088                 in = tcopy(in);
     
 !
10771095                 ip2 = ipnode(mkbinode(ASSIGN, tcopy(p->n_left), in, t));
 10781096                 DLIST_INSERT_BEFORE(ip, ip2, qelem);
 10791097         }
<>1080 -#endif
  1098+
<_10811099         return 1;
 10821100 }
 10831101 
FishEye: Open Source License registered to PCC.
Your maintenance has expired. You can renew your license at http://www.atlassian.com/fisheye/renew
Atlassian FishEye, CVS analysis. (Version:1.6.3 Build:build-336 2008-11-04) - Administration - Page generated 2014-09-23 22:24 +0200