Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.lang.asm.x86    |    Ahh, the lost art of x86 assembly    |    4,675 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 2,992 of 4,675    |
|    rugxulo@nospicedham.gmail.com to Robert Prins    |
|    Re: Converting some way to clever PL/I c    |
|    07 Sep 17 18:38:40    |
   
   Hi,   
      
   On Sunday, September 3, 2017 at 1:24:05 PM UTC-5, Robert Prins wrote:   
   > On 2017-09-02 23:54, rugxulo@nospicedham.gmail.com wrote:   
   > >   
   > > So why not rewrite in C? It can't be that hard (famous last words!).   
   >   
   > I've been brought up with ALGOL 60, and TI-59-ese ;) and around 1984/5 my   
   father   
   > bought Turbo Pascal 2, and in 1985 I started work, with PL/I. The next   
   language   
   > (REXX) followed in early 1992, and I've never had the luck (or is it   
   misfortune)   
   > to work with C.   
      
   Well, one could argue that speed is irrelevant, but you seem intent   
   upon reaching modern GCC's compiled output speed. I'm more sympathetic   
   to Pascal, but if things like FPC and GPC aren't fast enough, there's   
   only so much one can do. (Convert to Ada??)   
      
   > > Though personally I'd suggest rather fixing to work with FPC,   
   > > that's more useful and important (IMHO).   
   >   
   > No, it's not. VP may be dead, it's hellish to add post Pentium instructions   
   in   
   > the form of long DB sequences to it, and debugging them is of course   
   impossible,   
   > but the IDE is still light-years ahead of what FPC offers. My goal is to   
   > eventually convert the program into pure assembler, probably via FASM, and I   
   > will not go back to FPC until it has an IDE that is as smooth as the one   
   used by   
   > VP, in other words: probably never. :(   
      
   I don't use the IDE. I don't see how that's a dealbreaker.   
      
   > >> Both VP and FPC seem to make way too much use of EAX...   
   > >   
   > > I'm not an optimization guru. I haven't read Agner Fog's manuals   
   > > closely. Modern cpus probably do heavy register renaming and   
   > > lots of out-of-order (pipelined, superscalar, whatever) stuff.   
   > > I think older ones were pickier about certain things, but I   
   > > don't know if you care about (or test your code on) such machines.   
   >   
   > My desktop uses an AMD FX8150, the laptop an Intel quadcore mobile i7, and   
   the   
   > Pure Pascal version of the program would likely still run on a 386, but how   
   > useful is that, I don't even think I even have anything pre-486, and the 486   
   > probably has DOS on it   
      
   I didn't realistically expect you to target a 486. Half my point was   
   that lots of classic optimizations are obsolete.   
      
   BTW, I find AVX uninteresting. Of course, I (still) don't have any   
   AVX-enabled machines! It's a waste of time (almost) chasing the   
   holy grail of optimizations, so I don't keep up with all the latest   
   additions.   
      
   > ... although I doubt that my hand-crafted in-line assembler is as fast   
   > as the properly scheduled code emitted by the GCC or Intel C(++) compilers,   
   > I do know that it's way ahead of what both VP and PFC produce, both size   
   > and speed-wise!.   
      
   I almost forgot: obviously, you can mix code from multiple compilers   
   (assuming common calling convention, linker format, etc). FPC is good   
   about that, but I guess you're stuck with VP (IDE) for now.   
      
   > > Actually, your {$else} code seems pretty sequential.   
   >   
   > There's only so much you can do in parallel, and I think I've converted   
   > most of what could have been converted to MMX   
      
   I meant using the same register in a row, depending on previous results.   
   Old cpus did it sequentially (slowly), but newer ones obviously can   
   "sometimes" avoid such stalls.   
      
   > > I would just use "push dword[], pop dword[]" (but not for 486)   
   > > and avoid ECX altogether. Maybe I'm naive, but that's a quick   
   > > simplification. No idea if it really helps you, though.   
   >   
   > It might be shorter (is it?), it definitely doesn't use registers,   
   > but is it faster? I've got all the Agner Fog files, and I'm not sure.   
      
   I'm still not sure how to test this since I can't fully rebuild it   
   with FPC. I could use VPC, but if you're using AVX a lot, that won't   
   work here either.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca