Skip to content

Instantly share code, notes, and snippets.

@pervognsen pervognsen/do_mul.c

Last active Apr 18, 2020
Embed
What would you like to do?
// semantic analysis, called by parser
void do_mul(Value *dest, Value *src) {
promote_arith(dest, src);
if (isint(dest)) {
if (isconst2(dest, src)) {
dest->ival *= src->ival;
} else {
gen_mul(dest, src);
}
} else {
assert(isfloat(dest));
if (isconst2(dest, src)) {
dest->fval *= src->fval;
} else {
gen_fmul(dest, src);
}
}
gen_kill(src);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.