Skip to content

Commit a65ecd9

Browse files
committed
Support parse -s (force sse)
1 parent 95dd33a commit a65ecd9

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

benchmark/parse.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,15 @@
3636
#include "simdjson/stage2_build_tape.h"
3737

3838
// Global arguments
39-
static bool find_marks_only = false;
39+
bool find_marks_only = false;
40+
bool verbose = false;
41+
bool dump = false;
42+
bool json_output = false;
43+
bool force_one_iteration = false;
44+
bool just_data = false;
45+
bool force_sse = false;
46+
int32_t iterations = -1;
47+
int32_t warmup_iterations = -1;
4048

4149
namespace simdjson {
4250
Architecture _find_best_supported_implementation() {
@@ -47,7 +55,7 @@ Architecture _find_best_supported_implementation() {
4755
instruction_set::SSE42 | instruction_set::PCLMULQDQ;
4856
uint32_t supports = detect_supported_architectures();
4957
// Order from best to worst (within architecture)
50-
if ((haswell_flags & supports) == haswell_flags) {
58+
if ((haswell_flags & supports) == haswell_flags && !force_sse) {
5159
return Architecture::HASWELL;
5260
}
5361
if ((westmere_flags & supports) == westmere_flags) {
@@ -125,25 +133,21 @@ unified_functype *unified_ptr = &unified_machine_dispatch;
125133
} // namespace simdjson
126134

127135
int main(int argc, char *argv[]) {
128-
bool verbose = false;
129-
bool dump = false;
130-
bool json_output = false;
131-
bool force_one_iteration = false;
132-
bool just_data = false;
133-
int32_t iterations = -1;
134-
int32_t warmup_iterations = -1;
135136

136137
#ifndef _MSC_VER
137138
int c;
138139

139-
while ((c = getopt(argc, argv, "1vdtn:w:f")) != -1) {
140+
while ((c = getopt(argc, argv, "1vdtn:w:fs")) != -1) {
140141
switch (c) {
141142
case 'n':
142143
iterations = atoi(optarg);
143144
break;
144145
case 'w':
145146
warmup_iterations = atoi(optarg);
146147
break;
148+
case 's':
149+
force_sse = true;
150+
break;
147151
case 't':
148152
just_data = true;
149153
break;

0 commit comments

Comments
 (0)