tools/x264_perf_O3: support to disable loop vectorize optimization for get_ref #1

Merged
lyc merged 3 commits from x264-o3-disable into main 2025-04-27 19:19:35 +08:00
Showing only changes of commit db474163ea - Show all commits

View File

@@ -3,37 +3,55 @@ from subprocess import run
import click import click
from speccpu import create_spec_env, get_benchspec_dir, x264 from speccpu import create_spec_env, find_build, get_benchspec_dir, x264
from speccpu.flaglib.perf import record as recordflags from speccpu.flaglib.perf import record as recordflags
@click.command() @click.command()
@click.option( @click.option(
"--disable-get-ref-vectorize", "--get-ref-vectorize/--no-get-ref-vectorize",
type=bool, default=True,
default=False,
help="Enable or disable MC vectorization", help="Enable or disable MC vectorization",
) )
@click.option( @click.option(
"--spec", "--spec",
type=Path, type=click.Path(),
help="Path to SPEC CPU directory", help="Path to SPEC CPU directory",
required=True,
) )
def main(disable_get_ref_vectorize: bool, spec: Path): @click.option(
x264_run_id = "c56635a4-9f49-4d2b-be79-38d9e08097c5" "--x264-run-id",
x264_outputroot = Path("/home/lyc/work-ts/local/specOutput") / x264_run_id type=str,
required=True,
x264_dir = get_benchspec_dir(x264_outputroot) / "625.x264_s" )
@click.option(
"--outputroot",
type=click.Path(),
required=True,
)
def main(
get_ref_vectorize: bool,
spec,
x264_run_id: str,
outputroot,
):
outputroot = Path(outputroot)
spec = Path(spec)
x264_dir = get_benchspec_dir(outputroot / x264_run_id) / "625.x264_s"
x264_run = x264_dir / "run" / "run_base_refspeed_mytest-m64.0000" x264_run = x264_dir / "run" / "run_base_refspeed_mytest-m64.0000"
x264_exe = x264_run / "x264_s_base.mytest-m64" x264_exe = x264_run / "x264_s_base.mytest-m64"
if disable_get_ref_vectorize: mc_builder = x264.MCBuilder()
mc_src = x264.MCBuilder().with_disabled_vectorize_get_ref().build()
x264_exe = x264.recompile_mc_src(
mc_src, x264_dir / "build", create_spec_env(spec)
)
if not get_ref_vectorize:
mc_builder.with_disabled_vectorize_get_ref()
x264_exe = x264.recompile_mc_src(
mc_builder.build(),
find_build(x264_dir / "build"),
create_spec_env(spec),
)
run( run(
[ [
"perf", "perf",