summaryrefslogtreecommitdiff
path: root/nasm.c
Commit message (Collapse)AuthorAgeFilesLines
* ctype.h: wrapper ctype functions with a cast to (unsigned char)H. Peter Anvin2008-06-211-12/+12
| | | | | | | | | ctype functions take an *int*, which the user is expected to have taken the input character from getc() and friends, or taken a character and cast it to (unsigned char). We don't care about EOF (-1), so use macros that cast to (unsigned char) for us.
* Make -F imply -g (BR 1991213)H. Peter Anvin2008-06-111-0/+1
| | | | | When the user specifies -F, imply the -g option. Too many users seem to make this mistake.
* Use an explicit table for tolower() to avoid a function callH. Peter Anvin2008-06-111-0/+2
| | | | | | | | | | On some platforms, tolower() is implemented as a function call, in order to handle locale support. We never change locales, so can the result of tolower() into a table, so we don't have to sit through the function call every time. ~1.3% overall performance improvement on a macro-heavy benchmark under Linux x86-64.
* Add %warning, saner unquoting of %errorH. Peter Anvin2008-06-101-1/+3
| | | | | | | - Add %warning directive - Only unquote an %error or %warning string if it is the only thing on the directive line. - Don't expand macros inside a quoted string, even for %error.
* Move all the RAA code out of nasmlibH. Peter Anvin2008-06-091-0/+1
| | | | | The RAA code doesn't have to be in nasmlib; it is only used by nasm itself, and is better handled in a separate module.
* Move all the SAA code out of nasmlibH. Peter Anvin2008-06-091-0/+1
| | | | | | Move all the SAA code out of nasmlib; it's not used by anything than nasm itself. Cleaning out the kitchen sink known as nasmlib is a good thing, too.
* Add the -MP option to emit phony targetsH. Peter Anvin2008-05-291-36/+69
| | | | | | | Add the -MP option to emit phony targets. Since this means each header file has to be visited more than once, change the implementation to use an internal list of all the dependencies, and centralize the emission of the dependency files.
* Implement -MD, -MF, -MT, -MQH. Peter Anvin2008-05-291-16/+165
| | | | | | | | | Implement the dependency options: -MF: set the file to which dependencies are written. -MD: generate dependencies in parallel with compilation. -MT: set the name of the dependency target. -MQ: same as -MT, but *attempt* to quote it for Makefile safety.
* Add DY, YWORD, and the SY instruction flagH. Peter Anvin2008-05-201-0/+13
| | | | | Add the DY instruction, YWORD keyword, and an SY marker for instruction sizes. Add a few more AVX sample instructions.
* First cut at AVX machinery.H. Peter Anvin2008-05-041-6/+6
| | | | | | | | | First cut at AVX machinery support. The only instruction implemented is VPERMIL2PS, and it's probably buggy. I'm checking this in with the hope that other people can start helping out with (a) testing this, and (b) adding instructions. NDISASM support is not there yet.
* BR 774131: date and time macrosH. Peter Anvin2008-02-161-6/+86
| | | | | | | | | | | This checkin creates the following date and time macros: __DATE__, __TIME__, __UTC_DATE__, __UTC_TIME__: strings __DATE_NUM__, __TIME_NUM__, __UTC_DATE_NUM__, __UTC_TIME_NUM__: civil dates in digit-string formats __POSIX_TIME__: time in POSIX time_t format
* Ignore ERR_PASS1 except for actual warningsH. Peter Anvin2008-01-221-10/+7
| | | | | | | is_suppressed_warning() should never return true unless we're actually dealing with a warning. There is a handful of cases where we pass ERR_PASS1 down together with errors, but that's mostly because it fits into an overall pattern. Thus, ignore it.
* nasm.c: clean up the handing of response filesH. Peter Anvin2008-01-211-13/+15
| | | | | Avoid using malloc/free (not nasm_malloc/nasm_free even) in the processing of response files; move to separate function.
* Remove debugging printfH. Peter Anvin2008-01-131-2/+0
| | | | Remove debugging printf which shouldn't ever have been checked in ;)
* Sanitize the pass logic, and only issue PASS1 warnings on pass0 == 1H. Peter Anvin2008-01-081-33/+29
| | | | | | For PASS1 warnings, only do them when pass0 == 1. The prior passes are to be considered training passes. This is a bit awkward if we then hit an error, but it's better than n repeated warnings.
* Remove magic "five pass minimum" - I'm pretty sure optimizer is fixed.H. Peter Anvin2008-01-081-5/+1
| | | | | | The five-pass-minimum was a hack for a bug which I think is identified now. Doesn't really change the fact that if you want the optimizer, you probably want -Ox.
* Optimizer: force progression through final passes when hitting limitH. Peter Anvin2008-01-081-2/+3
| | | | | | | | We have a number of bug reports about things not working properly when the optimizer is running out of passes. I suspect the reason is simply that we don't properly execute the final passes (pass0 = 1, 2) when hitting the limit. Make sure we advance pass0 the last few times.
* regularized spelling of license to match name of LICENSE fileBeroset2007-12-291-1/+1
|
* BR 1834731: Remove redundant error messages for no input fileH. Peter Anvin2007-11-191-4/+3
| | | | | | | | | | | Avoid redundant error messages: ./nasm nasm: error: no input file specified nasm: fatal: file `' is both input and output file type `nasm -h' for help ... which is more than a wee bit confusing to the user.
* BR 1091926: Bounds checking for command line parsingH. Peter Anvin2007-11-181-6/+20
| | | | Avoid failure if the command line has doctored arguments.
* Clean up the command-line parsing; make -w/-W match othersH. Peter Anvin2007-11-151-117/+146
| | | | | Clean up the command-line parsing and make -w/-W match the behaviour of all the other options with regards to arguments.
* Enable a few warnings by default; clean up warning descriptionsH. Peter Anvin2007-11-131-4/+4
|
* Add gcc-style -W/-Wno- warning selections; -Wall; -WerrorH. Peter Anvin2007-11-131-21/+41
| | | | | | | | | Add gcc-style -Wxxx -Wno-xxx warning selection as an alternative to -w+xxx/-w-xxx. Add "all" as an alias for all (actual) warnings. Add "error" to treat warnings as errors.
* Address data is int64_t; simplify writing an address objectH. Peter Anvin2007-11-131-2/+2
| | | | | | | Address data is always int64_t even if the size itself is smaller; this was broken on bigendian hosts (still need testing!) Create simple "write sized object" macros.
* Upgrade RAA functions to hold 64-bit data.Charles Crayne2007-11-071-2/+3
|
* Formatting: kill off "stealth whitespace"H. Peter Anvin2007-10-191-18/+18
| | | | | "Stealth whitespace" makes it harder to read diffs, and just generally cause unwanted weirdness. Do a source-wide pass to get rid of it.
* Suppress a few signedness warningsCharles Crayne2007-10-181-1/+1
|
* Implement floating-point option control directiveH. Peter Anvin2007-10-161-3/+10
| | | | | New directive [FLOAT] with associated standard macros; allows the setting to be saved and restored.
* Floating-point warning fixes; fix round-to-overflowH. Peter Anvin2007-10-161-2/+2
| | | | | | | | Actually generate the appropriate floating-point warnings, and only one per assembly, pretty please. Correct the round-to-overflow condition; as written all numbers with a positive exponent were considered overflows!
* Handle rounding of denorms correctly; make fp overflow a warningH. Peter Anvin2007-10-161-6/+10
| | | | | | - Handle rounding of denorms correctly - Make fp overflow a warning, not an error (produces Inf) - Make fp warnings controllable
* Additional uses of bool and enumH. Peter Anvin2007-10-111-8/+10
| | | | | | Proper use of bool and enum makes code easier to debug. Do more of it. In particular, we really should stomp out any residual uses of magic constants that aren't enums or, in some cases, even #defines.
* Use the compiler-provided booleans if available, otherwise emulateH. Peter Anvin2007-10-101-35/+35
| | | | | | | 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.
* Create option -Ox to tell NASM to do unlimited passesH. Peter Anvin2007-10-101-29/+43
| | | | | Add option -Ox to tell NASM to do as many passes as it needs, instead of imposing a fixed number.
* Rewrite the handling of SAA's to allow random accessH. Peter Anvin2007-10-041-1/+1
| | | | | | | | SAA's were never intended to allow random access, but several backends do random or semirandom access via saa_fread() and saa_fwrite() anyway. Rewrite the SAA system to allow for efficient random access. On "label.pl 10000000" this improves performance by a factor of 12.
* Change cloc_t to struct location, and reorder the membersH. Peter Anvin2007-10-031-1/+1
| | | | | | 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.
* BR 1352920: change loc_t -> cloc_tH. Peter Anvin2007-10-031-1/+1
| | | | | | 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.
* BR 1352920: Handle upper case %lineH. Peter Anvin2007-10-031-1/+1
|
* Portability fixesH. Peter Anvin2007-10-021-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.)
* Unspecified files are null strings, not null pointersH. Peter Anvin2007-10-011-4/+2
| | | | | We use empty strings, not null pointers, for unspecified files, so there is no need to compare them for nullness.
* Check for the most basic filename overlapsH. Peter Anvin2007-10-011-10/+19
| | | | | Check for the most basic filename overlaps, in case we have the opportunity to save the user from himself.
* modified: nasm.1 to add newer command line optionsCharles Crayne2007-09-301-8/+14
| | | | modified: nasm.c to fully parse command line before redirecting stderr.
* nasm option reshuffling, -E -> -ZH. Peter Anvin2007-09-261-7/+6
| | | | | | Old -E becomes -Z New -E is alias for -e Remove the obsolete -r option
* Fix BR 1445441: uninitialized use of "error_file"H. Peter Anvin2007-09-251-2/+2
|
* Implement the -MG option (SF RFE 1564264)H. Peter Anvin2007-09-241-3/+8
| | | | | | Implement the -MG option, to generate dependencies in the presence of generated files. In the end, we probably need to support the full gamut of GCC-like dependency-generation options.
* Add TY_OWORD for "DO" outputH. Peter Anvin2007-09-221-0/+3
|
* Disallow optimizing by less than 5 passes.H. Peter Anvin2007-09-221-2/+6
| | | | | Disallow optimizing by less than 5 passes. If the user requests 2-4 passes, run 5 passes anyway.
* Finishing touches on perfect hash tokenizer; actually turn the thing onH. Peter Anvin2007-08-301-1/+2
| | | | | | | | | Finish the perfect hash tokenizer, and actually enable it. Move stdscan() et al to a separate file, since it's not needed in any of the clients of nasmlib other than nasm itself. Run make alldeps.
* Add [default] directiveH. Peter Anvin2007-08-291-37/+51
| | | | Add the [default {abs|rel}] directive, and clean up directive parsing.
* Implement REL/ABS modifiersH. Peter Anvin2007-08-281-0/+1
| | | | | | Implement "REL" and "ABS" modifiers for offsets in 64-bit mode. This replaces "rip+XXX" type addressing. The infrastructure to set the default mode is there, but there is nothing to throw the switch just yet.
* Clean up the existing operand flag definitions, and documentH. Peter Anvin2007-05-291-4/+5
|