Name

trans — DRA TDF to assembly translators

Synopsis

trans.* 

trans.* 

trans.* 

{ -h | -v }

Most options are common to all translators. For brevity, these are not repeated above:

        

[ -A name ] [ -B opt ] [ -C name ] [ -D ] [ -E name ] [ -F name ] [ -G switch ] [ -H opt ] [ -I ] [ -J ]
[ -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:

TranslatorBitsArchitecture
trans.alpha64Alpha AXP 21064
trans.hppa32HP PA-RISC
trans.m68k32Motorola 680x0
trans.mips32R3000 MIPS
trans.power32PPC 601 / POWER2
trans.sparc32Sun SPARC
trans.x8632Intel 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:

hpuxnextsunosscosvr4
svsvlinuxsolarisosf1icbs
mipspower
-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:

KeyDescription
+enable subsequent options (default)
-disable subsequent options
aall builtins
jsetjmp, longjmp
ppromotions
vvarargs
c~alloca
gdiagnostics
lAPI miscellany
minlined assembly
tdebugging miscellany
-C name

Specify the calling conventions for generated code. The supported calling conventions differ for each platform.

The available calling conventions are:

hpgccsunalphahppa
o32xlcsparcaout
-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.

KeyDescription
bBig-endian
lLittle-endian
-F name

Specify the executable format for generated code. The supported formats differ for each platform.

KeyDescription
aoutAssembler output
elfExecutable and Linkable Format (SVr4)
xcoffeXtended COFF (AIX)
somSystem Object Model (HP-UX)
machoMach-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).

KeyDescription
none
cvCodeView
gdb
xdb
stabs(or “stabs-in-elf” for -Felf)
stabx
xdb_old
xdb_new
dwarf1DWARF 1
dwarf2DWARF 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.

KeyDescription
+enable subsequent options (default)
-disable subsequent options
aall flags
dhas native long double
ohas byte operations
rhas byte registers
nhas negative shift
thas rotation
mhas max/min tags
chas condassign tag
dhas div0 and rem0 tags
shas setcc (produces absbool) tag
ihas native complex numbers
qhas 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:

OptionProcessor
-K380386
-K480486
-K5Pentium (default)

For trans.power, the supported values of str are:

OptionProcessor
-KCCommon POWERPc/POWER (default)
-KPPOWERPc
-KRrs6000

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.

KeyDescrption
+enable subsequent options (default)
-disable subsequent options
aall optimisations
choist constants out of loops
davoid register dumping
einlining of exp tokens
freplace loop indexes by incremented pointers
gperform case transformations
hpeephole substitutions
iinlining of proc tokens
jfollow gotos and tests to their final destinations
uloop unrolling
rtail recursion
srewrite conditions to use smallest neccessary integers
tuse temporary registers for local values
oremove zero offsets
palways substitute parameters
qreplace compounds in procs with assignments to variables
yremove 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.

gassunibmsgi
ultrixosf1hp
-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.

KeyDescription
+enable subsequent options (default)
-disable subsequent options
aall checks
sshape
eextra
fReport 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.

  1. [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.

KeyDescription
-d0Replace denormal const with 0.0 (don't do this)
-d1Error if denormal const is encountered
-d2Handle 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.

KeyDefaultDescription
in120inlines
dn6decs
an4decs at app
sprint 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.