zherczeg / sljit

Platform independent low-level JIT compiler
Other
825 stars 73 forks source link

arm: incomplete support for ARMv6 systems #188

Open carenas opened 1 year ago

carenas commented 1 year ago

as shown when building in Debian 12 using the gcc-12-arm-linux-gnueabi cross compiler and testing with qemu-user-static (not a Debian issue, but attempting to reflect what is likely happenning with at least Rasperry PI):

$ make -j CC='arm-linux-gnueabi-gcc-12 -static -march=armv6k'
$ qemu-arm-static -cpu arm1176 bin/sljit_test -v
Run executable allocator test
Run test1
Run test2
Run test3
Run test4
Run test5
Run test6
Run test7
Run test8
Run test9
Run test10
Run test11
Run test12
Run test13
Run test14
Run test15
Run test16
Run test17
Run test18
Run test19
Run test20
Run test21
Run test22
Run test23
Run test24
Run test26
Run test27
Run test28
Run test29
Run test30
Run test31
Run test32
Run test33
Run test34
Run test35
Run test36
Run test37
Run test38
Run test39
Run test40
Run test41
Run test42
Run test43
Run test44
Run test45
Run test46
Run test47
Run test48
Run test49
Run test50
Run test51
Run test52
Run test53
Run test54
Run test55
Run test56
Run test57
Run test58
Run test59
Run test60
Run test61
Run test62
Run test63
Run test64
Run test65
Run test66
Run test67
Run test68
Run test69
Run test70
Run test71
Run test72
Run test73
Run test74
Run test75
Run test76
Run test77
Run test78
Run test79
Run test80
Run test81
Run test82
Run test83
Run test84
Run test85
Run test86
Run test87
Run test88
Run test89
Run test90
Run test91
Run test92
Run test93
Illegal instruction (core dumped)

Partially addressed by #187 (note that RBIT is optional in armv6, so there might be still issues yet to be reported), but still missing fixes for test93 (which requires VFP3[1] for VMOV immediate) and with an implicit base of armv6k for atomics[2]

[1] https://developer.arm.com/documentation/ddi0406/c/Application-Level-Architecture/Advanced-SIMD-and-Floating-point-Instruction-Encoding/Floating-point-data-processing-instructions [2] https://developer.arm.com/documentation/ddi0301/h/summary-of-arm1136jf-s-and-arm1176jzf-s-processor-differences/summary-of-differences/armv6k-extensions-support

carenas commented 1 year ago

RBIT seems to be available for ARMv7 and ARMv6 with Thumb2, but test79 case 21 failed with soft-float ABI in Thumb2, althought that might be an independent issue as it is likely also affecting armv7 and might be triggered by -mfloat-abi=soft

zherczeg commented 12 months ago

Is this still incomplete?

carenas commented 12 months ago

Is this still incomplete?

yes; armv6k is the minimum (so not all armv6 systems will work), and specifically haven't been able to either confirm or deny if the original Raspberry PI is no longer supported (by PCRE2) because of that.

there is also the issue of NEON not being mandatory for all armv7 systems and that could be considered also a related issue, although only if you require FPU or SIMD support. For PCRE2, this is likely a non-issue since only SIMD is needed and is only supported for armv8 (really aarch64 only) where NEON support is mandatory.

carenas commented 9 months ago

FWIW; thanks[1] to the NetBSD community, we know next release of PCRE2 is most likely going to work fine (at least in NetBSD 10) for the most common RaspberryPI that use armv6 CPUs.

Still. it might be a good idea to keep this open (as there are other systems than RaspberryPI that are also likely affected) and of course make sure to mention the deprecation of older than Armv6 CPUs with the possibility it might affect Armv6 and a link here in the release notes of PCRE2 10.43.

[1] https://mail-index.netbsd.org/port-arm/2023/11/29/msg008444.html