Re: [fpc-devel] File search

2010-08-06 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: I've seen that compiler directory caching is disabled - for what reason? It's not disabled, except if you disable it yourself via the -Fd command line option. You're right, perhaps I've been fooled once more by the Lazarus code tools. It looks like nobody ever used

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-06 Thread Hans-Peter Diettrich
Alexander Klenin schrieb: I do think that begin/end is an awful amount of visual clutter, and that Modula solution is a better one. begin can be omitted in many cases, but end is inevitable to denote the end of any block (except until...). Unfortunately, this change is totally out of

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-06 Thread Hans-Peter Diettrich
Vinzent Höfler schrieb: Sometimes I really wonder if the buddies KR when designing C actually looked at the keyboard and tried to assign a meaning to each special character they found there. Obviously, they seem to have missed $. Probably this one was either too BASIC or too establishment.

Re: [fpc-devel] buildfaq

2010-08-06 Thread Hans-Peter Diettrich
Henry Vermaak schrieb: What does a build system need more[1], apart from these options? Auto select source/paths/components for different back-ends depending on architectures and options, as is done by Lazarus/fpc deal with auto-generated source files, build installers, run tests, handle

Re: [fpc-devel] Proposal: Enhanced replacement for assignment operators

2010-08-06 Thread Hans-Peter Diettrich
Vinzent Höfler schrieb: Yes, back to the good old times where we typed hex listings out of badly copied magazines. Programming was so much easier when all was needed were the characters from 0-9, A-F, space, and newline.[1] Vinzent. [1] And a lot of time to find the typo that crashed the

[fpc-devel] Debugger problem

2010-08-06 Thread Hans-Peter Diettrich
I've installed Lazarus 0.9.28 (with FPC 2.2.4) 64 bit on Win7/64. Here gdb works. Then I built and installed FPC 2.5 (trunk) for further use. The compiled apps (64 bit) run fine, as long as I disable debugging. With debugging enabled the application hangs on start, i.e. even the console does

Re: [fpc-devel] OO rewrite - first round finished

2010-08-05 Thread Hans-Peter Diettrich
Marc Weustink schrieb: While I can use Lazarus to debug the compilation of a single source file, no such feature exists for Makefiles. I even don't know how to translate an error address to a source code position. In Delphi I had a jump to address... menu item... Use make all as Execute

Re: [fpc-devel] buildfaq

2010-08-05 Thread Hans-Peter Diettrich
Michael Schnell schrieb: On 08/04/2010 09:23 PM, Hans-Peter Diettrich wrote: autobloat, I never heard of same ?!?!? automake, autoconf, configure... These are tools that try and guess how a project should be adopted to various targets. But it's up to the user to create the tests

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Hans-Peter Diettrich
Michael Schnell schrieb: IMHO, if the compiler should issue an error message if yo9u give a segment register with LEA, as the result obviously is erroneous. Maybe other compilers in fact do this. I only tested Turbo Delphi. I had thought that this has been fixed on newer architectures, that

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Hans-Peter Diettrich
Michael Schnell schrieb: OK I was wrong by two bits. See http://flint.cs.yale.edu/cs422/doc/24547212.pdf page 3-7 The logical address is 24 bits: 16 bits Segment Selector and 32 bits Offset. Please be a bit more precise with your bitcounts. The Selector is used to take one of up to 2^13

Re: [fpc-devel] Passing parameters through the stack to interfaces

2010-08-05 Thread Hans-Peter Diettrich
Joost van der Sluis schrieb: It seems like that when you call a method of an interface, a 'hidden' wrapper is generated by the compiler to adjust the 'self' parameter so that it does not refers to the interface-pointer, but the actual class-pointer. This is common practice, also in C++. The

Re: [fpc-devel] threadvar implementation

