summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opnames.h3
-rwxr-xr-xregen/opcode.pl5
-rw-r--r--regen/opcodes20
3 files changed, 17 insertions, 11 deletions
diff --git a/opnames.h b/opnames.h
index e68c8ca6a1..c225ac42c0 100644
--- a/opnames.h
+++ b/opnames.h
@@ -436,4 +436,7 @@ typedef enum opcode {
#define OP_IS_DIRHOP(op) \
((op) >= OP_READDIR && (op) <= OP_CLOSEDIR)
+#define OP_IS_INFIX_BIT(op) \
+ ((op) >= OP_BIT_AND && (op) <= OP_SBIT_OR)
+
/* ex: set ro: */
diff --git a/regen/opcode.pl b/regen/opcode.pl
index 765816fd50..fe105846d6 100755
--- a/regen/opcode.pl
+++ b/regen/opcode.pl
@@ -1136,6 +1136,7 @@ my %OP_IS_FILETEST; # /F-/
my %OP_IS_FT_ACCESS; # /F-+/
my %OP_IS_NUMCOMPARE; # /S</
my %OP_IS_DIRHOP; # /Fd/
+my %OP_IS_INFIX_BIT; # /S\|/
my $OCSHIFT = 8;
my $OASHIFT = 12;
@@ -1165,8 +1166,9 @@ for my $op (@ops) {
$OP_IS_FILETEST{$op} = $opnum{$op} if $arg =~ s/-//;
$OP_IS_FT_ACCESS{$op} = $opnum{$op} if $arg =~ s/\+//;
}
- elsif ($arg =~ /^S</) {
+ elsif ($arg =~ /^S./) {
$OP_IS_NUMCOMPARE{$op} = $opnum{$op} if $arg =~ s/<//;
+ $OP_IS_INFIX_BIT {$op} = $opnum{$op} if $arg =~ s/\|//;
}
my $argnum = ($arg =~ s/\?//) ? 8 : 0;
die "op = $op, arg = $arg\n"
@@ -1206,6 +1208,7 @@ gen_op_is_macro( \%OP_IS_FILETEST, 'OP_IS_FILETEST');
gen_op_is_macro( \%OP_IS_FT_ACCESS, 'OP_IS_FILETEST_ACCESS');
gen_op_is_macro( \%OP_IS_NUMCOMPARE, 'OP_IS_NUMCOMPARE');
gen_op_is_macro( \%OP_IS_DIRHOP, 'OP_IS_DIRHOP');
+gen_op_is_macro( \%OP_IS_INFIX_BIT, 'OP_IS_INFIX_BIT');
sub gen_op_is_macro {
my ($op_is, $macname) = @_;
diff --git a/regen/opcodes b/regen/opcodes
index 614a54c439..cbf38dce50 100644
--- a/regen/opcodes
+++ b/regen/opcodes
@@ -31,7 +31,7 @@
# scalar - S list - L array - A
# hash - H sub (CV) - C file - F
# socket - Fs filetest - F- filetest_access - F-+
-# num-compare - S< dirhandle - DF
+# num-compare - S< dirhandle - DF infix bitwise - S|
# reference - R
# "?" denotes an optional operand.
@@ -162,15 +162,15 @@ seq string eq ck_null ifs2 S S
sne string ne ck_null ifs2 S S
scmp string comparison (cmp) ck_null ifsT2 S S
-bit_and bitwise and (&) ck_bitop fst2 S S
-bit_xor bitwise xor (^) ck_bitop fst2 S S
-bit_or bitwise or (|) ck_bitop fst2 S S
-nbit_and numeric bitiwse and (&) ck_bitop fsT2 S S
-nbit_xor numeric bitwise xor (^) ck_bitop fsT2 S S
-nbit_or numeric bitwise or (|) ck_bitop fsT2 S S
-sbit_and string bitiwse and (&) ck_bitop fst2 S S
-sbit_xor string bitwise xor (^) ck_bitop fst2 S S
-sbit_or string bitwise or (|) ck_bitop fst2 S S
+bit_and bitwise and (&) ck_bitop fst2 S S|
+bit_xor bitwise xor (^) ck_bitop fst2 S S|
+bit_or bitwise or (|) ck_bitop fst2 S S|
+nbit_and numeric bitiwse and (&) ck_bitop fsT2 S S|
+nbit_xor numeric bitwise xor (^) ck_bitop fsT2 S S|
+nbit_or numeric bitwise or (|) ck_bitop fsT2 S S|
+sbit_and string bitiwse and (&) ck_bitop fst2 S S|
+sbit_xor string bitwise xor (^) ck_bitop fst2 S S|
+sbit_or string bitwise or (|) ck_bitop fst2 S S|
negate negation (-) ck_null Ifst1 S
i_negate integer negation (-) ck_null ifst1 S