jasmin icon indicating copy to clipboard operation
jasmin copied to clipboard

mmx silently ignored in function argument

Open eponier opened this issue 2 years ago • 2 comments

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.

eponier avatar Nov 21 '23 13:11 eponier

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) ?

MrDaiki avatar Apr 22 '25 08:04 MrDaiki

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.

vbgl avatar Apr 23 '25 07:04 vbgl