nsrip-dd commented on issue #983:
URL: https://github.com/apache/arrow-go/issues/983#issuecomment-5332134569

   Regarding `_unpack32_neon`, I don't know if I'll have bandwidth any time 
soon to work on this, but I wanted to drop some breadcrumbs here in case 
anybody else wants to pick it up.
   
   My high-level thought is that the best approach would be to re-generate the 
assembly without using the reserved registers, then re-apply any fixups/manual 
changes that have been done since the code was first generated. I had an LLM 
take a shot at fixing the assembly in-place but I have low confidence in the 
correctness.
   
   We'd start by telling the C compiler not to use the reserved registers:
   
   ```diff
   diff --git a/parquet/internal/utils/Makefile 
b/parquet/internal/utils/Makefile
   index f6dce46197..dda1662c6b 100644
   --- a/parquet/internal/utils/Makefile
   +++ b/parquet/internal/utils/Makefile
   @@ -27,7 +27,8 @@
    ASM_FLAGS_POPCNT=-mpopcnt
   
    C_FLAGS_NEON=-O3 -fvectorize -mllvm -force-vector-width=16 
-fno-asynchronous-unwind-tables -mno-red-zone -mstackrealign -fno-exceptions \
   -       -fno-rtti -fno-builtin -ffast-math -fno-jump-tables -I_lib
   +       -fno-rtti -fno-builtin -ffast-math -fno-jump-tables -I_lib \
   +       -ffixed-x28 -ffixed-x27 -ffixed-x18
   
    GO_SOURCES  := $(shell find . -path ./_lib -prune -o -name '*.go' -not 
-name '*_test.go')
    ALL_SOURCES := $(shell find . -path ./_lib -prune -o -name '*.go' -name 
'*.s' -not -name '*_test.go')
   ```
   
   Then `make CC=clang _lib/bit_packing_neon.s` (I don't have clang-11 which is 
the default CC value; do we care about the specific clang version?). That'll 
give you the assembly from which we can build the Go assembly following the 
instructions in the parquet/internal/utils/_lib README file. Then we'd need to 
remove the frame pointer setup stuff, at the very least.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to