mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-10-10 00:25:06 -04:00
Work through a number of changes toward making matching a lot saner, both to reduce the number of patterns to generate for APX but also to make a number of code patterns simpler. This replaces a fair number of byte codes. Improve a number of error messages, especially related to overflows. Move process_insn() from nasm.c to assemble.c, as it really is the primary entry point to the assembler module. Reorder some prefixes. In particular, F2/F3 override 66 when used as a mandatory prefix, so it makes more sense for them to be closer to the opcode. Move a lot more information into struct insn. It is better to have it in one place; memory consumption is not an issue because struct insn is transient information. Get rid of "optimization levels" and replace it with a mask of flags. That was already halfway done; complete the job. Replace seg:offset in struct out_data with a struct location. It would be better to extend this to more places, too. The ARx and SMx flags are now explicit bitmasks, instead of having a couple of hard-coded ranges. Add __func__ to assert or panic messages. Because of prefix and message changes, a number of travis tests had to be audited and updated. Fix a number of instruction patterns which had .128 when they ought to be .lig. This is no longer a minor issue with the disassembler: for AVX10, the pattern vector length determines how SAE/RC are encoded, and there is no valid 128-bit encoding. However, with .lig the 512-bit encoding can be used. Separate "o64nw" into two pieces: opsize 64 and "nw" = "REX.w not necessary". The latter can be included in non-64-bit patterns. "o64" still set REX.W since that is still the common thing. New "osz" bytecode: emit an OSP *or* REX.W depending on the current mode and operand size. Useful for special cases like "nop" where "o64 nop" probably wants to be encoded as "48 90". Signed-off-by: H. Peter Anvin <hpa@zytor.com>
35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
dnl --------------------------------------------------------------------------
|
|
dnl PA_HAVE_FUNC_NAME
|
|
dnl
|
|
dnl See if the C compiler supports __func__ or __FUNCTION__.
|
|
dnl --------------------------------------------------------------------------
|
|
AC_DEFUN([PA_HAVE_FUNC_NAME],
|
|
[AC_CACHE_CHECK([for function name constant], [pa_cv_func_name],
|
|
[pa_cv_func_name=no
|
|
for pa_try_func_name in __func__ __FUNCTION__
|
|
do :
|
|
AS_IF([test $pa_cv_func_name = no],
|
|
[AC_LINK_IFELSE([AC_LANG_SOURCE([
|
|
AC_INCLUDES_DEFAULT
|
|
const char *test_func_name(void);
|
|
const char *test_func_name(void)
|
|
{
|
|
return $pa_try_func_name;
|
|
}
|
|
int main(void) {
|
|
puts(test_func_name());
|
|
return 0;
|
|
}
|
|
])],
|
|
[pa_cv_func_name=$pa_try_func_name])])
|
|
done
|
|
])
|
|
AS_IF([test $pa_cv_func_name = no],
|
|
[],
|
|
[AC_DEFINE([HAVE_FUNC_NAME], 1,
|
|
[Define to 1 if the compiler supports __func__ or equivalent.])
|
|
AS_IF([test $pa_cv_func_name = __func__],
|
|
[],
|
|
[AC_DEFINE_UNQUOTED([__func__], [$pa_cv_func_name],
|
|
[Define if __func__ is called something else on your compiler.])])])])
|