Skip to content

Commit

Permalink
fix alignment
Browse files Browse the repository at this point in the history
  • Loading branch information
camel-cdr committed Aug 19, 2024
1 parent 72b0b92 commit 0d8eee1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bench/mandelbrot.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ mandelbrot_rvv(size_t width, size_t maxIter, uint32_t *res)

#if HAS_F16
.global MX(mandelbrot_rvv_f16_) # generated by clang
.p2align 1
.balign 2
MX(rvv_f16_m1p5):
.half 0xbe00 # half -1.5
MX(rvv_f16_m1):
Expand Down Expand Up @@ -249,7 +249,7 @@ MX(rvv_f32_13):

#if MX_N == 2 && HAS_E64

.p2align 3
.balign 8
.global MX(mandelbrot_rvv_f64_) # generated by clang
MX(rvv_f64_m1p5):
.quad 0xbff8000000000000 # double -1.5
Expand Down
2 changes: 1 addition & 1 deletion instructions/rvv/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ all: rvv

rvv: gen.S main.c config.h
m4 gen.S > main.S
${CC} ${CFLAGS} -s main.S main.c -o $@
${CC} ${CFLAGS} main.S main.c -o $@
rm main.S

clean:
Expand Down
7 changes: 7 additions & 0 deletions instructions/rvv/gen.S
Original file line number Diff line number Diff line change
Expand Up @@ -350,36 +350,43 @@ define(`m_format',`$2 shift(shift($*))')
define(`m_gen_strings', `.string "m_format(,shift(shift(shift($*))))"')


.balign 8
define(`m_LMUL', 1)
.global bench_m`'m_LMUL
bench_m`'m_LMUL:
m_bench_all(`gen_function_pointers')

.balign 8
define(`m_LMUL', 2)
.global bench_m`'m_LMUL
bench_m`'m_LMUL:
m_bench_all(`gen_function_pointers')

.balign 8
define(`m_LMUL', 4)
.global bench_m`'m_LMUL
bench_m`'m_LMUL:
m_bench_all(`gen_function_pointers')

.balign 8
define(`m_LMUL', 8)
.global bench_m`'m_LMUL
bench_m`'m_LMUL:
m_bench_all(`gen_function_pointers')

pushdef(`m_ifmx',`m_ifmx_t($*)')

.balign 8
.global bench_types
bench_types:
m_bench_all(`gen_types')

.balign 8
.global bench_names
bench_names:
m_bench_all(`gen_strings')

.balign 8
define(`m_1p', 1+)
.global bench_count
bench_count:
Expand Down
2 changes: 2 additions & 0 deletions instructions/scalar/main.S
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ fabs.d fa0,fa0
#define defptr .dword
#endif

.balign 8
.global benchmarks
benchmarks:
.macro gen_function_pointers name setup code:vararg
Expand All @@ -310,6 +311,7 @@ defptr 0 # zero termination
.string "\code"
.endm

.balign 8
.global benchmark_names
benchmark_names:
m_benchmarks_all gen_strings
Expand Down
3 changes: 3 additions & 0 deletions instructions/xtheadvector/main.S
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ vmseq.vx v8, v0, t0



.balign 8
.global benchmarks
benchmarks:
.macro gen_function_pointers name type setup code:vararg
Expand All @@ -280,6 +281,7 @@ benchmarks:
m_benchmarks_all gen_function_pointers
.quad 0 # zero termination

.balign 8
.global benchmark_types
benchmark_types:
.macro gen_types name type setup code:vararg
Expand All @@ -299,6 +301,7 @@ m_benchmarks_all gen_types

m_benchmarks_all gen_strings

.balign 8
.global benchmark_names
benchmark_names:
m_benchmarks_all gen_string_arr
Expand Down

0 comments on commit 0d8eee1

Please sign in to comment.