pkgsrc-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
(lang/php56) with aarch64
lang/php56 issue:
http://victory.netbsd.org/pkgsrc/packages/reports/2026Q2/evbarm64-11.0/20260805.0057/php56-5.6.40nb5/build.log
I've traced a little bit:
1.
Add following line at (pkgsrc) Makefile
MAKE_JOBS_SAVE= no
2.
The last line after the make was:
/bin/sh /tmp/lang/php56/work/php-5.6.40/libtool --silent
--preserve-dup-deps --mode=compile gcc -IZend/
-I/tmp/lang/php56/work/php-5.6.40/Zend/ -DPHP_ATOM_INC
-I/tmp/lang/php56/work/php-5.6.40/include
-I/tmp/lang/php56/work/php-5.6.40/main
-I/tmp/lang/php56/work/php-5.6.40
-I/tmp/lang/php56/work/php-5.6.40/ext/date/lib
-I/usr/pkg/include/libxml2 -I/tmp/lang/php56/work/php-5.6.40/TSRM
-I/tmp/lang/php56/work/php-5.6.40/Zend -I/usr/pkg/include/libxml2
-I/usr/include -I/usr/pkg/include -O2
-Wno-error=incompatible-pointer-types -Wno-error=int-conversion
-pthread -I/usr/pkg/include/libxml2 -I/usr/include -c
/tmp/lang/php56/work/php-5.6.40/Zend/zend_operators.c -o
Zend/zend_operators.lo
/tmp//ccAx5uwZ.s: Assembler messages:
/tmp//ccAx5uwZ.s:3623: Error: expected an integer or zero register at operand 2 -- `mul x1,v31,v30'
/tmp//ccAx5uwZ.s:3624: Error: expected an integer or zero register at operand 2 -- `smulh x0,v31,v30'
/tmp//ccAx5uwZ.s:4057: Error: expected an integer or zero register at operand 2 -- `mul x1,v14,v0'
/tmp//ccAx5uwZ.s:4058: Error: expected an integer or zero register at operand 2 -- `smulh x2,v14,v0'
/tmp//ccAx5uwZ.s:4163: Error: expected an integer or zero register at operand 2 -- `mul x2,v0,v0'
/tmp//ccAx5uwZ.s:4164: Error: expected an integer or zero register at operand 2 -- `smulh x1,v0,v0'
3.
Try with -S option for gcc (14.3.0)
rock5@makoto 07:44:53/260829(..work/php-5.6.40)% /bin/sh
/tmp/lang/php56/work/php-5.6.40/libtool --silent --preserve-dup-deps
--mode=compile gcc -IZend/ -I/tmp/lang/php56/work/php-5.6.40/Zend/
-DPHP_ATOM_INC -I/tmp/lang/php56/work/php-5.6.40/include
-I/tmp/lang/php56/work/php-5.6.40/main
-I/tmp/lang/php56/work/php-5.6.40
-I/tmp/lang/php56/work/php-5.6.40/ext/date/lib
-I/usr/pkg/include/libxml2 -I/tmp/lang/php56/work/php-5.6.40/TSRM
-I/tmp/lang/php56/work/php-5.6.40/Zend -I/usr/pkg/include/libxml2
-I/usr/include -I/usr/pkg/include -O2
-Wno-error=incompatible-pointer-types -Wno-error=int-conversion
-pthread -I/usr/pkg/include/libxml2 -I/usr/include -S -c
/tmp/lang/php56/work/php-5.6.40/Zend/zend_operators.c r
4. the resultant asssembly lines (sorry the file name (suffix) was wrong)
rock5@makoto 07:44:39/260829(..work/php-5.6.40)% grep -2n v30 zend_operators.o
3208- sub d29, d31, d30
3209- fmov x0, d29
3210: eor v29.8b, v31.8b, v30.8b
3211- fmov x2, d29
3212- eor x1, x1, x0
--
3621- // Start of user assembly
3622-// 933 "/tmp/lang/php56/work/php-5.6.40/Zend/zend_operators.c" 1
3623: mul x1, v31, v30
3624:smulh x0, v31, v30
3625-sub x0, x0, x1, asr #63
3626-
5. the original c code would be:
928 while (1) {
929 switch (TYPE_PAIR(Z_TYPE_P(op1), Z_TYPE_P(op2))) {
930 case TYPE_PAIR(IS_LONG, IS_LONG): {
931 long overflow;
932
> 933 ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1),Z_LVAL_P(op2), Z_LVAL_P(result),Z_DVAL_P(result),overflow);
934 Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_LONG;
935 return SUCCESS;
936
937 }
6.
cat -n ./Zend/zend_multiply.h
58 #elif defined(__aarch64__) && defined(__GNUC__)
59
60 #define ZEND_SIGNED_MULTIPLY_LONG(a, b, lval, dval, usedval) do { \
61 long __tmpvar; \
62 __asm__("mul %0, %2, %3\n" \
63 "smulh %1, %2, %3\n" \
64 "sub %1, %1, %0, asr #63\n" \
65 : "=X"(__tmpvar), "=X"(usedval) \
66 : "X"(a), "X"(b)); \
67 if (usedval) (dval) = (double) (a) * (double) (b); \
68 else (lval) = __tmpvar; \
69 } while (0)
(that' all so far, sorry)
--
Makoto Fujiwara
mef%NetBSD.org@localhost
makoto%if.t.u-tokyo.ac.jp@localhost
Home |
Main Index |
Thread Index |
Old Index