summaryrefslogtreecommitdiff
path: root/regen
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2015-01-03 22:34:28 -0800
committerFather Chrysostomos <sprout@cpan.org>2015-01-31 22:03:51 -0800
commita9f19d0f50fa6980e7bdbcf691d81e40b2669a17 (patch)
tree3c8a704cf4b3702951650dd2733b13d7bc689930 /regen
parent448d2b66f6cf2d5395d6d8d4ae22812b489cb476 (diff)
downloadperl-a9f19d0f50fa6980e7bdbcf691d81e40b2669a17.tar.gz
Add OP_IS_INFIX_BIT
A convenience macro that a forthcoming commit will use.
Diffstat (limited to 'regen')
-rwxr-xr-xregen/opcode.pl5
-rw-r--r--regen/opcodes20
2 files changed, 14 insertions, 11 deletions
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