History

added 'A' asm constraint

bellard committed 23 years ago

Commit 4149fed1 parent 6e197e31 file · +30 −5Browse files

Unified · Split

i386-asm.c+30−5
@@ -710,27 +710,30 @@ static inline int constraint_priority(const char *str) · 709 unmodified lines
710 break;710 break;
711 str++;711 str++;
712 switch(c) {712 switch(c) {
713 case 'A':
714 pr = 0;
715 break;
713 case 'a':716 case 'a':
714 case 'b':717 case 'b':
715 case 'c':718 case 'c':
716 case 'd':719 case 'd':
717 case 'S':720 case 'S':
718 case 'D':721 case 'D':
719 pr = 0;
720 break;
721 case 'q':
722 pr = 1;722 pr = 1;
723 break;723 break;
724 case 'r':724 case 'q':
725 pr = 2;725 pr = 2;
726 break;726 break;
727 case 'r':
728 pr = 3;
729 break;
727 case 'N':730 case 'N':
728 case 'M':731 case 'M':
729 case 'I':732 case 'I':
730 case 'i':733 case 'i':
731 case 'm':734 case 'm':
732 case 'g':735 case 'g':
733 pr = 3;736 pr = 4;
734 break;737 break;
735 default:738 default:
736 error("unknown constraint '%c'", c);739 error("unknown constraint '%c'", c);
@@ -817,6 +820,15 @@ static void asm_compute_constraints(uint8_t *regs_allocated, · 80 unmodified lines
817 try_next:820 try_next:
818 c = *str++;821 c = *str++;
819 switch(c) {822 switch(c) {
823 case 'A':
824 /* allocate both eax and edx */
825 if (regs_allocated[TREG_EAX] || regs_allocated[TREG_EDX])
826 goto try_next;
827 op->is_llong = 1;
828 op->reg = TREG_EAX;
829 regs_allocated[TREG_EAX] = 1;
830 regs_allocated[TREG_EDX] = 1;
831 break;
820 case 'a':832 case 'a':
821 reg = TREG_EAX;833 reg = TREG_EAX;
822 goto alloc_reg;834 goto alloc_reg;
@@ -854,6 +866,7 @@ static void asm_compute_constraints(uint8_t *regs_allocated, · 31 unmodified lines
854 goto try_next;866 goto try_next;
855 reg_found:867 reg_found:
856 /* now we can reload in the register */868 /* now we can reload in the register */
869 op->is_llong = 0;
857 op->reg = reg;870 op->reg = reg;
858 regs_allocated[reg] = 1;871 regs_allocated[reg] = 1;
859 break;872 break;
@@ -1027,6 +1040,12 @@ static void asm_gen_code(ASMOperand *operands, int nb_operands, · 167 unmodified lines
1027 op = &operands[i];1040 op = &operands[i];
1028 if (op->reg >= 0) {1041 if (op->reg >= 0) {
1029 load(op->reg, op->vt);1042 load(op->reg, op->vt);
1043 if (op->is_llong) {
1044 SValue sv;
1045 sv = *op->vt;
1046 sv.c.ul += 4;
1047 load(TREG_EDX, &sv);
1048 }
1030 }1049 }
1031 }1050 }
1032 /* generate load code for output memory references */1051 /* generate load code for output memory references */
@@ -1045,6 +1064,12 @@ static void asm_gen_code(ASMOperand *operands, int nb_operands, · 12 unmodified lines
1045 op = &operands[i];1064 op = &operands[i];
1046 if (op->reg >= 0 && ((op->vt->r & VT_VALMASK) != VT_LLOCAL)) {1065 if (op->reg >= 0 && ((op->vt->r & VT_VALMASK) != VT_LLOCAL)) {
1047 store(op->reg, op->vt);1066 store(op->reg, op->vt);
1067 if (op->is_llong) {
1068 SValue sv;
1069 sv = *op->vt;
1070 sv.c.ul += 4;
1071 store(TREG_EDX, &sv);
1072 }
1048 }1073 }
1049 }1074 }
1050 /* generate reg restore code */1075 /* generate reg restore code */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t