Thanks.  That fixed the I. issue.

Only gdll_df remains an issue.
The test actually passes for all doubles.
Before the first issue with fff, there are ddd and dddd and others that passes 
the test, so I guess the abi is OK?
With the fff call, I tried to print out from the tsdll.c

118 /* float _stdcall fff(float  f0, float  f1){return f0+f1;} */
119 float _stdcall fff(float  f0, float  f1){
120     float f[2]={1.5,2.5};
121     printf("sizeof(float)=%d  sizeof(I)=%d  sizeof(int)=%d\n", 
sizeof(float), sizeof(I), sizeof(int));
122     printf("1.5: %08x %f\n", *(int*)&f[0], f[0]);
123     printf("2.5: %08x %f\n", *(int*)&f[1], f[1]);
124     printf("f0: %08x %f\n", *(int*)&f0, f0);
125     printf("f1: %08x %f\n", *(int*)&f1, f1);
126     float r=f0+f1;
127     printf("f0+f1: %f\n", r);
128     return r;}

and I got from running the test
   (3.3;1.1;2.2    )= 'ddd d d d' dcd 1.1;2.2
1 1 1
   (6.6;1.1;2.2;3.3)= 'dddd d d d d' dcd 1.1;2.2;3.3
1 1 1 1
   (4;1.5;2.5)= 'fff f f f' dcd 1.5;2.5
sizeof(float)=4  sizeof(I)=8  sizeof(int)=4
1.5: 3fc00000 1.500000
2.5: 40200000 2.500000
f0: 3e000000 0.125000
f1: 41000000 8.000000
f0+f1: 8.125000
0 1 1

It seems that something is passed but not interpreted correctly.
Which function in x15.c is responsible?

For pcre regex, I have

   2!:0'locate libpcreposix.so'
/usr/lib64/libpcreposix.so
/usr/lib64/libpcreposix.so.0
/usr/lib64/libpcreposix.so.0.0.0

   '/usr/lib64/libpcreposix.so pcreposix_regcomp + i *x *c i'&(15!:0) (3$2-2); 
(,'a'); 2+RX_OPTIONS_UTF8_jregex_*16b40
|domain error
|       '/usr/lib64/libpcreposix.so pcreposix_regcomp + i *x *c 
i'&(15!:0)(3$2-2);(,'a');2+RX_OPTIONS_UTF8_jregex_*64
   cder''
2 0
   '/usr/lib64/libpcreposix.so regcomp + i *x *c i'&(15!:0) (3$2-2); (,'a'); 
2+RX_OPTIONS_UTF8_jregex_*16b40
┌─┬──────────────────┬─┬──┐
│0│1100324133552 0 _1│a│66│
└─┴──────────────────┴─┴──┘

I removed the prefix of pcreposix_ from main/regex.ijs and it seems to work now.
I don't see PCRE provides pcreposix_regcomp and other prefixed ones used in 
regex.ijs.
Why is that?


