Added alignment option

This commit is contained in:
Sergio Martin 2024-01-14 10:13:28 +01:00
parent c18b91c70e
commit f88932e368
3 changed files with 12 additions and 4 deletions

View File

@ -17,7 +17,6 @@ Changes
+ Forced alignment at the start of a page to prevent crossing cache line boundaries
+ Simplifying instruction decode
- Minimize compiled code size to reduce pressure on L1i cache
- Sound is no longer emulated during skip frames
Credits
=========

View File

@ -5,8 +5,7 @@ project('quickerNES','c','cpp',
)
# Getting page alignment
getConfCommand = run_command('getconf', 'PAGESIZE', check: true)
pageSize = getConfCommand.stdout().strip()
pageSize = get_option('CPUFunctionAlignment')
# quickerNES Core sources
@ -45,7 +44,7 @@ quickerNESCoreSrc = [
# quickerNES Core Configuration
quickerNESCoreDependency = declare_dependency(
compile_args : [ '-Wfatal-errors', '-Wall', '-Werror', '-Wno-multichar', '-D_PAGE_SIZE="' + pageSize + '"'],
compile_args : [ '-Wfatal-errors', '-Wall', '-Werror', '-Wno-multichar', '-D_PAGE_SIZE="' + pageSize.to_string() + '"'],
include_directories : include_directories(['source', 'source/core', 'extern']),
sources : [ quickerNESCoreSrc, 'extern/metrohash128/metrohash128.cpp' ]
)

View File

@ -3,4 +3,14 @@ option('buildTests',
value : false,
description : 'Build test suite',
yield: true
)
option('CPUFunctionAlignment',
type : 'integer',
min : 1,
value : 4096,
description : '''Indicates the alignment for the main emulator CPU function.
This is a large function that may cross page boundaries, which impacts performance.
We recommend setting this value for the architecture own page size.
This requires the GNU compiler to work.'''
)