2010-08-05 Thread Hans-Peter Diettrich
Michael Schnell schrieb: FS/GS for non-zerobased segments, all others are zero-based. I have no idea what you mean by zerobased. Then you missed fundamental 32/64 bit hardware and software principles :-( Please read and understand the available documentation, my preceding posts, and ask

[fpc-devel] File search

2010-08-05 Thread Hans-Peter Diettrich
IMO the file search performance can be improved, in detail for files to compile. Currently FileExists is called for every possible directory, name case and possible extensions. This means that the OS may have to search the same directory multiple times, for all these cases - O(n). This can be

Re: [fpc-devel] buildfaq

2010-08-05 Thread Hans-Peter Diettrich
Henry Vermaak schrieb: Build systems seem to be a constant itch. See a list here: http://en.wikipedia.org/wiki/List_of_build_automation_software Shouldn't we add FPC to that list? IMO the list completely ignores the existence of platform independent development systems, like for Basic,

Re: [fpc-devel] OO rewrite - first round finished

2010-08-05 Thread Hans-Peter Diettrich
Felipe Monteiro de Carvalho schrieb: What is the OO rewrite? It's an SVN branch, aimed at making the compiler more object-oriented. It should simplify the maintenance of the compiler code, the test of different algorithms and procedures for specific parts, and finally the use of threads and

Re: [fpc-devel] buildfaq

2010-08-04 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: 4) How does FPC handle different targets? IMO every target is implemented in a specific executable, so how does pp or fpc proceed when it is invoked with an target specifier, that it cannot handle itself? fpc is only a wrapper, it tries to find the right compiler.

Re: [fpc-devel] buildfaq

2010-08-04 Thread Hans-Peter Diettrich
Henry Vermaak schrieb: 2) An unqualified reference (PP=mypp) most proably fails - where exactly does Make search for that compiler? See Makefile from line 109 onwards. It first looks for fpc(.exe) on the path. If it finds that, it gets the real compiler exe with -PB. If fpc(.exe) isn't

Re: [fpc-devel] buildfaq

2010-08-04 Thread Hans-Peter Diettrich
Marco van de Voort schrieb: 2) An unqualified reference (PP=mypp) most proably fails - where exactly does Make search for that compiler? Works for me. It searches in the PATH. It might not look in the current dir though, is that what you mean? That is a make gotcha though. So it's not

Re: [fpc-devel] buildfaq

2010-08-04 Thread Hans-Peter Diettrich
Henry Vermaak schrieb: I'm not very familiar with the make syntax :-( Heh, prepare to lose your mind. It's like with the universe - once somebody will figure out, how it works, it will turn immediately into something even more weird. Some years ago I tried to install autobloat C packages

Re: [fpc-devel] buildfaq

2010-08-04 Thread Hans-Peter Diettrich
Michael Schnell schrieb: I'm not very familiar with the make syntax :-( There is a book by O'Reily on GNU MAKE sitting on my shelf. I did not yet dare to open it It's quite useless, since the C coder community does not accept most of the extensions. Instead they insist in using

[fpc-devel] buildfaq

2010-08-03 Thread Hans-Peter Diettrich
I've some problems with building and testing an new compiler. 1) The buildfaq mentions both PP= and FPC= for the compiler, to be used by Make. It should be made clear whether these are equivalent, or (better) only one option should be used across the entire FAQ. 2) An unqualified reference

Re: [fpc-devel] threadvar implementation

2010-08-02 Thread Hans-Peter Diettrich
Michael Schnell schrieb: Only FS and GS can add an non-zero offset, to the *offset* given in the instruction. The sum of both is the flat address (effectively another offset), that can be stored in a pointer variable. In 32/64 bit flat memory models all pointers are near, i.e. they don't

Re: [fpc-devel] threadvar implementation

2010-07-30 Thread Hans-Peter Diettrich
Michael Schnell schrieb: What makes you think that this is different from x86? With X86/32 Linux, the applicationaddress of a threadvar Please distinguish: Segmented or Flat address? Only FS and GS can add an non-zero offset, to the *offset* given in the instruction. The sum of both is the

Re: [fpc-devel] OO rewrite - first round finished

2010-07-30 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: The first version of the OO rewrite branch is ready for alpha testing :-) Well, the alpha test revealed some problems, that have been fixed (except one). Now the differences between branch and updated trunk already result in problems[1], that make testing the OO

Re: [fpc-devel] OO rewrite - first round finished

2010-07-30 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: Now the differences between branch and updated trunk already result in problems[1], that make testing the OO compiler near impossible. This raises the question, how to proceed with the integration of both version? That would be easier to answer if you would at least

Re: [fpc-devel] OO rewrite - first round finished

2010-07-30 Thread Hans-Peter Diettrich
Florian Klämpfl schrieb: Problem is: breaking trunk too often scares even more people to use trunk. But we need people using trunk to get it tested as well as possible so we must do our best to keep trunk also in a good shape, see below. Full ACK. Most probably my assumption was wrong, that

