hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

Aarch64: emit prefix/postfix-indexed memory accesses

Open igogo-x86 opened this issue 1 month ago • 10 comments

  • teach Vgen to generate prefix and postfix indexed forms for scalar/pair memory ops
  • validate update immediates before encoding the indexed memory instructions
  • let psimplify fold plain memory accesses into the new prefix/postfix variants

igogo-x86 avatar Nov 07 '25 12:11 igogo-x86

@facebook-github-bot has imported this pull request. If you are a Meta employee, you can view this in D86516435. (Because this pull request was imported automatically, there will not be any future comments.)

meta-codesync[bot] avatar Nov 07 '25 12:11 meta-codesync[bot]

Thanks @igogo-x86 !

This one is failing with

hphp/runtime/vm/jit/vasm-simplify-arm.cpp:396:15: error: unused variable 'inst' [-Werror,-Wunused-variable]
  396 |   auto const& inst = env.unit.blocks[b].code[i];
      |               ^~~~
hphp/runtime/vm/jit/vasm-simplify-arm.cpp:415:15: error: unused variable 'inst' [-Werror,-Wunused-variable]
  415 |   auto const& inst = env.unit.blocks[b].code[i];
      |               ^~~~
2 errors generated.

meteorfox avatar Nov 10 '25 22:11 meteorfox

@igogo-x86 has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot avatar Nov 11 '25 10:11 facebook-github-bot

Fixed!

igogo-x86 avatar Nov 11 '25 10:11 igogo-x86

New error

Stderr:
fbcode/hphp/runtime/vm/jit/vasm-info.cpp:159:11: error: 44 enumeration values not handled in switch: 'loadpri', 'loadpi', 'loadbpri'... [-Werror,-Wswitch]
  159 |   switch (inst.op) {
      |           ^~~~~~~
1 error generated.

meteorfox avatar Nov 13 '25 11:11 meteorfox

@igogo-x86 has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot avatar Nov 13 '25 13:11 facebook-github-bot

Hey @igogo-x86 , now fails to compile with this error

Stderr:
fbcode/hphp/runtime/vm/jit/vasm-instr.cpp:94:11: error: 44 enumeration values not handled in switch: 'loadpri', 'loadpi', 'loadbpri'... [-Werror,-Wswitch]
   94 |   switch (op) {
      |           ^~
1 error generated.

meteorfox avatar Nov 24 '25 19:11 meteorfox

@igogo-x86 has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot avatar Nov 26 '25 11:11 facebook-github-bot

I've got another compilation error

fbcode/hphp/runtime/vm/jit/vasm-instr.cpp:391:5: error: no member named 'loadzlqpri' in 'HPHP::jit::Vinstr'
  391 |     CASE_WITH_UPDATES(loadzlq)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
fbcode/hphp/runtime/vm/jit/vasm-instr.cpp:97:18: note: expanded from macro 'CASE_WITH_UPDATES'
   97 |     case Vinstr::name##pri:                     \
      |          ~~~~~~~~^
<scratch space>:302:1: note: expanded from here
  302 | loadzlqpri
      | ^
fbcode/hphp/runtime/vm/jit/vasm-instr.cpp:391:5: error: no member named 'loadzlqpi' in 'HPHP::jit::Vinstr'
  391 |     CASE_WITH_UPDATES(loadzlq)
      |     ^~~~~~~~~~~~~~~~~~~~~~~~~~
fbcode/hphp/runtime/vm/jit/vasm-instr.cpp:98:18: note: expanded from macro 'CASE_WITH_UPDATES'
   98 |     case Vinstr::name##pi:
      |          ~~~~~~~~^
<scratch space>:303:1: note: expanded from here
  303 | loadzlqpi
      | ^
2 errors generated.

meteorfox avatar Dec 02 '25 22:12 meteorfox

@igogo-x86 has updated the pull request. You must reimport the pull request before landing.

facebook-github-bot avatar Dec 03 '25 14:12 facebook-github-bot