Merge remote-tracking branch 'origin/nasm-2.14.xx'
Resolved Conflicts: asm/nasm.c version Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
commit
c77f5079e5
6 changed files with 80 additions and 21 deletions
|
@ -1,6 +1,6 @@
|
|||
/* ----------------------------------------------------------------------- *
|
||||
*
|
||||
* Copyright 1996-2017 The NASM Authors - All Rights Reserved
|
||||
* Copyright 1996-2018 The NASM Authors - All Rights Reserved
|
||||
* See the file AUTHORS included with the NASM distribution for
|
||||
* the specific copyright holders.
|
||||
*
|
||||
|
@ -549,14 +549,15 @@ static bool ieee_flconvert_bin(const char *string, int bits,
|
|||
}
|
||||
|
||||
if (seendigit) {
|
||||
if (ms <= 0) {
|
||||
*mp |= v >> -ms;
|
||||
if (ms < 0) {
|
||||
/* Cast to fp_2limb as ms == -LIMB_BITS is possible. */
|
||||
*mp |= (fp_2limb)v >> -ms;
|
||||
mp++;
|
||||
if (mp > &mult[MANT_LIMBS])
|
||||
mp = &mult[MANT_LIMBS]; /* Guard slot */
|
||||
ms += LIMB_BITS;
|
||||
}
|
||||
*mp |= v << (ms % (sizeof(fp_limb) * CHAR_BIT));
|
||||
*mp |= v << ms;
|
||||
ms -= bits;
|
||||
|
||||
if (!seendot)
|
||||
|
|
33
asm/nasm.c
33
asm/nasm.c
|
@ -136,9 +136,9 @@ static const struct forwrefinfo *forwref;
|
|||
static const struct preproc_ops *preproc;
|
||||
static struct strlist *include_path;
|
||||
|
||||
#define OP_NORMAL (1u << 0)
|
||||
#define OP_PREPROCESS (1u << 1)
|
||||
#define OP_DEPEND (1u << 2)
|
||||
#define OP_NORMAL (1U << 0)
|
||||
#define OP_PREPROCESS (1U << 1)
|
||||
#define OP_DEPEND (1U << 2)
|
||||
|
||||
static unsigned int operating_mode;
|
||||
|
||||
|
@ -508,9 +508,17 @@ int main(int argc, char **argv)
|
|||
/* Save away the default state of warnings */
|
||||
memcpy(warning_state_init, warning_state, sizeof warning_state);
|
||||
|
||||
/* Dependency filename if we are also doing other things */
|
||||
if (!depend_file && (operating_mode & ~OP_DEPEND)) {
|
||||
if (outname)
|
||||
depend_file = nasm_strcat(outname, ".d");
|
||||
else
|
||||
depend_file = filename_set_extension(inname, ".d");
|
||||
}
|
||||
|
||||
/*
|
||||
* If no output file name provided and this
|
||||
* is a preprocess mode, we're perfectly
|
||||
* is preprocess mode, we're perfectly
|
||||
* fine to output into stdout.
|
||||
*/
|
||||
if (!outname && !(operating_mode & OP_PREPROCESS)) {
|
||||
|
@ -518,18 +526,17 @@ int main(int argc, char **argv)
|
|||
if (!strcmp(outname, inname)) {
|
||||
outname = "nasm.out";
|
||||
nasm_error(ERR_WARNING,
|
||||
"default output file same as input `%s', using `%s' for output\n",
|
||||
inname, outname);
|
||||
"default output file same as input, using `%s' for output\n",
|
||||
outname);
|
||||
}
|
||||
}
|
||||
|
||||
if (depend_file || (operating_mode & OP_DEPEND))
|
||||
depend_list = strlist_alloc();
|
||||
depend_list = (operating_mode & OP_DEPEND) ? strlist_alloc() : NULL;
|
||||
|
||||
if (!depend_target)
|
||||
depend_target = quote_for_make(outname);
|
||||
|
||||
if (operating_mode & OP_DEPEND) {
|
||||
if (!(operating_mode & (OP_PREPROCESS|OP_NORMAL))) {
|
||||
char *line;
|
||||
|
||||
if (depend_missing_ok)
|
||||
|
@ -1076,9 +1083,11 @@ static bool process_arg(char *p, char *q, int pass)
|
|||
depend_emit_phony = true;
|
||||
break;
|
||||
case 'D':
|
||||
operating_mode = OP_NORMAL;
|
||||
depend_file = q;
|
||||
advance = true;
|
||||
operating_mode |= OP_DEPEND;
|
||||
if (q && (q[0] != '-' || q[1] == '\0')) {
|
||||
depend_file = q;
|
||||
advance = true;
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
depend_file = q;
|
||||
|
|
|
@ -16,6 +16,21 @@ given preprocessing directives (\c{-p}, \c{-d}, \c{-u}, \c{--pragma},
|
|||
\b If debugging is enabled, define a \c{__DEBUG_FORMAT__} predefined
|
||||
macro. See \k{dfmtm}.
|
||||
|
||||
\b Fix an assert for the case in the \c{obj} format when a \c{SEG}
|
||||
operator refers to an \c{EXTERN} symbol declared further down in the
|
||||
code.
|
||||
|
||||
\b Fix a corner case in the floating-point code where a binary, octal
|
||||
or hexadecimal floating-point having at least 32, 11, or 8 mantissa
|
||||
digits could produce slightly incorrect results under very specific
|
||||
conditions.
|
||||
|
||||
\b Support \c{-MD} without a filename, for \c{gcc}
|
||||
compatibility. \c{-MF} can be used to set the dependencies output
|
||||
filename. See \k{opt-MD}.
|
||||
|
||||
\b Fix \c{-E} in combination with \c{-MD}. See \k{opt-E}.
|
||||
|
||||
\S{cl-2.14} Version 2.14
|
||||
|
||||
\b Changed \c{-I} option semantics by adding a trailing path separator
|
||||
|
|
|
@ -496,6 +496,15 @@ updated dependencies with every assembly session. For example:
|
|||
|
||||
\c nasm -f elf -o myfile.o -MD myfile.dep myfile.asm
|
||||
|
||||
If the argument after \c{-MD} is an option rather than a filename,
|
||||
then the output filename is the first applicable one of:
|
||||
|
||||
\b the filename set in the \c{-MF} option;
|
||||
|
||||
\b the output filename from the \c{-o} option with \c{.d} appended;
|
||||
|
||||
\b the input filename with the extension set to \c{.d}.
|
||||
|
||||
|
||||
\S{opt-MT} The \i\c{-MT} Option: Dependency Target Name
|
||||
|
||||
|
|
|
@ -1900,8 +1900,8 @@ static int32_t obj_segbase(int32_t segment)
|
|||
if (eb) {
|
||||
e = eb->exts[i];
|
||||
if (!e) {
|
||||
nasm_assert(pass0 == 0);
|
||||
/* Not available - can happen during optimization */
|
||||
/* Not available yet, probably a forward reference */
|
||||
nasm_assert(pass0 < 2); /* Convergence failure */
|
||||
return NO_SEG;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,10 +5,10 @@
|
|||
;; encoding...
|
||||
|
||||
bits 64
|
||||
|
||||
|
||||
dd 1.1e10
|
||||
dd 0x5023e9ac ; Should be...
|
||||
|
||||
|
||||
dd 50.40e9
|
||||
dd 0x513bc130 ; Should be...
|
||||
|
||||
|
@ -21,11 +21,36 @@
|
|||
dt 1.2e28
|
||||
dq 0x9b18ab5df7180b6c
|
||||
dw 0x405c
|
||||
|
||||
|
||||
dt 50.46e25
|
||||
dq 0xd0b29a67e95dcb60
|
||||
dw 0x4057
|
||||
|
||||
do 0xf.ffffff8p-4
|
||||
do 0q3.7777777774p-2
|
||||
do 0b1.1111_1111_1111_1111_1111_1111_1111_111p-1
|
||||
|
||||
dt 0xf.ffffff8p-4
|
||||
dt 0q3.7777777774p-2
|
||||
dt 0b1.1111_1111_1111_1111_1111_1111_1111_111p-1
|
||||
|
||||
dq 0xf.ffffff8p-4
|
||||
dq 0q3.7777777774p-2
|
||||
dq 0b1.1111_1111_1111_1111_1111_1111_1111_111p-1
|
||||
|
||||
dd 0xf.ffffff8p-4
|
||||
dd 0q3.7777777774p-2
|
||||
dd 0b1.1111_1111_1111_1111_1111_1111_1111_111p-1
|
||||
|
||||
dw 0xf.ffffff8p-4
|
||||
dw 0q3.7777777774p-2
|
||||
dw 0b1.1111_1111_1111_1111_1111_1111_1111_111p-1
|
||||
|
||||
db 0xf.ffffff8p-4
|
||||
db 0q3.7777777774p-2
|
||||
db 0b1.1111_1111_1111_1111_1111_1111_1111_111p-1
|
||||
|
||||
|
||||
;; Way too big numbers, should overflow to +Inf
|
||||
dd 1.0E646456955
|
||||
dd 1.0E646456956
|
||||
|
|
Loading…
Reference in a new issue