Name
trans — DRA TDF to assembly translators
Synopsis
trans.*
trans.*
trans.*
Most options are common to all translators. For brevity, these are not repeated above:
[ -K name ] [ -M ] [ -N ] [ -O opt ] [ -Q ] [ -R ] [ -S name ] [ -T ] [ -V ] [ -X opt ] [ -v ] [ -h ]
The options denoted by a capital letter are common to the TDF installers for all the architectures, although the defaults vary for each translator. In addition, lowercase options are specific to each translator.
Description
The code production portion of the TDF compiler is under the control of a TDF translator, which translates a TDF capsule into assembly.
There are separate TDF translators for each target architecture. The various different translators are referred to collectively as trans. The translators are:
Translator | Bits | Architecture |
---|---|---|
trans.alpha | 64 | Alpha AXP 21064 |
trans.hppa | 32 | HP PA-RISC |
trans.m68k | 32 | Motorola 680x0 |
trans.mips | 32 | R3000 MIPS |
trans.power | 32 | PPC 601 / POWER2 |
trans.sparc | 32 | Sun SPARC |
trans.x86 | 32 | Intel 80x86 |
It is recommended that trans should not be invoked directly, but via the user interface tcc. -opt can be passed to trans by passing the option -Wt,-opt to tcc.
Options
- -A name
-
Specify the ABI for generated code. The supported ABIs differ for each platform.
The available ABIs are:
hpux
next
sunos
sco
svr4
svsv
linux
solaris
osf1
icbs
mips
power
- -B opt
-
opt is a set of characters describing the categories of constructs which are to be generated as built-in instructions.
For some categories here the alternative is to emit a library call instead. Some features are provided as builtins where they are not possible as library calls. When these features are disabled, an attempt to use their corresponding tags in the input TDF will cause translation to fail.
The available categories are:
Key Description +
enable subsequent options (default) -
disable subsequent options a
all builtins j
setjmp
,longjmp
p
promotions v
varargs c
~alloca
g
diagnostics l
API miscellany m
inlined assembly t
debugging miscellany - -C name
-
Specify the calling conventions for generated code. The supported calling conventions differ for each platform.
The available calling conventions are:
hp
gcc
sun
alpha
hppa
o32
xlc
sparc
aout
- -D
-
This option determines whether trans should produce Position Independent Code (PIC).
For all translators where it is supported, except trans.mips, this is not done by default.
For trans.x86, this option is not supported on the SCO or DragonFly platforms, and on the Linux platform it is supported only for ELF binary format.
For trans.hppa, the translator-specific option -d name is also provided. The -D flag emulates cc(1)'s +Z flag, -d emulates cc(1)'s +z flag. Neither option has yet been tested.
For trans.mips, this is done by default in the IRIX version and not at all in the ULTRIX version.
- -E name
-
Specify the endianness for generated code. The supported endiannesses differ for each platform.
Key Description b
Big-endian l
Little-endian - -F name
-
Specify the executable format for generated code. The supported formats differ for each platform.
Key Description aout
Assembler output elf
Executable and Linkable Format (SVr4) xcoff
eXtended COFF (AIX) som
System Object Model (HP-UX) macho
Mach-O (NeXTSTEP) - -G switch
-
Specify the format for debugging symbols output in the generated code. These are generated from diagnostic tags in the input TDF capsule. The supported formats differ for each platform and for each version of TDF diagnostic tags which is present in the capsule.
Note that full run-time diagnostic information cannot be transmitted through the MIPS assembler, as(1).
Key Description none
cv
CodeView gdb
xdb
stabs
(or “stabs-in-elf” for -Felf) stabx
xdb_old
xdb_new
dwarf1
DWARF 1 dwarf2
DWARF 2 This option causes trans to output debugging information in its output file. This will only work if the input TDF capsule contains debugging information.
For trans.x86, on the SCO platform the format used by dbxtra(1) and codeview is supported. On the SVR4.2 platform Dwarf 1 is supported, which is used by debug(1). On the Solaris, DragonFly, and Linux platforms, stabs is supported. The GNU debugger gdb(1) may be used on all platforms.
For trans.hppa, the -H flag causes hppatrans to output xdb(1) compatible debugging information in its output file. This option is only available if the header file hpux_symtab.h was included whilst compiling trans.hppa.[a]
Please note well that there is a known bug in the -H option for trans.hppa. The bug sometimes prohibits xdb(1) reading selective diagnostic information from a suite of two or more modules linked together.
For trans.mips the diagnostic format used is as used by the native compilers.
For trans.sparc, the diagnostic format used is stabs for SunOS, and stabs-in-elf for Solaris (both as used by the native compilers).
Debugging information is not output by default for all translators.
- -H opt
-
opt is a set of characters describing the various features a platform “has”. These are provided here to allow for disabling certian constructs where desirable.
Key Description +
enable subsequent options (default) -
disable subsequent options a
all flags d
has native long double
o
has byte operations r
has byte registers n
has negative shift t
has rotation m
has max
/min
tagsc
has condassign
tagd
has div0
andrem0
tagss
has setcc
(producesabsbool
) tagi
has native complex numbers q
has native 64 bit operations - -h
-
Causes trans to print command-line usage help.
- -I
-
Produce comments in the generated assembly.
- -J
-
Disable extended diagnostics. (DWARF 2 only)
- -K name
-
Causes trans to emit instructions for a particular processor model, determined by str.
For trans.x86, the supported values of str are:
Option Processor -K3
80386 -K4
80486 -K5
Pentium (default) For trans.power, the supported values of str are:
Option Processor -KC
Common POWERPc/POWER (default) -KP
POWERPc -KR
rs6000 At present there are no valid values for str for other translators.
- -N
-
Produce PROM code (avoiding
.data
). - -M
-
If this option is on, trans preserves division by a floating point number rather than replacing it by multiplication by the reciprocal of the number. While the latter produces faster code, it may lead to rounding errors.
For all translators, by default, division by constants is preserved.
- -O opt
-
opt is a set of characters describing the categories of optimisations to apply.
All trans' optimisations are believed to be valid, so any error in optimisation is a genuine bug.
Key Descrption +
enable subsequent options (default) -
disable subsequent options a
all optimisations c
hoist constants out of loops d
avoid register dumping e
inlining of exp tokens f
replace loop indexes by incremented pointers g
perform case transformations h
peephole substitutions i
inlining of proc tokens j
follow gotos and tests to their final destinations u
loop unrolling r
tail recursion s
rewrite conditions to use smallest neccessary integers t
use temporary registers for local values o
remove zero offsets p
always substitute parameters q
replace compounds in procs with assignments to variables y
remove operations where input is identical to output - -P
-
This option causes trans to output profiling information suitable for use with prof/gprof(1) or a similar tool (see individual manual pages for details).
On trans.x86, this option is currently not supported on the Solaris platform.
On trans.alpha, this is not fully implemented.
On trans.mips, this option is untested at present, and should not be used.
Profiling information is not output by default for all translators.
- -Q
-
This option causes trans to quit before processing its input files. This is particularly useful in conjunction with -V.
For all translators, this is not done by default.
- -R
-
Round after each floating point operation.
- -S name
-
Specify the assembler dialect for generated code. The supported dialects differ for each platform.
gas
sun
ibm
sgi
ultrix
osf1
hp
- -T
-
Disable
debug_abbrev
section. (DWARF 2 only) - -V
- -v
-
This option causes trans to print its version number and the version of the TDF specification it supports.
For all translators, this is not done by default.
- -W
-
This option determines whether trans should make string literals writable. At present the C producer does not make use of this facility.
For all translators, at present all string literals are writable, and this cannot be altered.
- -X opt
-
opt is a set of characters describing the categories of checking to perform on the input TDF capsule. These checks can help identify invalid TDF, and should never fail for a valid capsule.
Key Description +
enable subsequent options (default) -
disable subsequent options a
all checks s
shape e
extra f
Report floating point constants which exceed their range. If this check switched off such constants are replaced by infinity. - -Y
-
Produce calls for dynamic initialisation.
- -Z
-
This option causes trans to print the version number of all the TDF capsules it decodes.
For all translators, this is not done by default.
- [a]
hpux_symtab.h is available by anonymous FTP, but appears to have changed location over time. Your best option is to simply google for it.
Translator-specific options
The following options are specific to trans.alpha:
- -u
-
Use
umulh
for divisions. - -s
-
Produce binasm output.
- -d opt
-
Handle IEEE denormals specially.
Key Description -d0
Replace denormal const with 0.0
(don't do this)-d1
Error if denormal const is encountered -d2
Handle denormals properly (and slowly), by stopping the interleaving of floating point operations and using the OS exception handler (default)
The following options are specific to trans.hppa:
- -d
-
This emulates cc(1)'s +Z flag.
- -i
-
Do indexed loads.
The following options are specific to trans.m68k:
- -a
-
Do not produce align directives.
- -f
-
Emit floats as a bit pattern, rather than as a value.
- -i
-
Output immediately.
- -u
-
Translate units separately.
The following options are specific to trans.mips:
- -e
-
Try to identify global pointers in procedures.
The following options are specific to trans.power:
- -e
-
Don't jump on traps.
- -m
-
Normally registers are given numerically. This option use macros for register names instead, to help with readability.
- -n
-
Produce calls for dynamic initialisation.
The following options are specific to trans.sparc:
- -b
-
Produce output for the SysV assembler.
- -g
-
Do not output special routines.
- -l
-
Use library functions for special routines.
- -i optn
-
Set crit thresholds.
Key Default Description i
n120 inlines d
n6 decs a
n4 decs at app s
– print current thresholds - -m
-
Make general procs compatible.
- -n
-
Produce calls for dynamic initialisation.
- -o n
-
Set the as(1)
.optim
optimisation level. n may be from 0 to 4 inclusive. - -r n
-
Set the number of
G
registers. n may be from 4 to 7 inclusive. - -u
-
Translate units separately.
The following options are specific to trans.x86:
- -a
-
Always use a frame pointer. The default is to avoid using a frame pointer whenever possible. The default results in better performance, but in special cases where the stack is to be processed it may be necessary to enforce the use of a frame pointer.
- -b
-
All variables visible in registers.
- -c
-
Do not use C definitions of promote.
- -d
-
Normally procs which return structs are rewritten to take a pointer to the struct as an extra parameter. The -d option disables this rewriting.
- -f
-
Set the null pointer representation to
0x55555555
. - -g
-
Treat floating points as always comparable.
- -h
-
Do not use the
.bss
segment, always put data into the.data
segment even if it is zero. This should very rarely be needed. The default is to use the.bss
segment. - -i
-
Print inlining to standard error as it occurs.
- -t opt
-
When opt is 1, produce GCC-compatible output for a.out systems.
- -v
-
Do not use software interrupts.
See Also
as(1), prof/gprof(1), tcc.