isel1.ssa 535 B

123456789101112131415161718192021222324
  1. # tests that the address matcher is not
  2. # confused by the two multiplications
  3. # note: the code handling apple asm fixes
  4. # ruins the good work of the matcher here,
  5. # I should revisit these fixes
  6. export function w $f(l %i, l %j) {
  7. @start
  8. %off1 =l mul %i, 8
  9. %a_i =l add $a, %off1
  10. %off2 =l mul %j, 4
  11. %a_ij =l add %a_i, %off2
  12. %x =w loadsw %a_ij
  13. ret %x
  14. }
  15. # >>> driver
  16. # int a[] = {1, 2, 3, 4};
  17. # extern int f(long long, long long);
  18. # int main() {
  19. # return !(f(0, 0) == 1 && f(0, 1) == 2 && f(1, 0) == 3 && f(1, 1) == 4);
  20. # }
  21. # <<<