Re: [fpc-pascal] rotating bits

2006-05-28 Thread Jonas Maebe
On 27 May 2006, at 11:01, Bisma Jayadi wrote: I agree with Michael. And I think the line is clearly drawn. The FPC (and more importantly the language syntax itself) design goal, as I understand it, is to be, as much as possible, platform and architecture independent and I believe the bi

Re: [fpc-pascal] assigning ansistring with shortstring

2006-05-28 Thread Jonas Maebe
On 27 May 2006, at 21:54, L505 wrote: Note that the setlength will generate exactly the same code as the 'last3[0]:=chr(3);' statement, so it's better to keep the setlength (in case the string would ever become an ansistring, or just for readability) I didn't think the compiler would let you

Re: [fpc-pascal] rotating bits

2006-05-28 Thread Florian Klaempfl
Jonas Maebe wrote: > > On 27 May 2006, at 11:01, Bisma Jayadi wrote: > >>> I agree with Michael. And I think the line is clearly drawn. The FPC >>> (and more importantly the language syntax itself) design goal, as I >>> understand it, is to be, as much as possible, platform and >>> architecture

Re: [fpc-pascal] rotating bits

2006-05-28 Thread Jonas Maebe
On 28 May 2006, at 15:45, Florian Klaempfl wrote: It is possible to implement a peephole optimization to change the shift/or into the native variant of rol/ror if it exists. The code currently generated is rather lengthy. Of course, but it's going to be a pretty consistent pattern which can

Re: [fpc-pascal] rotating bits

2006-05-28 Thread Jonas Maebe
On 28 May 2006, at 15:51, Jonas Maebe wrote: But it can be done on ppc with two rlw* instructions which is also ok, no? I think it needs three: to to rotate left/right, one to insert the overflow at the end/start, and one to mask the overfow at the end/ start. No, two is actually indee