From: Cyrill Gorcunov Date: Sat, 24 Jul 2010 21:10:17 +0000 (+0400) Subject: regs.pl: Introduce is_register() helper X-Git-Tag: nasm-2.11.05~569 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=79699d8edae5e56df5c35be151b7fc1f436c1ed9;p=platform%2Fupstream%2Fnasm.git regs.pl: Introduce is_register() helper Instead of opencoded check use inline helper. Signed-off-by: Cyrill Gorcunov --- diff --git a/regs.pl b/regs.pl index 82c4829..e6350f9 100755 --- a/regs.pl +++ b/regs.pl @@ -134,6 +134,13 @@ 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