summaryrefslogtreecommitdiff
path: root/eval.c
AgeCommit message (Collapse)AuthorFilesLines
2013-12-11mib: Handle MIB EA in a different way from regular EA'sJin Kyu Song1-1/+4
In mib operands, users' intention should be preserved. e.g.) [eax + eax*1] and [eax*2] must be distinguished and encoded differently. So a new EA flag EAF_MIB for mib operands is added. And a new EA hint EAH_SUMMED for the case of [eax+eax*4] being parsed as [eax*5] is also added. NOSPLIT specifier does not have an effect in mib, so [nosplit eax + eax*1] will be encoded as [eax, eax] rather than [eax*2] as in a regular EA. Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com>
2013-08-06AVX-512: Add support for parsing bracesJin Kyu Song1-0/+4
AVX-512 introduced new syntax using braces for decorators. Opmask, broadcat, rounding control use this new syntax. http://software.intel.com/sites/default/files/319433-015.pdf Signed-off-by: Jin Kyu Song <jin.kyu.song@intel.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2013-02-18eval: Use is_power2 helper instead of open codeCyrill Gorcunov1-2/+2
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2012-05-31eval: add general support for "integer functions" and add ilog2*()H. Peter Anvin1-2/+50
Add general support in the function parser for "integer functions" (actually implemented as special unary operators, then wrapped in macros) and implement a family of integer logarithms. The only difference is the behavior on a non-power-of-two argument: ilog2[e] -- throw an error ilog2w -- throw a warning ilog2f -- round down to power of 2 ilog2c -- round up to power of 2 This is useful for back-converting from masks to bit values. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2010-11-06eval: rexp3 should operate with 64bit numbersCyrill Gorcunov1-1/+1
reloc_value returns 64bit numbers but we strip it down to 'int' which causes problems if the former value is big enough to overflow 'int'. Fix it. [ BR3104312 ] Reported-by: Christian Masloch Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2010-09-10eval.c: Use OPFLAG_FORWARD instead of opencoded numberCyrill Gorcunov1-1/+1
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-10-31Various tab/space/comment cleanupCyrill Gorcunov1-52/+51
No change on binary level Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
2009-07-06NASM: relicense under the 2-clause BSD licenseH. Peter Anvin1-12/+0
*To the best of my knowledge*, we now have authorization from everyone who has significantly contributed to NASM in the past. As such, change the license to the 2-clause BSD license. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-06-28Add copyright headers to the *.c/*.h files in the main directoryH. Peter Anvin1-6/+45
Add copyright headers to the *.c/*.h files in the main directory. For files where I'm sure enough that we have all the approvals, I have given them the 2-BSD license, the others have been given the "LGPL for now" license header. Most of them can probably be changed after auditing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2008-07-16fix unitialized variable in eval_strfuncVictor van den Elzen1-0/+1
2008-06-14Support __utf16__ and __utf32__ in an expression contextH. Peter Anvin1-0/+45
Support __utf16__ and __utf32__ in expression contexts.
2008-06-09Make strings a first-class token type; defer evaluationH. Peter Anvin1-0/+9
Make strings a proper, first-class token type, instead of relying on the "TOKEN_NUM with tv_charptr" hack. Only convert a string to a number if requested in an expression context; this also makes it possible to actually issue a warning when it overflows.
2008-03-12Display fully qualified local label in "not defined" messageCharles Crayne1-4/+6
Add new function "local_scope" to label subsystem to return the previous non-local label for a given local label, and invoke this funcion in eval.c to display the fully qualified name in the "not defined" error message.
2007-12-29regularized spelling of license to match name of LICENSE fileBeroset1-1/+1
2007-11-05Upgrade label functions to 64-bitCharles Crayne1-1/+2
2007-11-04Permit opcode names as labels as long as they are followed by a colonH. Peter Anvin1-2/+5
Permit opcode names to be used as labels if and only if they are succeeded by a colon. Opcode names occurring when parsing expressions are all treated as labels; a leading colon occurred when parsing an instruction forces a parser restart with the instruction forcibly treated as an identifier.
2007-10-29Use a 32-bit floating-point limb size; support 8-bit floatH. Peter Anvin1-0/+1
Use a 32-bit limb size ("like a digit, but bigger") for floating-point conversion. This cuts the number of multiplications per constant by a factor of four. This means supporting fractional-limb-sized numbers, so while we're at it, add support for 8-bit floating point numbers (apparently used in graphics and in audio compression applications.)
2007-10-19Formatting: kill off "stealth whitespace"H. Peter Anvin1-1/+1
"Stealth whitespace" makes it harder to read diffs, and just generally cause unwanted weirdness. Do a source-wide pass to get rid of it.
2007-10-13Fix 32-bit types in preproc.c and eval.cKeith Kanios1-16/+16
Fix 32-bit types in preproc.c and eval.c that should have been 64-bit types. This allows %assign to work correctly with 64-bit integers.
2007-10-10Use the compiler-provided booleans if available, otherwise emulateH. Peter Anvin1-9/+9
Both C and C++ have "bool", "true" and "false" in lower case; C requires <stdbool.h> for this, in C++ it is an inherent type built into the compiler. Use those instead of the old macros; emulate with a simple typedef enum if unavailable.
2007-10-03Change cloc_t to struct location, and reorder the membersH. Peter Anvin1-2/+2
Change cloc_t to struct location, and reorder the members so that it should fit in 16 bytes instead of needing 8 bytes of extra padding on 64-bit machines.
2007-10-03BR 1352920: change loc_t -> cloc_tH. Peter Anvin1-2/+2
Change loc_t to cloc_t to avoid AIX conflict. We really shouldn't use _t names at all; they are usually considered platform types, but worry about that later.
2007-10-02Portability fixesH. Peter Anvin1-0/+2
Concentrate compiler dependencies to compiler.h; make sure compiler.h is included first in every .c file (since some prototypes may depend on the presence of feature request macros.) Actually use the conditional inclusion of various functions (totally broken in previous releases.)
2007-09-24Support __float*__ for floating-point numbers in expressionsH. Peter Anvin1-0/+59
Add special operators to allow the use of floating-point constants in contexts other than DW/DD/DQ/DT/DO. As part of this checkin, make MAX_KEYWORD generated by tokhash.pl, since it knows what all the keywords are so it can tell which one is the longest.
2007-09-24eval.c: replace sequence of ifs with switchH. Peter Anvin1-9/+21
Replace a sequence of "if" statements with a switch.
2007-05-02Allow '!' to be used in expressions with same meaning as in C.Chuck Crayne1-0/+13
2007-04-12General push for x86-64 support, dubbed 0.99.00.Keith Kanios1-25/+26
2005-01-15Apply Nindent to all .c and .h filesH. Peter Anvin1-501/+478
2002-05-27Correct handling of SEG <nonsegment>; per BR 560575H. Peter Anvin1-0/+2
2002-05-26Handle $ and $$ in ABSOLUTE sectionsH. Peter Anvin1-3/+7
2002-04-30NASM 0.98.03H. Peter Anvin1-2/+2
2002-04-30NASM 0.98p3.2H. Peter Anvin1-19/+10
2002-04-30NASM 0.98p3H. Peter Anvin1-87/+154
2002-04-30NASM 0.96H. Peter Anvin1-0/+761