History

added % constraint

bellard committed 23 years ago

Commit 68c80091 parent a901c5f1 file · +10 −4Browse files

Unified · Split

i386-asm.c+10−4
@@ -745,6 +745,13 @@ static inline int constraint_priority(const char *str) · 744 unmodified lines
745745 return priority;
746746 }
747747
748+static const char *skip_constraint_modifiers(const char *p)
749+{
750+ while (*p == '=' || *p == '&' || *p == '+' || *p == '%')
751+ p++;
752+ return p;
753+}
754+
748755 static void asm_compute_constraints(uint8_t *regs_allocated,
749756 ASMOperand *operands,
750757 int nb_operands1, int nb_outputs,
@@ -772,6 +779,7 @@ static void asm_compute_constraints(uint8_t *regs_allocated, · 21 unmodified lines
772779 str = op->constraint;
773780 op->ref_index = -1;
774781 op->reg = -1;
782+ str = skip_constraint_modifiers(str);
775783 if (!is_output && (isnum(*str) || *str == '[')) {
776784 /* this is a reference to another constraint */
777785 k = find_constraint(operands, nb_operands1, str, NULL);
@@ -780,9 +788,8 @@ static void asm_compute_constraints(uint8_t *regs_allocated, · 2 unmodified lines
780788 j, str);
781789 op->ref_index = k;
782790 str = operands[k].constraint;
791+ str = skip_constraint_modifiers(str);
783792 }
784− while (*str == '=' || *str == '&' || *str == '+')
785− str++;
786793 op->priority = constraint_priority(str);
787794 }
788795
@@ -815,8 +822,7 @@ static void asm_compute_constraints(uint8_t *regs_allocated, · 26 unmodified lines
815822 str = operands[op->ref_index].constraint;
816823 }
817824
818− while (*str == '=' || *str == '&' || *str == '+')
819− str++;
825+ str = skip_constraint_modifiers(str);
820826 try_next:
821827 c = *str++;
822828 switch(c) {