summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-09-22parse: cleanupwork2Wim Taymans1-10/+4
Be more elegant in parsing and passing the parameters to orc_program_append_str_2().
2014-09-22test: add more testsWim Taymans1-0/+107
2014-09-19compiler: keep track of temp variables that contain param/constWim Taymans2-5/+22
Keep track of what const/param is loaded into a temp variable. We can then see if the const is already loaded in a variable and simply reuse it instead of using a new temp. We must also make sure we load constants of different size in different temp variables.
2014-09-19Revert reuse constantsWim Taymans4-40/+16
This reverts commit 2ece711c615d327be1e74bec4844186ced58b0ef. This reverts commit 2ae41b98a35405dbfd35209e7d68428be77a2e62. This reverts commit 106dacc2620126dedb99d2b981ba2e5a7d4591f9. This reverts commit f6697e30681f46f6f3f632ddbbcab98107eec7e0. These commits are more complicated than needed. A more simple solution is possible by tracking the registers that hold a certain constant and simply reusing that register when we can. We can then load the same constant in different registers of different sizes if needed.
2014-09-19parse: make contants per sizeWim Taymans2-14/+21
When we automatically create constants from the opcode arguments, make different constants per size and rewrite the program to use the newly created constant.
2014-09-19parse: fix opcode arg sizeWim Taymans1-2/+2
2014-09-19executor: use the size of the opcode arg to get multiplierWim Taymans1-4/+5
When loading a constant, select the multiplier based on the size of the opcode argument. This is safer because we have existing code that declares the constants of the wrong size.
2014-09-19executor: fully expand const vars into the temp registerWim Taymans1-0/+6
When loading a const in a register, always make it cover the full register so that it containts enough values to be used in x2 and x4 instructions.
2014-09-19parse: register constants with the right sizeWim Taymans1-4/+20
When we detect a constant while parsing a line, register it with the same size as the argument of the opcode.
2014-09-18program-c: handle X2 and X4 with size < 2 variablesWim Taymans1-8/+8
when the variable has a size < 2 it will have been declared as a simple int8 or int16, when we use this in a X2 or X4 instruction, use the variable directly instead of trying to use the x fields.
2014-09-18compiler: generate only 1 temp for constantsWim Taymans1-1/+11
Generate only 1 temp variable for constants. We do this by keeping track of what variable we used to replace the constant. Previously, orc would allocate a new temp variable every time a constant was used, this wastes registers and is not needed.
2014-09-18compiler: reuse _try_get_constant in _get_constantwork-baseWim Taymans1-27/+5
2014-09-17opcodes: avoid undefined operations on signed intsWim Taymans3-30/+31
Cast to unsigned int when doing addition and subtraction that can overflow. Cast to unsigned int when doing the lower part of a multiplication. Cast to unsigned int when doing left shifts into the sign bit. Regenerate the emulation code. This should avoid multiple warnings reported with clang and -fsanitize=undefined. See https://bugzilla.gnome.org/show_bug.cgi?id=728738
2014-09-17compiler: do << and | on unsigned ints onlyWim Taymans1-6/+7
2014-09-17compiler: avoid nagative array indexWim Taymans1-1/+1
For instructions that don't have a second variable, don't try to index the variable array with a -1 index.
2014-09-17utils: convert to uin32 before doing |Wim Taymans1-5/+4
In ORC_READ_UINT32_LE, convert each byte to uint32 before or-ing them together. This avoids | with signed ints.
2014-09-17docs: remove old env variableWim Taymans1-7/+0
ORC_CPU_FLAGS has been removed quite some time ago
2014-09-04TMPDIR becomes the last optionFabian Deutsch1-6/+6
Previously $TMPDIR and /tmp were the first options to try to use for intermediate files. To prevent name collisions, now user specific dirs ($HOME and $XDG_RUNTIME_DIR) are prefered over the user unspecific dirs ($TMP and /tmp). https://bugzilla.gnome.org/show_bug.cgi?id=735871
2014-08-27Back to developmentSebastian Dröge1-1/+1
2014-08-27Release 0.4.22Sebastian Dröge2-2/+13
2014-08-26Add fallback CPU feature detection for AndroidJan Schmidt1-67/+76
On Android, /proc/self/auxv might not be readable (except when debuggable=true in the build, annoyingly), so do what the android cpufeatures detection code does and fall back to /proc/cpuinfo string matching. Without this, release builds run really slowly, due to ORC always doing emulation.
2014-08-26Remove declarations for deleted functions from orcutils.hJan Schmidt1-3/+0
2014-08-26Detect android liblog and use android's log functions for debug outputJan Schmidt3-1/+53
2014-06-27orccompiler: free error messageThiago Santos1-0/+1
2014-06-27orcarray: Use size_t for pointer arithmeticsEdward Hervey1-1/+1
Fixes these warnings on windows x86_64: orcarray.c:80:33: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] orcarray.c:80:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
2014-06-23orccompiler: If compiling a program twice, first free the results of the ↵Sebastian Dröge1-0/+10
previous compilation
2014-06-23orcc: Fix some memory leaks in the compilerSebastian Dröge1-0/+7
2014-06-23autogen: Honor NOCONFIGURE=1Colin Walters1-1/+3
See https://github.com/cgwalters/build-api
2014-06-23Back to developmentSebastian Dröge1-1/+1
2014-06-23Release 0.4.21Sebastian Dröge2-2/+12
2014-06-23configure: Pass -version-info to libtool againSebastian Dröge1-1/+1
2014-06-23Back to developmentSebastian Dröge1-1/+1
2014-06-23Release 0.4.20Sebastian Dröge2-2/+15
2014-06-23build: Modernize autotools build systemSebastian Dröge12-203/+392
2014-06-06Add some checks on the number of variables per typeVincent Penquerc'h6-4/+174
We want to ensure no more than, say, 8 constants are added to a program. Adding more will violate pervasive assumptions in the code, and may lead to various buffer overflows. By trapping these add creation time, we prevent these issues without cluttering the code with range checks. The user is assumed non malicious here. Add a test to check we can add up to and including the limit for a type, but no more.
2014-06-05Update .gitignoreTim-Philipp Müller1-0/+9
2014-06-04orccodemem: fix list corruption when splitting memory chunks in twoTim-Philipp Müller1-1/+1
When splitting orc memory chunks in two, the 'prev' pointer of the new memory chunk to be inserted was wrong, causing invalid memory access and double frees later down the line. https://bugzilla.gnome.org/show_bug.cgi?id=731227
2014-05-20orc: Close file after usage in the copied around file reading functionSebastian Dröge8-0/+16
CID 1147011.
2014-05-19orcarray: Use fabs() instead of abs(), the latter is for integersSebastian Dröge1-1/+1
orcarray.c:254:15: error: using integer absolute value function 'abs' when argument is of floating point type [-Werror,-Wabsolute-value] if (abs(a[i] - b[i]) < MIN_NONDENORMAL_D) continue;
2014-04-25orcprogram-c: Convert shifts in swap opcodes to operations on unsigned integersSebastian Dröge3-8/+8
Shifting into the sign bit is undefined, so let's stop doing that.
2014-04-22memcpy_speed: Use unsigned integers, overflows are undefined for signed integersSebastian Dröge1-1/+1
2014-04-18Back to developmentSebastian Dröge1-1/+1
2014-04-18Release 0.4.19Sebastian Dröge4-17/+23
2014-04-17orccodemem: mask group/other bits for temporary fileVincent Penquerc'h1-0/+3
Ensures another user can't inject code into your process when winning a race with the ORC temp file code. Coverity 1147013
2014-04-16orcprogam-{mips,mmx,sse}: bail out if get_align_var failsVincent Penquerc'h3-0/+19
Coverity 1146979, 1146980, 1146977, 1146978, 1146973
2014-04-16orcprogram: bail out on errorVincent Penquerc'h1-0/+1
Coverity 1146972
2014-04-15orcbytecode: Don't replace program name without freeing the old name if anySebastian Dröge1-0/+3
2014-04-15orcc: Fix indention of generated codeSebastian Dröge1-6/+6
2014-04-15orc: Update autogenerated filesSebastian Dröge3-3/+47
2014-04-15orcprogram-c: Fix swaplq C implementationSebastian Dröge1-1/+1