Re: [fpc-devel] threadvar implementation

2010-07-29 Thread Hans-Peter Diettrich
Michael Schnell schrieb: I suppose with this paradigm, pointers to threadvars should work (other than with X86/32-Linux), as the threadvars - other than with X86 - simply have have different effective user space addresses What makes you think that this is different from x86? DoDi

Re: [fpc-devel] Syntax problem with function result

2010-07-29 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: Another thing: please do not commit tests inside the compiler directory. They are there only until the bugs have been fixed. DoDi ___ fpc-devel maillist - fpc-devel@lists.freepascal.org

Re: [fpc-devel] Syntax problem with function result

2010-07-28 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: IMO we should have at least an option, that a function name can *not* be used for the function result any more, for the result we have the Result variable. Then we can safely distinguish between function calls (by function name) and results (by Result). If ever

[fpc-devel] OO rewrite - property syntax

2010-07-28 Thread Hans-Peter Diettrich
The procedure property_dec exists twice, in pdecl.pas and pdecobj.pas. The pdecobj version seems to handle (old) syntax only, does not accept unit properties nor multiple property declarations. Should it be dropped, in favor of the pdecl version? If not, I'd suggest to rename one of these

Re: [fpc-devel] Syntax problem with function result

2010-07-28 Thread Hans-Peter Diettrich
Jeppe Johansen schrieb: [please quote inline] I wouldn't miss not having the name of the function as a result variable in mode objfpc, at all. I think it would be a valid addition, as a compiler directive that was turned on as default, as not to break existing code It would break the

Re: [fpc-devel] Syntax problem with function result

2010-07-28 Thread Hans-Peter Diettrich
Daniël Mantione schrieb: If I understand it well this patch will disable not only the fpc externsion: writeln(name_of_function); ... but also the standard Pascal: name_of_function:=value; Why would we want to disable the standard Pascal solution? Why not disable the Borland result

Re: [fpc-devel] Syntax problem with function result

2010-07-28 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: Thanks, I'll check it, and possibly add it to my OO rewrite branch :-) Just to make sure: please do not add any new features to your OO rewrite branch. Reviewing it for potential merging into trunk will be hard enough already without any new features added to it. I only

Re: [fpc-devel] OO rewrite - first round finished

2010-07-27 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: Another idea is a cache for frequently created objects, like procinfo and the register allocators. Basically, I'am against this, time should be spent better in optimizations where all program benefit. Especially fillchar is probably a problem. That's just the

Re: [fpc-devel] OO rewrite - globals

2010-07-27 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: Especially since in the past several people spent a lot of time on breaking cyclic dependencies and organising everything nicely into separate units (both for the parser and for the symbol table). While that separation removed cyclic dependencies, it spread very

Re: [fpc-devel] OO rewrite - first round finished

2010-07-27 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: Just a another remark: uses clause of pbase must be cleaned up: it causes a lot of cyclic and strange dependencies. Especially the dependency on parser_opl is a no go. IMO there needs to go a lot of code into parser_opl. Right, some references could be removed just

Re: [fpc-devel] OO rewrite - globals

