mirror of
https://github.com/frida/tinycc
synced 2024-12-25 14:36:49 +03:00
added % constraint
This commit is contained in:
parent
a901c5f204
commit
68c800981e
14
i386-asm.c
14
i386-asm.c
@ -745,6 +745,13 @@ static inline int constraint_priority(const char *str)
|
|||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static const char *skip_constraint_modifiers(const char *p)
|
||||||
|
{
|
||||||
|
while (*p == '=' || *p == '&' || *p == '+' || *p == '%')
|
||||||
|
p++;
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
static void asm_compute_constraints(uint8_t *regs_allocated,
|
static void asm_compute_constraints(uint8_t *regs_allocated,
|
||||||
ASMOperand *operands,
|
ASMOperand *operands,
|
||||||
int nb_operands1, int nb_outputs,
|
int nb_operands1, int nb_outputs,
|
||||||
@ -772,6 +779,7 @@ static void asm_compute_constraints(uint8_t *regs_allocated,
|
|||||||
str = op->constraint;
|
str = op->constraint;
|
||||||
op->ref_index = -1;
|
op->ref_index = -1;
|
||||||
op->reg = -1;
|
op->reg = -1;
|
||||||
|
str = skip_constraint_modifiers(str);
|
||||||
if (!is_output && (isnum(*str) || *str == '[')) {
|
if (!is_output && (isnum(*str) || *str == '[')) {
|
||||||
/* this is a reference to another constraint */
|
/* this is a reference to another constraint */
|
||||||
k = find_constraint(operands, nb_operands1, str, NULL);
|
k = find_constraint(operands, nb_operands1, str, NULL);
|
||||||
@ -780,9 +788,8 @@ static void asm_compute_constraints(uint8_t *regs_allocated,
|
|||||||
j, str);
|
j, str);
|
||||||
op->ref_index = k;
|
op->ref_index = k;
|
||||||
str = operands[k].constraint;
|
str = operands[k].constraint;
|
||||||
|
str = skip_constraint_modifiers(str);
|
||||||
}
|
}
|
||||||
while (*str == '=' || *str == '&' || *str == '+')
|
|
||||||
str++;
|
|
||||||
op->priority = constraint_priority(str);
|
op->priority = constraint_priority(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -815,8 +822,7 @@ static void asm_compute_constraints(uint8_t *regs_allocated,
|
|||||||
str = operands[op->ref_index].constraint;
|
str = operands[op->ref_index].constraint;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (*str == '=' || *str == '&' || *str == '+')
|
str = skip_constraint_modifiers(str);
|
||||||
str++;
|
|
||||||
try_next:
|
try_next:
|
||||||
c = *str++;
|
c = *str++;
|
||||||
switch(c) {
|
switch(c) {
|
||||||
|
Loading…
Reference in New Issue
Block a user