Skip to content

Commit 5976ec7

Browse files
committed
add pass
1 parent e501828 commit 5976ec7

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

system/lib/libc/emscripten_memcpy.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ static void *__memcpy(void *dest, const void *src, size_t n) {
2222
#elif defined(__wasm_bulk_memory__)
2323

2424
static void *__memcpy(void *restrict dest, const void *restrict src, size_t n) {
25+
/* if (!n) return dest;
26+
__asm__("local.get %0; local.get %1; local.get %2; memory.copy 0, 0"
27+
:
28+
: "r"(dest), "r"(src), "r"(n));
29+
return dest; */
2530
return n ? _emscripten_memcpy_bulkmem(dest, src, n) : dest;
2631
}
2732

test/benchmark/benchmark_memcpy.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
// found in the LICENSE file.
55

66
#include <string.h>
7+
#include <stdint.h>
78
#include <stdio.h>
89
#include <stdlib.h>
910
#include <vector>

test/test_benchmark.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ def do_benchmark(self, name, src, expected_output='FAIL', args=None,
436436
emcc_args=None, native_args=None, shared_args=None,
437437
force_c=False, reps=TEST_REPS, native_exec=None,
438438
output_parser=None, args_processor=None, lib_builder=None,
439-
skip_native=False):
439+
skip_native=True):
440440
if not benchmarkers:
441441
raise Exception('error, no benchmarkers')
442442

@@ -909,31 +909,31 @@ def output_parser(output):
909909
def test_memcpy_128b(self):
910910
def output_parser(output):
911911
return float(re.search(r'Total time: ([\d\.]+)', output).group(1))
912-
self.do_benchmark('memcpy_128b', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-DMAX_COPY=128', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
912+
self.do_benchmark('memcpy_128b', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-mbulk-memory', '-DMAX_COPY=128', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
913913

914914
@non_core
915915
def test_memcpy_4k(self):
916916
def output_parser(output):
917917
return float(re.search(r'Total time: ([\d\.]+)', output).group(1))
918-
self.do_benchmark('memcpy_4k', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-DMIN_COPY=128', '-DMAX_COPY=4096', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
918+
self.do_benchmark('memcpy_4k', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-mbulk-memory','-DMIN_COPY=128', '-DMAX_COPY=4096', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
919919

920920
@non_core
921921
def test_memcpy_16k(self):
922922
def output_parser(output):
923923
return float(re.search(r'Total time: ([\d\.]+)', output).group(1))
924-
self.do_benchmark('memcpy_16k', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-DMIN_COPY=4096', '-DMAX_COPY=16384', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
924+
self.do_benchmark('memcpy_16k', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-mbulk-memory','-DMIN_COPY=4096', '-DMAX_COPY=16384', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
925925

926926
@non_core
927927
def test_memcpy_1mb(self):
928928
def output_parser(output):
929929
return float(re.search(r'Total time: ([\d\.]+)', output).group(1))
930-
self.do_benchmark('memcpy_1mb', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-DMIN_COPY=16384', '-DMAX_COPY=1048576', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
930+
self.do_benchmark('memcpy_1mb', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-mbulk-memory','-DMIN_COPY=16384', '-DMAX_COPY=1048576', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
931931

932932
@non_core
933933
def test_memcpy_16mb(self):
934934
def output_parser(output):
935935
return float(re.search(r'Total time: ([\d\.]+)', output).group(1))
936-
self.do_benchmark('memcpy_16mb', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-DMIN_COPY=1048576', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
936+
self.do_benchmark('memcpy_16mb', read_file(test_file('benchmark/benchmark_memcpy.cpp')), 'Total time:', output_parser=output_parser, shared_args=['-mbulk-memory','-DMIN_COPY=1048576', '-DBUILD_FOR_SHELL', '-I' + test_file('benchmark')])
937937

938938
@non_core
939939
def test_memset_128b(self):

test/test_other.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10226,6 +10226,7 @@ def test_separate_dwarf(self):
1022610226
# with name sections but no code sections.
1022710227
# if sec.type == webassembly.SecType.CODE:
1022810228
# self.fail(f'section of type "{sec.type}" found in separate dwarf file')
10229+
pass
1022910230

1023010231
# Check that dwarfdump can dump the debug info
1023110232
dwdump = self.run_process(

0 commit comments

Comments
 (0)