Tool copt
suborb edited this page Jan 20, 2019
·
2 revisions
The zcc command automatically involves the copt optimizer. The level of optimization is defined by the "-O<n>
" flag, in which <n>
defines the number of passes and consequently the quantity of rules wich will be applied.
The optimization level is '2', level '3' is optimised for size
zcc -O3 [flags] [files to be compiled/linked]
Excluding the optimizer (-O0) is also possible and can be useful when tracing bugs.
The ruleset files are located in:
{z88dk}/lib/z80rules.2
{z88dk}/lib/z80rules.1
{z88dk}/lib/z80rules.0
Every rule is separated by a blank line. Then a number of 'matching lines' is defined along with a 'transformed block, separated by the equal sign:
ld hl,%1 ;const
ld (%2),hl
ld hl,0 ;const
=
ld hl,%1 ;const
ld (%2),hl
The compiler generated code includes comments which help the rules avoiding to be too aggressive.
jr z,ASMPC+3
scf
call c,%2
=
call nz,%2
- Overview
- Platform List
- Unsupported Platforms
- i8080/5 Support
- Homebrew hardware quickstart
- Retargetting
- Building the libraries
- Clang support
- Pragmas
- Adding to Classic
- Introduction
- Library Configuration
- CRT
- Header Files
- Assembly Language
- Library in Depth
- Embedded Platform
- Adding to NewLib
- Benchmarks
- Datatypes
- Debugging
- Decompression
- More than 64k
- Deficiencies
- Compiling Larger Applications
- Importing routines written in 8080 assembly mnemonics
- Using CP/M libraries in REL format with z88dk
- Writing optimal code
- Speeding up Compilation
- CMake usage