> On Sep 17, 2016, at 9:25 AM, bill lam <bbill....@gmail.com> wrote:
> 
> dyad I. had been broken by me. In viix.c, the line
> case TT(LITX, LITX ): .... c>>=1; /* fall thru */
> should just above line
> case TT(C2TX, C2TX ): BSLOOP(US,US); break;
> 
> try the patch below.
> 
> gdll_df tests for abi. abi for passing float and double depends
> on platforms, windows, linux, macox, raspian and android, all 
> of them use different abi. You need to study the abi spec of
> linux ppc64 and confirm it is one that J engine can handle and
> set correctly. see the comments in the beginning of x15.c
> 
> You may printf inside tsdll to see if values had been passed 
> correctly and the value returned was what J engine had received.
> 
> regex depends on libjpcre.so, which is not part of J engine. You
> may download pcre source from its official site and build the
> binary yourself.
> 
> 
> diff --git a/jsrc/viix.c b/jsrc/viix.c
> index 1d80b31..072dd12 100644
> --- a/jsrc/viix.c
> +++ b/jsrc/viix.c
> @@ -123,23 +123,23 @@ F2(jticap2){A*av,*wv,z;B b;C*uu,*vv;I 
> ad,ar,*as,at,c,ck,cm,ge,gt,j,k,m,n,p,q,r,t
>  }
>  ge=cc; gt=-ge;
>  switch(TT(CTTZ(at),CTTZ(wt))){
> -  case TT(LITX, C4TX ): BSLOOP(UC,C4); break;
> -  case TT(C2TX, C4TX ): BSLOOP(US,C4); break;
> -  case TT(C4TX, LITX ): BSLOOP(C4,UC); break;
> -  case TT(C4TX, C2TX ): BSLOOP(C4,US); break;
> -  case TT(C4TX, C4TX ): BSLOOP(C4,C4); break;
> -  case TT(LITX, C2TX ): BSLOOP(UC,US); break;
> -  case TT(C2TX, C2TX ): BSLOOP(US,US); break;
> -  case TT(C2TX, LITX ): BSLOOP(US,UC); break;
> -  case TT(SBTX, SBTX ): BSLOOF(SB,SB, SBCOMP  ); break;
>   case TT(B01X, B01X ): BSLOOP(C, C ); break;
>   case TT(B01X, INTX ): BSLOOP(C, I ); break;
>   case TT(B01X, FLX  ): BSLOOP(C, D ); break;
> +  case TT(LITX, C2TX ): BSLOOP(UC,US); break;
> +  case TT(LITX, C4TX ): BSLOOP(UC,C4); break;
> #if C_LE
>   case TT(LITX, LITX ): BSLOOP(UC,UC); break;
> #else
>   case TT(LITX, LITX ): if(1&c){BSLOOP(UC,UC); break;}else c>>=1; /* fall 
> thru */
> #endif
> +  case TT(C2TX, C2TX ): BSLOOP(US,US); break;
> +  case TT(C2TX, C4TX ): BSLOOP(US,C4); break;
> +  case TT(C2TX, LITX ): BSLOOP(US,UC); break;
> +  case TT(C4TX, C2TX ): BSLOOP(C4,US); break;
> +  case TT(C4TX, C4TX ): BSLOOP(C4,C4); break;
> +  case TT(C4TX, LITX ): BSLOOP(C4,UC); break;
> +  case TT(SBTX, SBTX ): BSLOOF(SB,SB, SBCOMP  ); break;
>   case TT(INTX, B01X ): BSLOOP(I, C ); break;
>   case TT(INTX, INTX ): BSLOOP(I, I ); break;
>   case TT(INTX, FLX  ): BSLOOP(I, D ); break;
> 
> 
> 
> Сб, 17 сен 2016, Xiao-Yong Jin написал(а):
>> Nice detective work.
>> With bill's patch, most of the crashes and failures are gone.
>> 
>> Increasing the stack size with ulimit -s 40960 passed gstack.
>> The default 10240 for my account is not enough on ppc64, though
>> the usual 8192 on mac and linux x86 works fine.
>> 
>> Now there are only two failures.
>> gdll_df
>> gicap2 
>> 
>> 
>> For gicap2, it seems I. is not doing the correct thing with literals.
>> 
>>   'ab' I.~ 3 2$'abb'
>> 3
>>   'aa' I.~ 3 2$'abb'
>> 3
>>   'ba' I.~ 3 2$'abb'
>> 3
>> 
>> though simple case works
>> 
>>   'ab' I.~ 'abc'
>> 0 1
>> 
>> For gdll_df, it now fails at
>> 
>>   (4;1.5;2.5)= 'fff f f f' dcd 1.5;2.5
>> 0 1 1
>>   'fff f f f' dcd 1.5;2.5
>> ┌─────┬───┬───┐
>> │8.125│1.5│2.5│
>> └─────┴───┴───┘
>> 
>> It does not seem to be an abi issue, since it passed a few tests.
>> 
>> One more thing.  I can't use regular expressions.
>> 
>>   rxcomp'a'
>> |domain error: jregcomp
>> |   'rxlastrc rxlastxrp'=:2{.    
>> jregcomp(rxregxsz$2-2);(,y);2+RX_OPTIONS_UTF8*64
>> 
>> Not sure if it's related to the dll issue.
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
> 
> -- 
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> gpg --keyserver subkeys.pgp.net --armor --export 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to