@@ -3374,8 +3374,6 @@ to bit-strings of the same width:
3374
3374
3375
3375
Bit-strings also support the following operations:
3376
3376
3377
- - Concatenation of two bit-strings, denoted by the infix operator `++`. The result is a bit-string whose
3378
- length is the sum of the lengths of the inputs where the most significant bits are taken from the left operand.
3379
3377
- Extraction of a set of contiguous bits, also known as a slice, denoted by `[m:l]`,
3380
3378
where `m` and `l` must be positive integers
3381
3379
that are compile-time known values, and `m >= l`. The result is
@@ -3470,6 +3468,14 @@ type. The result always has the same width as the left operand.
3470
3468
bit-pattern represented by `x`, and leaves all other bits of `e`
3471
3469
unchanged. A slice of a signed integer is treated like an unsigned integer.
3472
3470
3471
+ ### Concatenation { #sec-concatenation }
3472
+
3473
+ Concatenation is applied to two bit-strings (signed or unsigned). It
3474
+ is denoted by the infix operator `++`. The result is a bit-string
3475
+ whose length is the sum of the lengths of the inputs where the most
3476
+ significant bits are taken from the left operand; the sign of the
3477
+ result is taken from the left operand.
3478
+
3473
3479
### A note about shifts
3474
3480
3475
3481
Shifts (on signed and unsigned values) deserve a special discussion
@@ -7776,6 +7782,7 @@ The P4 compiler should provide:
7776
7782
* Added structured annotations (Section [#sec-annotations]).
7777
7783
* Allow empty statements in parsers (Section [#sec-parser-state-stmt]).
7778
7784
* Fixed grammar for right shifts (Section [#sec-grammar]).
7785
+ * Allow concatenation of signed strings (Section [#sec-concatenation]).
7779
7786
7780
7787
## Summary of changes made in version 1.2.0
7781
7788
0 commit comments