2010-07-27 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: I simply don't like the idea of having one big parser class blob spread over multiple include files. I don't like it as well :-( But what is the reason against a TModuleParser TDeclarationParser TSubroutineParser TStatementParser TExprParser ? How are these

[fpc-devel] Syntax problem with function result

2010-07-27 Thread Hans-Peter Diettrich
I just had to chase an strange bug, in a local (nested) subroutine. When I made several functions (if_statement() ...) local subroutines of method statement(), they stopped to work properly :-( After many tries I concluded, that every (recursive) invocation of the statement method was

Re: [fpc-devel] Syntax problem with function result

2010-07-27 Thread Hans-Peter Diettrich
Jeppe Johansen schrieb: I wouldn't miss not having the name of the function as a result variable in mode objfpc, at all. I think it would be a valid addition, as a compiler directive that was turned on as default, as not to break existing code It would break the compiler itself. DoDi

Re: [fpc-devel] OO rewrite - globals

2010-07-26 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: When a parser is designed to work with exactly one scanner, why should it not inherit from it? Well, with the same argument one could stuff all code in one source file and don't separate anything in units. Encapsulation requires some separation. Having parser

Re: [fpc-devel] Namespaces [was: is that intended? private type section in classes versus visibility]

2010-07-26 Thread Hans-Peter Diettrich
Graeme Geldenhuys schrieb: Op 2010-07-26 02:45, Hans-Peter Diettrich het geskryf: How should that work? How to distinguish between stdutils.pas and otherutils.pas, in using utils;? I'm thinking in the line of working with something like Lazarus Packages. This is not limited to Lazarus only

Re: [fpc-devel] OO rewrite - globals

2010-07-26 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: I simply don't like the idea of having one big parser class blob spread over multiple include files. Especially since in the past several people spent a lot of time on breaking cyclic dependencies and organising everything nicely into separate units (both for the parser

[fpc-devel] OO rewrite - first round finished

2010-07-26 Thread Hans-Peter Diettrich
The first version of the OO rewrite branch is ready for alpha testing :-) Now I need assistance in testing and profiling it. Can somebody do that, or give me instructions how to do that myself? The current version still uses global variables, which shall be moved into objects in the next

Re: [fpc-devel] OO rewrite - technical questions

2010-07-25 Thread Hans-Peter Diettrich
Nikolai Zhubr schrieb: 24.07.2010 19:46, Hans-Peter Diettrich: MOV EAX,TlsIndex MOV EDX,FS:tlsArray MOV EAX,[EDX+EAX*4] I wonder what TlsIndex here is? tlsArray = $2C; IIRC for an application (not a dll) TlsIndex is always 0 (But I might be wrong here though) The main thread may have

[fpc-devel] OO rewrite - globals

2010-07-25 Thread Hans-Peter Diettrich
In the meantime I could make the OO compiler compile, but it does not already work (project ppoo.lpi). Can somebody assist in the separation of the many global variables, which have to become fields in distinct classes (tmodule, tparser...)? The intended data tree looks like this:

Re: [fpc-devel] OO rewrite - globals

2010-07-25 Thread Hans-Peter Diettrich
Florian Klämpfl schrieb: Parser now is derived from the tscannerfile class. This is a really ugly design OOP wise ... When a parser is designed to work with exactly one scanner, why should it not inherit from it? In the first approach I added delegates for scanner methods to the parser,

Re: [fpc-devel] Namespaces [was: is that intended? private type section in classes versus visibility]

2010-07-25 Thread Hans-Peter Diettrich
Graeme Geldenhuys schrieb: my projects - instead I have to keep coming up with new prefixes. I already have gg_utils.pas, mm_utils.pas, fpg_utils.pas, m2c_utils.pas for some of my projects. It would be awesome if I can simply use utils.pas and define a namespace via a compiler parameter. How

Re: [fpc-devel] OO rewrite - technical questions

2010-07-24 Thread Hans-Peter Diettrich
Nikolai Zhubr schrieb: IMO the segment register is used implicitly in thread API calls, with no further use by application code. Exactly the opposite (at least delphi on windows). See delphi's RTL. Well, once it's set by the OS, it can be used in hackery ;-) In such case of course fs/gs

Re: [fpc-devel] OO rewrite - technical questions

2010-07-24 Thread Hans-Peter Diettrich
Nikolai Zhubr schrieb: where GetTls in case of an ordinary application (not dll) is just this: MOV EAX,TlsIndex MOV EDX,FS:tlsArray MOV EAX,[EDX+EAX*4] I wonder what TlsIndex here is? Also FS:tlsArray seems to contain an address in the general address

Re: [fpc-devel] OO rewrite - technical questions

2010-07-23 Thread Hans-Peter Diettrich
Michael Schnell schrieb: IMO the OS provides means to allocate an thread-local memory block (Thread Local Storage), whose content *can* be used for threadvars. AFAI understand, in Linux (any architecture) the OS just preserves a count of registers and the (e.g. C) compiler just uses one of

Re: [fpc-devel] is that intended? private type section in classes versus visibility

2010-07-23 Thread Hans-Peter Diettrich
Paul Ishenin schrieb: 23.07.2010 9:20, Paul Ishenin wrote: Is that intended? Or should a visibility change exit the type section? This is a bug. I will fix it. What to do with the generics syntax? FPC do this so: generic TFPGListT = class(TFPSList) type public TCompareFunc =

Re: [fpc-devel] OO rewrite - technical questions

