0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-11-08 23:27:15 -05:00

Make Watcom workarounds a little less obnoxious

Duplicated code is asking for trouble. Make the Watcom brain damage
workarounds at least patternized.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel)
2025-10-13 21:08:20 -07:00
parent e86773d70b
commit f520436a7a
2 changed files with 41 additions and 94 deletions

View File

@@ -3107,24 +3107,10 @@ static enum match_result matches(const struct itemplate * const itemp,
/*
* If this is an *explicitly* sized immediate,
* allow it to match an extending pattern.
*
* NOTE: Open Watcom does not support 64-bit constants
* in switch statements; do not change this to a switch.
*/
#ifndef __WATCOMC__
switch (isize[i]) {
case BITS8:
if (ttype & BYTEEXTMASK) {
isize[i] = tsize[i];
itype[i] |= BYTEEXTMASK;
}
break;
case BITS32:
if (ttype & DWORDEXTMASK)
isize[i] = tsize[i];
break;
default:
break;
}
#else
/* Open Watcom does not support 64-bit constants at *case*. */
if (isize[i] == BITS8) {
if (ttype & BYTEEXTMASK) {
isize[i] = tsize[i];
@@ -3134,7 +3120,6 @@ static enum match_result matches(const struct itemplate * const itemp,
if (ttype & DWORDEXTMASK)
isize[i] = tsize[i];
}
#endif
/*
* MOST instructions which take an sdword64 are the only form;