summaryrefslogtreecommitdiff
path: root/parser.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-18 16:39:03 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-18 16:39:03 -0700
commit141d7cf68d60f6c77c078fea7ff85526db668c6f (patch)
treee5605799603d43038a2a4d095471a2e3f3a35a76 /parser.c
parent510a2508e6cb1298fa4640d6083e73c1c7ead06e (diff)
downloadnasm-141d7cf68d60f6c77c078fea7ff85526db668c6f.tar.gz
Support 16-bit IEEE floating point; used in SSE5
SSE5 supports standard IEEE 16-bit floating point, so we should support that too.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/parser.c b/parser.c
index ca12a097..69ae3790 100644
--- a/parser.c
+++ b/parser.c
@@ -230,30 +230,36 @@ insn *parse_line(int pass, char *buffer, insn * result,
if (i == TOKEN_FLOAT) {
eop->type = EOT_DB_STRING;
result->eops_float = TRUE;
- if (result->opcode == I_DD)
+ switch (result->opcode) {
+ case I_DW:
+ eop->stringlen = 2;
+ break;
+ case I_DD:
eop->stringlen = 4;
- else if (result->opcode == I_DQ)
+ break;
+ case I_DQ:
eop->stringlen = 8;
- else if (result->opcode == I_DT)
+ break;
+ case I_DT:
eop->stringlen = 10;
- else if (result->opcode == I_DO)
- eop->stringlen = 16;
- else {
+ break;
+ default:
error(ERR_NONFATAL, "floating-point constant"
- " encountered in `D%c' instruction",
- result->opcode == I_DW ? 'W' : 'B');
+ " encountered in `d%c' instruction"
+ ? (result->opcode == I_DO) ? 'o' : 'b');
/*
* fix suggested by Pedro Gimeno... original line
* was:
* eop->type = EOT_NOTHING;
*/
eop->stringlen = 0;
+ break;
}
eop = nasm_realloc(eop, sizeof(extop) + eop->stringlen);
tail = &eop->next;
*fixptr = eop;
eop->stringval = (char *)eop + sizeof(extop);
- if (eop->stringlen < 4 ||
+ if (!eop->stringlen ||
!float_const(tokval.t_charptr, sign,
(uint8_t *)eop->stringval,
eop->stringlen, error))