[fpc-pascal] FPC Graphics options?

Nikolay Nikolov nickysn at gmail.com
Sat May 20 14:57:40 CEST 2017



On 05/19/2017 06:13 PM, Jon Foster wrote:
>
> On 05/19/2017 04:11 AM, Nikolay Nikolov wrote:
>>
>>
>> On 05/19/2017 03:54 AM, Ryan Joseph wrote:
>>>> On May 18, 2017, at 10:40 PM, Jon Foster 
>>>> <jon-lists at jfpossibilities.com> wrote:
>>>>
>>>> 62.44      1.33     1.33 fpc_frac_real
>>>> 26.76      1.90     0.57 MATH_$$_FLOOR$EXTENDED$$LONGINT
>>>> 10.33      2.12     0.22 FPC_DIV_INT64
>>> Thanks for profiling this.
>>>
>>> Floor is there as I expected and 26% is pretty extreme but the 
>>> others are floating point division? How does Java handle this so 
>>> much better than FPC and what are the work arounds? Just curious. As 
>>> it stands I can only reason that I need to avoid dividing floats in 
>>> FPC like the plague.
>> [...] The default options for the i386 compiler is to target the 
>> Pentium CPU, which does not have SSE. This gives most compatibility 
>> and least performance, but that's what's appropriate for most users, 
>> because for most desktop applications, CPU speed is no longer an 
>> issue. Only very specific tasks, such as software 3D rendering need 
>> high CPU performance, and people doing that stuff, usually know very 
>> well their compiler options and how to enable support for modern 
>> instruction extensions for maximum performance. Of course, people 
>> coming from a Java background might not be used at all to having to 
>> do this kind of stuff, but it's really not that hard.
>>
> As stated I tried *ALL* of the FPU settings and received the same 
> result or an "access violation", which I assumed meant my FPU did not 
> support that feature set.
Access violation means usually accessing memory, which is way out of 
bounds. You can try turning range and overflow checking on, but there's 
no guarantee it is going to catch it. However, you should try to narrow 
it down to find the offending location. It could be a bug in your code, 
or a bug in the code generator (which produces an invalid result from a 
given calculation).
> I even tried to enable emulation, to see what the difference would be, 
> but ppc386 said it was an invalid switch even though it lists it in 
> the help output.
Emulation is only supported under go32v2 (the 32-bit DOS target) and is 
only needed on 486SX and 386 CPUs without an FPU, so it's very unlikely 
you would need it. 486DX and above all have a built-in FPU and need no 
emulation. And newer instruction set extensions such as SSE2 and SSE3 
are never emulated, because emulation usually defeats the purpose of 
your code being faster. However, it is very likely that your CPU has 
SSE2 and SSE3 support, unless it is very ancient. Btw, what CPU do you have?

Nikolay



More information about the fpc-pascal mailing list