2010-07-23 Thread Hans-Peter Diettrich
Michael Schnell schrieb: Do you mean segment or general-purpose register(s)? This depends on the arch. X86 does not really have general-purpose registers, while NIOS, ARM MIPS (and supposedly X86/64) has almost only general-purpose registers. M68K has distinct address and data registers,

Re: [fpc-devel] Safecall on Linux (and other unices?)

2010-07-22 Thread Hans-Peter Diettrich
Sven Barth schrieb: Safecall is a Borland invention and only available in Delphi to simplify COM development AFAIK SafeCall and SafeArray are Microsoft inventions, in the introduction of OLE/COM. Borland had to understand and implement the related functionality in the language and compiler.

Re: [fpc-devel] OO rewrite - technical questions

2010-07-21 Thread Hans-Peter Diettrich
Michael Schnell schrieb: Since it turned out that loading segment registers is very time consuming on newer (i486+) processors, the memory management was changed from segmented (16 bit) into paged (32 bit flat). Segment registers never should be changed by an application, Not really, The OS

Re: [fpc-devel] Safecall on Linux (and other unices?)

2010-07-21 Thread Hans-Peter Diettrich
José Mejuto schrieb: It is not 100% cdecl, const records in safecall must be passed as reference while in cdecl a copy of the record is being passed. Copies IMO make no sense here, when const protects the record elements from any modifications. That's why a compiler should be free to pass

Re: [fpc-devel] Safecall on Linux (and other unices?)

2010-07-21 Thread Hans-Peter Diettrich
Sven Barth schrieb: Well... for Linux exists no safecall convention and the only library that might profit from it is XPCOM which uses cdecl procedures that are compatible with the idea of safecall. But if we implement safecall on Linux to be used with XPCOM ...then we might make XPCOM

Re: [fpc-devel] OO rewrite - technical questions

2010-07-20 Thread Hans-Peter Diettrich
Michael Schnell schrieb: BTW what about GS ? If same is just restored after preemption, this could be used by the compiler to point to the Threadvar area. Since it turned out that loading segment registers is very time consuming on newer (i486+) processors, the memory management was changed

[fpc-devel] OO rewrite - technical questions

2010-07-19 Thread Hans-Peter Diettrich
One requirement in a transformation into OOP is the replacement of all affected procedures by methods, and of many (currently global) reference variables by class members. When e.g. later multiple parser instances are created, one for every unit to compile, the current compiler directive

Re: [fpc-devel] OO rewrite - technical questions

2010-07-19 Thread Hans-Peter Diettrich
Michael Schnell schrieb: On 07/19/2010 11:40 AM, Hans-Peter Diettrich wrote: One requirement in a transformation into OOP is the replacement of all affected procedures by methods, and of many (currently global) reference variables by class members. When e.g. later multiple parser instances

Re: [fpc-devel] Need advice for refactoring

2010-07-17 Thread Hans-Peter Diettrich
Florian Klämpfl schrieb: For profiling and debugging I want to have both the old and new code in the same executable file I don't think this is a good idea. My proposal is: - make a proof of concept for a part of the parser, e.g. ptype.pas, then we profile the old and the new compiler with

Re: [fpc-devel] Need advice for refactoring

2010-07-17 Thread Hans-Peter Diettrich
Alexander Klenin schrieb: In the first step I'll enclose all semantical code into begin-end, so that it can be easily hidden (folded) in the Lazarus IDE. This is not needed -- you can use {$REGION} ... {$ENDREGION} directives instead. I'll need begin-end anyways, when the code becomes a

Re: [fpc-devel] FPC/Delphi/FastMM4/TopMemory speed test

2010-07-17 Thread Hans-Peter Diettrich
Adem schrieb: Focus of that 'test' was to see how TopMM compares with FastMM (both Delphi only), which turned out that FastMM is 50% faster than TopMemory. ... and FPC: FPC_x86/FastMM: 2.24 On Windows7_x64, *64bit binary* compiled with FPC runs about *30% faster* than 32bit binary. I

Re: [fpc-devel] FPC/Delphi/FastMM4/TopMemory speed test

2010-07-17 Thread Hans-Peter Diettrich
Adem schrieb: And, the code I used was this. [...] MemoPerformance.Lines.Add(Format('Time: %n', [Time3 * 1E-6])); Node1.Free; end; Can you show the time for Node1.Free as well? Fast allocation can result in slow deallocation... DoDi ___

