jc-kynesim / rpi-ffmpeg

FFmpeg work for RPI
Other
107 stars 25 forks source link

Assembly errors regarding SXTX when building with clang #81

Open chewi opened 5 months ago

chewi commented 5 months ago

Building with clang results in the following assembly errors regarding SXTX:

clang --target=aarch64-unknown-linux-gnu --gcc-install-dir=/usr/lib/gcc/aarch64-unknown-linux-gnu/13 -I. -Isrc/ -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -DZLIB_CONST -fPIC -Qunused-arguments  -MMD -MF libswscale/aarch64/rgb2rgb_neon.d -MT libswscale/aarch64/rgb2rgb_neon.o -c -o libswscale/aarch64/rgb2rgb_neon.o src/libswscale/aarch64/rgb2rgb_neon.S

src/libswscale/aarch64/rgb2rgb_neon.S:342:25: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
        add x1, x1, w6, SXTX
                        ^
src/libswscale/aarch64/rgb2rgb_neon.S:427:26: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
        add x0, x0, w14, SXTX
                         ^
src/libswscale/aarch64/rgb2rgb_neon.S:428:25: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
        add x1, x1, w6, SXTX
                        ^
src/libswscale/aarch64/rgb2rgb_neon.S:429:25: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
        add x2, x2, w7, SXTX
                        ^
src/libswscale/aarch64/rgb2rgb_neon.S:430:25: error: expected '[su]xt[bhw]' with optional integer in range [0, 4]
        add x3, x3, w7, SXTX

I have tried my best to figure this out, but assembly isn't my area. As far as I can tell, LLVM does support SXTX, but it possibly does not think it is valid in this context. Changing it to SXTW allows it to build. This discussion suggests it doesn't do anything anyway, or does the same thing as SXTW? I found it difficult to follow. I wonder whether this snippet from LLVM is related.

jc-kynesim commented 5 months ago

Good point - should have been sxtw throughout. Fixed.