KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Longint Division in 4D Server 64bit Compiled requires SSE4,1 CPU instruction set
PRODUCT: 4D Server | VERSION: 14R3 | PLATFORM: Mac & Win
Published On: April 20, 2016

Since v14R3, 4D Compiler is now using the ROUNDSD processor instruction when generating 64bit code for the longint division ( "\" operator) between two C_REAL.

The ROUNDSD instruction is part of SSE4.1 available in Intel Penryn (released 2007/2008) and AMD Bulldozer (released 2011).

If you attempt to perform longint division between two real numbers in 64 bit compiled mode without the SSE4,1 instruction set, the application will crash with an Unhandled exception with 0xC000001D: Illegal Instruction error.

You may find the following strange errors in the Windows Event Viewer:

Event 1:

Application Error 1005 (100)
"Windows cannot access the file for one of the following reasons:
there is a problem with the network connection, the disk that the file
is stored on, or the storage drivers installed on this computer; or
the disk is missing. Windows closed the program 4D Server because of
this error.

Program: 4D Server
File:

The error value is listed in the Additional Data section.
User Action
1. Open the file again. This situation might be a temporary problem
that corrects itself when the program runs again.
2. If the file still cannot be accessed and
- It is on the network, your network administrator should
verify that there is not a problem with the network and that the
server can be contacted.
- It is on a removable disk, for example, a floppy disk or CD-
ROM, verify that the disk is fully inserted into the computer.
3. Check and repair the file system by running CHKDSK. To run CHKDSK,
click Start, click Run, type CMD, and then click OK. At the command
prompt, type CHKDSK /F, and then press ENTER.
4. If the problem persists, restore the file from a backup copy.
5. Determine whether other files on the same disk can be opened. If
not, the disk might be damaged. If it is a hard disk, contact your
administrator or computer hardware vendor for further assistance.

Additional Data
Error value: 00000000
Disk type: 0"


Event 2:
Application Error 1000 (100)
"Faulting application name: 4D Server.exe, version: 15.0.1.0
Faulting module name: unknown, version: 0.0.0.0
Exception code: 0xc000001d


The best solution for this is to update to newer hardware with a CPU that supports the SSE4,1 instruction set.

However, if updating the hardware is not possible the following workarounds may help:
- use the more classical "/" divide operator and Round() command
- use the "\" operator between two C_LONGINT instead
- use 64 bit interpreted mode which does not use SSE4,1
- use 32 bit compiled mode which does not use SSE4,1