OpenCores
URL https://opencores.org/ocsvn/altor32/altor32/trunk

Subversion Repositories altor32

[/] [altor32/] [trunk/] [gcc-x64/] [or1knd-elf/] [or1knd-elf/] [include/] [or1k-asm.h] - Blame information for rev 35

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 35 ultra_embe
#ifndef OR1K_ASM_H
2
#define OR1K_ASM_H
3
 
4
/* The purpose of the OR1K_INST macro is simply to protect the commas
5
   embedded within an instruction from the C preprocessor.  An entire
6
   instruction can be safely embedded within its arguments, including
7
   an arbitrary number of commas, and it will be reproduced
8
   exactly. */
9
#define OR1K_INST(...) __VA_ARGS__
10
 
11
/* OR1K_DELAYED takes two arguments which must be instructions.  They
12
   should be wrapped in OR1K_INST if the instructions require commas.
13
   The second argument should be a jump or branch instruction.  If we
14
   are assembling the code in delay-slot mode (e.g., for the standard
15
   OR1K) the first instruction will be emitted in the delay slot of
16
   the second instruction.  In no-delay-slot mode they will be emitted
17
   in order.  If we are using compat-delay mode, they will be emitted
18
   in order, but an l.nop instruction will be emitted immediately
19
   after. */
20
 
21
/* OR1K_DELAYED_NOP takes a single argument, which should be a
22
   branch/jump instruction.  In delay-slot or compat-delay modes, the
23
   instruction will be emitted with an l.nop in its delay slot. In
24
   no-delay mode, the instruction will be emitted by itself. */
25
 
26
#if defined(__OR1K_NODELAY__)
27
 
28
#define OR1K_DELAYED(a, b) a; b
29
#define OR1K_DELAYED_NOP(a) a
30
 
31
/* Go ahead and emit the .nodelay directive when in no-delay mode, so
32
   that the flags are appropriately set in the binary. */
33
.nodelay
34
 
35
#elif defined(__OR1K_DELAY__)
36
 
37
#define OR1K_DELAYED(a, b) b; a
38
#define OR1K_DELAYED_NOP(a) a; l.nop
39
 
40
#elif defined(__OR1K_DELAY_COMPAT__)
41
 
42
#define OR1K_DELAYED(a, b) a; b; l.nop
43
#define OR1K_DELAYED_NOP(a) a; l.nop
44
 
45
#else
46
 
47
#error One of __OR1K_NODELAY__, __OR1K_DELAY__, or __OR1K_DELAY_COMPAT__ must be defined
48
 
49
#endif
50
 
51
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.