jasmin
jasmin copied to clipboard
mmx silently ignored in function argument
This program exhibits the problem.
fn f (#mmx reg u64 y) -> reg u64 {
reg u64 x;
x = 0;
return x;
}
export fn main () -> reg u64 {
reg u64 x;
x=0;
x = f(x);
return x;
}
y is compiled as RAX. This works because y is not used.
A little question here : what is the compilation pass where register used for variables are computed (I think it is reg-alloc but I would prefer to be sure) ?
Yes: the compiler step mapping variables to registers is called register allocation. However, this is unrelated to this issue: here there is a “kind” mismatch between the parameter and the argument that is silently ignored: this could be detected early by a simple check.