You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/learning-paths/servers-and-cloud-computing/sve2-match/sve2-match-search.md
+4-3Lines changed: 4 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,7 @@ int search_generic_u16(const uint16_t *hay, size_t n, const uint16_t *keys,
89
89
return 0;
90
90
}
91
91
```
92
+
The `search_generic_u8()` and `search_generic_u16()` functions both return 1 immediately when a match is found in the inner loop.
92
93
93
94
### 2. SVE2 MATCH Implementation
94
95
@@ -137,11 +138,11 @@ int search_sve2_match_u16(const uint16_t *hay, size_t n, const uint16_t *keys,
137
138
return 0;
138
139
}
139
140
```
140
-
The SVE2 MATCH implementation provides an efficient vectorized search approach with these key technical aspects:
141
+
The SVE MATCH implementation with the `search_sve2_match_u8()` and `search_sve2_match_u16()` functions provide an efficient vectorized search approach with these key technical aspects:
141
142
- Uses SVE2's specialized MATCH instruction to compare multiple elements against multiple keys in parallel
142
143
- Leverages hardware-specific vector length through svcntb() for scalability
143
144
- Prepares a vector of search keys that's compared against blocks of data
144
-
- Processes data in vector-sized chunks with early termination when matches are found
145
+
- Processes data in vector-sized chunks with early termination when matches are found. Stops immediately when any element in the vector matches.
145
146
- Falls back to scalar code for remainder elements
0 commit comments