mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-31 18:20:22 +08:00
move is_register helper to nasm.h
H. Peter Anvin noted: | | Could we avoid putting static code that has no dynamic content in | dynamically generated files... it just complicates things unnecessarily. | | The above can move into nasm.h for example. | Good idea. CC: "H. Peter Anvin" <hpa@zytor.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
2124b7b7dc
commit
a38b86aecf
6
nasm.h
6
nasm.h
@ -421,6 +421,12 @@ enum {
|
||||
/* Register names automatically generated from regs.dat */
|
||||
#include "regs.h"
|
||||
|
||||
/* verify value to be register */
|
||||
static inline int is_register(int reg)
|
||||
{
|
||||
return reg >= EXPR_REG_START && reg < REG_ENUM_LIMIT;
|
||||
}
|
||||
|
||||
enum ccode { /* condition code names */
|
||||
C_A, C_AE, C_B, C_BE, C_C, C_E, C_G, C_GE, C_L, C_LE, C_NA, C_NAE,
|
||||
C_NB, C_NBE, C_NC, C_NE, C_NG, C_NGE, C_NL, C_NLE, C_NO, C_NP,
|
||||
|
7
regs.pl
7
regs.pl
@ -134,13 +134,6 @@ if ( $fmt eq 'h' ) {
|
||||
foreach $reg ( sort(keys(%regs)) ) {
|
||||
printf "#define %-15s %2d\n", "REG_NUM_\U${reg}", $regvals{$reg};
|
||||
}
|
||||
|
||||
print "\n";
|
||||
print "static inline int is_register(int reg)\n";
|
||||
print "{\n";
|
||||
print " return reg >= EXPR_REG_START && reg < REG_ENUM_LIMIT;\n";
|
||||
print "}\n";
|
||||
|
||||
print "\n\n#endif /* NASM_REGS_H */\n";
|
||||
} elsif ( $fmt eq 'c' ) {
|
||||
# Output regs.c
|
||||
|
Loading…
x
Reference in New Issue
Block a user