This chapter documents the backend for the Atari Jaguar GPU/DSP RISC processor.

Legal
=====

This module is written in 2014-2017,2020,2021,2024 by Frank Wille and is covered by the vasm copyright without modifications.

Additional options for this module
==================================

This module provides the following additional options:

-big
     Output big-endian code and data (default).

-little
     Output little-endian code and data.

-many
     Generate code for GPU or DSP RISC. All instructions are accepted (default).

-mdsp
-mjerry
     Generate code for the DSP RISC (part of Jerry).

-mgpu
-mtom
     Generate code for the GPU RISC (part of Tom).

General
=======

This backend accepts RISC instructions for the GPU or DSP in Atari's Jaguar custom chip set according to the "Jaguar Technical Reference Manual for Tom & Jerry", Revision 8. Documentation bugs were fixed by using various sources on the net.

The target address type is 32 bits.

Default alignment for instructions is 2 bytes. Data is aligned to its natural alignment by default.

Optimizations
=============

This backend performs the following optimizations and translations for the GPU/DSP RISC instruction set:

  - load (Rn+0),Rm is optimized to load (Rn),Rm.

  - store Rn,(Rm+0) is optimized to store Rn,(Rm).

Extensions
==========

This backend extends the selected syntax module by the following directives (note that a leading dot is optional):

<symbol> ccdef <expression>
     Allows defining a symbol for the condition codes used in jump and jr instructions. Must be constant number in the range of 0 to 31 or another condition code symbol.

ccundef <symbol>
     Undefine a condition code symbol previously defined via ccdef.

dsp
     Select DSP instruction set.

<symbol> equr <Rn>
     Define a new symbol named <symbol> and assign the address register Rn to it. <Rn> may also be another register symbol. Note that a register symbol must be defined before it can be used.

equrundef <symbol>
     Undefine a register symbol previously defined via equr.

gpu
     Select GPU instruction set.

<symbol> regequ <Rn>
     Equivalent to equr.

regundef <symbol>
     Undefine a register symbol previously defined via regequ.

All directives may be optionally preceded by a dot (.), for compatibility with various syntax modules.

Known Problems
==============

Some known problems of this module at the moment:

  - Encoding of MOVEI instruction in little-endian mode is unknown.

  - The developer has to provide the necessary NOP instructions after jumps, or OR instructions to work around hardware bugs, her/himself.

Error Messages
==============

This module has the following error messages:

  - 2001: data size %d not supported

  - 2002: value from %ld to %ld required