Re: [fpc-devel] Need advice for refactoring

2010-07-17 Thread Hans-Peter Diettrich
Florian Klämpfl schrieb: My proposal is: - make a proof of concept for a part of the parser, e.g. ptype.pas, then we profile the old and the new compiler with valgrind with code which stresses this part. - then we decide if it's worth to continue Thanks for pointing to ptype.pas, these

Re: [fpc-devel] FPC/Delphi/FastMM4/TopMemory speed test

2010-07-17 Thread Hans-Peter Diettrich
Juha Manninen schrieb: BTW, is there some way of having both 32bit and 64bit FPC/Lazarus coexist in the same machine? With Lazarus it is easy. You just compile it and rename the binary. It does not need to be installed. But it's suggested to invoke both with a different -pcp

Re: [fpc-devel] FPC/Delphi/FastMM4/TopMemory speed test

2010-07-17 Thread Hans-Peter Diettrich
Adem schrieb: On 2010-07-17 17:37, Hans-Peter Diettrich wrote: Can you show the time for Node1.Free as well? Fast allocation can result in slow deallocation... *FPC_x86* Time to Create: 632.7 Time to Destroy: 471.69 *FPC_x64* Time to Create: 489.4 Time to Destroy: 468.94 What about

[fpc-devel] Need advice for refactoring

2010-07-16 Thread Hans-Peter Diettrich
Since some time I'm trying to separate the syntax from the semantics processing in the parser. It turned out to be quite complicated, so that I want to use some methodology. (Yes, I've been warned ;-) For profiling and debugging I want to have both the old and new code in the same executable

Re: [fpc-devel] Messages overhead

2010-07-15 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: IMO compiler messages slow down compilation a lot. How do you know this, did you benchmark or is it just your opinion? Common knowledge, proved by experience. Please profile the compiler first, people did this already. This is what I'm going to do now. Does

Re: [fpc-devel] Compiler bottlenecks]

2010-07-15 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: Unless you are doing a cold compile, the main bottlenecks in the compiler are the memory manager (mostly the allocation of memory, freeing is faster), zero-filling new class instances (and partially resetting the register allocator) and tobject.initinstance. I wonder

Re: [fpc-devel] Messages overhead

2010-07-15 Thread Hans-Peter Diettrich
Sergei Gorelkin schrieb: I had benchmarked that, and submitted some patching some (already long) time ago. Those patches inserted calls to CheckVerbosity before blocks of messages of rarely used verbosity, like V_Tried. But the patches have been rejected? For what reason? This way it was

Re: [fpc-devel] Blackfin support

2010-07-15 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: Hans-Peter Diettrich schrieb: I see the biggest benefit in many possible optimization in the scanner and parser, which can be implemented *only if* an entire file resides in memory. Include files, macro expansion and generics make such optimizations hard

Re: [fpc-devel] Compiler bottlenecks]

2010-07-15 Thread Hans-Peter Diettrich
Marco van de Voort schrieb: In our previous episode, Florian Klaempfl said: zero it again, so where is the gain in that ? While it's in the freelist, the helper task ... thread ... zeros it so when it is allocated again, it needs no zeroing again. But that then zeroes every deallocation.

Re: [fpc-devel] Re: Compiler bottlenecks

