From 2b420b633b59fecd2561eeec600f17160862175b Mon Sep 17 00:00:00 2001 From: Jim Cromie Date: Mon, 18 Apr 2011 14:05:35 -0600 Subject: implement OP_IS_NUMCOMPARE like other OP_IS macros other macros are written by regen/opcode.pl into opnames.h Generate OP_IS_NUMCOMPARE the same way, and get a micro-optimization. Adds a new 'S<' operand type for the numeric comparison ops. Needs make regen. --- regen/opcode.pl | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'regen/opcode.pl') diff --git a/regen/opcode.pl b/regen/opcode.pl index 791de9f4be..5e1cf62dc8 100755 --- a/regen/opcode.pl +++ b/regen/opcode.pl @@ -349,9 +349,10 @@ my %opflags = ( 'u' => 128, # defaults to $_ ); -my %OP_IS_SOCKET; -my %OP_IS_FILETEST; -my %OP_IS_FT_ACCESS; +my %OP_IS_SOCKET; # /Fs/ +my %OP_IS_FILETEST; # /F-/ +my %OP_IS_FT_ACCESS; # /F-+/ +my %OP_IS_NUMCOMPARE; # /S{$last} - $op_is->{$first} == scalar @rest + 1) { # contiguous ops -> optimized version - print $on "(op) >= OP_" . uc($first) . " && (op) <= OP_" . uc($last); - print $on ")\n"; + print $on "(op) >= OP_" . uc($first) + . " && (op) <= OP_" . uc($last); } else { print $on join(" || \\\n\t ", - map { "(op) == OP_" . uc() } sort keys %$op_is); - print $on ")\n"; + map { "(op) == OP_" . uc() } sort keys %$op_is); } + print $on ")\n"; } } -- cgit v1.2.1