summaryrefslogtreecommitdiff
path: root/compiler/llvm/itllvm.pas
blob: fb7709c167993ebac69983cb5ecdaaf028a4c277 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{
    Copyright (c) 2013 by Jonas Maebe

    This unit contains the LLVM instruction tables

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

 ****************************************************************************
}
unit itllvm;

{$i fpcdefs.inc}

interface

    uses
      llvmbase, cgbase;

    const
      llvm_op2str : llvmop2strtable = ('',
        { terminator instructions }
        'ret', 'br', 'switch', 'indirectbr',
        'invoke', 'resume',
        'unreachable',
        { binary operations }
        'add', 'fadd', 'sub', 'fsub', 'mul', 'fmul',
        'udiv','sdiv', 'fdiv', 'urem', 'srem', 'frem',
        { bitwise binary operations }
        'shl', 'lshr', 'ashr', 'and', 'or', 'xor',
        { vector operations }
        'extractelement', 'insertelement', 'shufflevector',
        { aggregate operations }
        'extractvalue', 'insertvalue',
        { memory access and memory addressing operations }
        'alloca',
        'load', 'store',
        'fence', 'cmpxchg', 'atomicrmw',
        'getelementptr',
        { conversion operations }
        'trunc', 'zext', 'sext', 'fptrunc', 'fpext',
        'fptoui', 'fptosi', 'uitofp', 'sitofp',
        'ptrtoint', 'inttoptr',
        'bitcast',
        { other operations }
        'icmp', 'fcmp',
        'phi', 'select', 'call',
        'va_arg', 'landingpad',
        'blockaddress',
        { fpc pseudo opcodes }
        'type', { type definition }
        'catch', { catch exception }
        'filter', { exception filter }
        'cleanup', { exception cleanup/finally }
        'invalid1', { la_x_to_inttoptr }
        'invalid2', { la_ptrtoint_to_x }
        'asm' { la_asmblock }
      );

      llvm_cond2str : array[topcmp] of ansistring = ('',
        'eq',
        'sgt',
        'slt',
        'sge',
        'sle',
        'ne',
        'ule',
        'ult',
        'uge',
        'ugt'
      );

      llvm_fpcond2str: array[tllvmfpcmp] of ansistring = (
      'invalid',
      'false',
      'oeq', 'ogt', 'oge', 'olt', 'ole', 'one', 'ord',
      'ueq', 'ugt', 'uge', 'ult', 'ule', 'une', 'uno',
      'true');


implementation

end.