2010-07-15 Thread Hans-Peter Diettrich
Michael Schnell schrieb: With small blocks there is no concurrency (as in case of conflict, the second thread will use medium. Just an idea: When the lists contain many entries, they could be split into buckets. Then the currently searched bucket(s) could be locked against use by other

Re: [fpc-devel] Messages overhead

2010-07-15 Thread Hans-Peter Diettrich
Tomas Hajny schrieb: This cannot be done because people should have the chance to use custom error files to override message verbosities. Couldn't this be delegated to an custom message handler? Not sure if I understand here. Do you mean that instead of changing few letters in the message

Re: [fpc-devel] Blackfin support

2010-07-15 Thread Hans-Peter Diettrich
Sergei Gorelkin schrieb: Not necessarily. When all currently used files reside in memory, every (recorded) token can contain an pointer (or offset) into the file buffer. This may reduce the number of required string copies (not yet fully researched). You normally shouldn't ever need to

Re: [fpc-devel] Messages overhead

2010-07-15 Thread Hans-Peter Diettrich
Sergei Gorelkin schrieb: The issue was that, whenever compiler needs to output a message, it: - loads a messagefile (once in a session) - looks up the message by number - performs the parameter substitution (this involves AnsiStrings, so is somewhat heavy) - only then checks if it should

Re: [fpc-devel] arm embedded cortexM3 unrecognized opcode

2010-07-14 Thread Hans-Peter Diettrich
Bernd Mueller schrieb: Users, who do embedded stuff (without OS) NEED FULL control over the controller. I agree with Jeppe, that the compiler should not restrict something. In this case I don't understand how FPC is useful at all. I cannot create executable files for such a device...

Re: [fpc-devel] Blackfin support

2010-07-14 Thread Hans-Peter Diettrich
Michael Schnell schrieb: One of these issues are memory mapped files, that can speed up file access a lot (I've been told), perhaps because it maps directly to the system file cache? AFAIK File Mapping is used a lot and very successfully with Linux, but it _is_ available with NTFS. I've

Re: [fpc-devel] Blackfin support

2010-07-14 Thread Hans-Peter Diettrich
Marco van de Voort schrieb: In our previous episode, Michael Schnell said: On 07/14/2010 12:00 AM, Hans-Peter Diettrich wrote: One of these issues are memory mapped files, that can speed up file access a lot (I've been told), perhaps because it maps directly to the system file cache? AFAIK

Re: [fpc-devel] Purpose of uses ... in?

2010-07-14 Thread Hans-Peter Diettrich
Thaddy schrieb: Programmers are not very imaginative in naming. It is plainly helpfull to be able to rename a file if another file with a different content. Just in the FPC compiler case many unit names are hard coded, while the files to use reside e.g. in a specific machine directory,

Re: [fpc-devel] Blackfin support

2010-07-14 Thread Hans-Peter Diettrich
Michael Schnell schrieb: On 07/13/2010 11:18 PM, Hans-Peter Diettrich wrote: When we rely on an OS file chache, we can read all files entirely into memory, instead of using buffered I/O. Loading the complete file instead of parts of it would do unnecessary memory copies. How that? Of course

Re: [fpc-devel] Compiler bottlenecks]

2010-07-14 Thread Hans-Peter Diettrich
Thaddy schrieb: Hans-Peter Diettrich wrote: Memory management can not normally be parallelized. What's this then: http://topsoftwaresite.nl/ You are talking cows dung. It is actually in production at one of the largest stockbrokers in Europe. You should have written : It is hard to do

[fpc-devel] Messages overhead

2010-07-14 Thread Hans-Peter Diettrich
IMO compiler messages slow down compilation a lot. When messages are not really output (prevented by message level...), then a lot of procedure calls and string operations can be avoided, when the message preparation is bypassed at all. verbose.Message1 ff. could check the level (and exit

Re: [fpc-devel] Blackfin support

2010-07-14 Thread Hans-Peter Diettrich
Marco van de Voort schrieb: I don't think we ever going to give an up front carte blanche for a massive rewrite to go into trunk. That is simply not sane. ACK. I'm more concerned about work that is blacklisted for some reason. A subsmission will always be judged on performance and

Re: [fpc-devel] Compiler bottlenecks]

2010-07-14 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: This technique is well known and implemented by virtually all memory managers these days (it's called pooling, or freelists). FPC's default memory manager also does that (up to a certain allocation size). Unless you create huge pools, it does not affect total memory

Re: [fpc-devel] Messages overhead

2010-07-14 Thread Hans-Peter Diettrich
Daniël Mantione schrieb: IMO compiler messages slow down compilation a lot. How do you know this, did you benchmark or is it just your opinion? Common knowledge, proved by experience. [...] Sounds reasonable to me, but wether it will speed up compilation is another question. Anyway,

Re: [fpc-devel] Re: Compiler bottlenecks

2010-07-14 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: Apart from specific scenarios, memory mapping can easily be slower than direct reads. The main reason is that you get round trips to the OS via hardware interrupts whenever you trigger a page fault, instead of doing one or more (relatively cheap compared to interrupts)

Re: [fpc-devel] Parser rewrite

2010-07-14 Thread Hans-Peter Diettrich
Marco van de Voort schrieb: Will it do harm when I create more than one branch, e.g. one for general optimizations? Can other people contribute to such an branch as well? Keep in mind that running many branches long term will only increase the amount of management to keep them in sync, makes

Re: [fpc-devel] Compiler bottlenecks]

2010-07-13 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: I suspect that disk I/O is the narrowest bottleneck, that can not be widened by parallel processing. Unless you are doing a cold compile, the main bottlenecks in the compiler are the memory manager (mostly the allocation of memory, freeing is faster), zero-filling new

Re: [fpc-devel] Blackfin support

2010-07-13 Thread Hans-Peter Diettrich
Michael Schnell schrieb: That's questionable, depending on the real bottlenecks in compiler operation. I suspect that disk I/O is the narrowest bottleneck, I doubt this. The disk-cache does a decent work here. gcc can do this very effectively on a higher layer, as for each source file gcc is

Re: [fpc-devel] Blackfin support

2010-07-13 Thread Hans-Peter Diettrich
Michael Schnell schrieb: M68K machine, which in turn seems to have inherited from the ARM. I suppose: vice versa :). At least I found files with comments from/for ARM. .., but it doesn't allow to support multiple machine back-ends in one program. Do you think it would be an advantage to

Re: [fpc-devel] Blackfin support

2010-07-13 Thread Hans-Peter Diettrich
Florian Klaempfl schrieb: Memory throughput is a bottleneck, I/O not really. So multithreading has a real advantage on NUMA systems and systems where different cores have dedicated caches. One or two years ago, I did some experiments with asynchronous assembler calls and it already improved

Re: [fpc-devel] Purpose of uses ... in?

2010-07-13 Thread Hans-Peter Diettrich
Marco van de Voort schrieb: Nobody is talking about removing ? It is more a matter of not expanding, and not guaranteeing too much (more) wrt to it. Specially since DoDi in other posts seemed to state that he wanted to use it to override which unit is selected in multiple sources in path cases.

Re: [fpc-devel] arm embedded cortexM3 unrecognized opcode

2010-07-13 Thread Hans-Peter Diettrich
Geoffrey Barton schrieb: It now recognises the mnemonic 'cpsie' but not the following 'i'. The 'msr' instruction should also allow the interrupts to be enabled/disabled as msr primask,r0 but msr gives an unknown identifier error for 'primask' and all the other 'special' register names

Re: [fpc-devel] Blackfin support

2010-07-13 Thread Hans-Peter Diettrich
Michael Schnell schrieb: On 07/13/2010 02:49 PM, Hans-Peter Diettrich wrote: But when FPC processes every source unit in a project only once, the file cache is not very helpful. Obviously, a sufficiently huge cache can avoid any disk I/O bottleneck when doing the 2nd+ build

Re: [fpc-devel] arm embedded cortexM3 unrecognized opcode

2010-07-13 Thread Hans-Peter Diettrich
Jeppe Johansen schrieb: I think that'll only complicate things. I think the compiler should be able to do anything, down to lowest level. Just like you have CLI, HLT, FXSTOR, WRMSR, etc instruction support in x86 Then many users will wonder why their application with included ASM from

Re: [fpc-devel] Blackfin support

2010-07-13 Thread Hans-Peter Diettrich
Marco van de Voort schrieb: One must keep in mind though that he probably measures on a *nix, and there is a reason why on Windows the make cycle takes twice the time on Windows. One of these issues are memory mapped files, that can speed up file access a lot (I've been told), perhaps

Re: [fpc-devel] Purpose of uses ... in?

2010-07-12 Thread Hans-Peter Diettrich
Jonas Maebe schrieb: I know that the in filespec is part of the Delphi syntax, but what is it really good for? AFAIK it's not allowed to rename units this way, and since (currently) only absolute filenames are implemented, That is incorrect. Relative file names do work. They are resolved

Re: [fpc-devel] FPC Branches

2010-07-12 Thread Hans-Peter Diettrich
Michael Schnell schrieb: IMHO a lot more interesting than ISO-Pascal, Modula, Oberon: What about Delphi-Prism on that behalf. ? (This supposedly would be easier to make working using a .NET/MONO-code generating backend compiler than by attempting to reproduce the appropriate functionality

Re: [fpc-devel] Blackfin support

2010-07-12 Thread Hans-Peter Diettrich
Michael Schnell schrieb: I just stripped down the machine files for a no_cpu machine (all fakes), with some documentation about the required units etc. Is this based on what we already have for X86, ARM, etc, or does it fork to another set of ARC implementations ? If fork, is it intended /

<    4   5   6   7   8   9   10   >