Start anew
[msysgit.git] / share / vim / vim58 / syntax / ia64.vim
blobe3d7284684ce04ba1ee28ec440df59931ec80c9e
1 " Vim syntax file
2 " Language:     IA-64 (Itanium) assembly language
3 " Maintainer:   Parth Malwankar <parth.malwankar@usa.net>
4 " URL:          http://www.geocities.com/pmalwankar (Home Page with link to my Vim page)
5 "               http://www.geocities.com/pmalwankar/vim.htm (for VIM)
6 " File Version: 0.5
7 " Last Change:  2001 May 10
9 " For version 5.x: Clear all syntax items
10 " For version 6.x: Quit when a syntax file was already loaded
11 if version < 600
12   syntax clear
13 elseif exists("b:current_syntax")
14   finish
15 endif
18 "ignore case for assembly
19 syn case ignore
21 "  Identifier Keyword characters (defines \k)
22 if version >= 600
23         setlocal iskeyword=@,48-57,#,$,.,:,?,@-@,_,~
24 else
25         set iskeyword=@,48-57,#,$,.,:,?,@-@,_,~
26 endif
28 syn sync minlines=5
30 " Read the MASM syntax to start with
31 " This is needed as both IA-64 as well as IA-32 instructions are supported
32 source <sfile>:p:h/masm.vim
34 syn region  ia64Comment start="//" end="$" contains=ia64Todo
35 syn match ia64Identifier        "[a-zA-Z_$][a-zA-Z0-9_$]*"
36 syn match ia64Directive         "\.[a-z][a-z]\+"
37 syn match ia64Label             "[a-zA-Z_$][a-zA-Z0-9_$]*\s\=:\>"he=e-1
38 syn match ia64Label             "[a-zA-Z_$][a-zA-Z0-9_$]*\s\=::\>"he=e-2
39 syn match ia64Label             "[a-zA-Z_$][a-zA-Z0-9_$]*\s\=#\>"he=e-1
40 syn region ia64string           start=+L\="+ skip=+\\\\\|\\"+ end=+"+
41 syn match ia64Octal             "0[0-7_]*\>"
42 syn match ia64Binary            "0[bB][01_]*\>"
43 syn match ia64Hex               "0[xX][0-9a-fA-F_]*\>"
44 syn match ia64Decimal           "[1-9_][0-9_]*\>"
45 syn match ia64Float             "[0-9_]*\.[0-9_]*\([eE][+-]\=[0-9_]*\)\=\>"
47 "simple instructions
48 syn keyword ia64opcode add adds addl addp4 alloc and andcm cover epc
49 syn keyword ia64opcode fabs fand fandcm fc flushrs fneg fnegabs for
50 syn keyword ia64opcode fpabs fpack fpneg fpnegabs fselect fand fabdcm
51 syn keyword ia64opcode fc fwb fxor loadrs movl mux1 mux2 or padd4
52 syn keyword ia64opcode pavgsub1 pavgsub2 popcnt psad1 pshl2 pshl4 pshladd2
53 syn keyword ia64opcode pshradd2 psub4 rfi rsm rum shl shladd shladdp4
54 syn keyword ia64opcode shrp ssm sub sum sync.i tak thash
55 syn keyword ia64opcode tpa ttag xor
57 "put to override these being recognized as floats. They are orignally from masm.vim
58 "put here to avoid confusion with float
59 syn match   ia64Directive       "\.186"
60 syn match   ia64Directive       "\.286"
61 syn match   ia64Directive       "\.286c"
62 syn match   ia64Directive       "\.286p"
63 syn match   ia64Directive       "\.287"
64 syn match   ia64Directive       "\.386"
65 syn match   ia64Directive       "\.386c"
66 syn match   ia64Directive       "\.386p"
67 syn match   ia64Directive       "\.387"
68 syn match   ia64Directive       "\.486"
69 syn match   ia64Directive       "\.486c"
70 syn match   ia64Directive       "\.486p"
71 syn match   ia64Directive       "\.8086"
72 syn match   ia64Directive       "\.8087"
76 "delimiters
77 syn match ia64delimiter ";;"
79 "operators
80 syn match ia64operators "[\[\]()#,]"
81 syn match ia64operators "\(+\|-\|=\)"
83 "TODO
84 syn match ia64Todo      "\(TODO\|XXX\|FIXME\|NOTE\)"
86 "What follows is a long list of regular expressions for parsing the
87 "ia64 instructions that use many completers
89 "br
90 syn match ia64opcode "br\(\(\.\(cond\|call\|ret\|ia\|cloop\|ctop\|cexit\|wtop\|wexit\)\)\=\(\.\(spnt\|dpnt\|sptk\|dptk\)\)\=\(\.few\|\.many\)\=\(\.clr\)\=\)\=\>"
91 "break
92 syn match ia64opcode "break\(\.[ibmfx]\)\=\>"
93 "brp
94 syn match ia64opcode "brp\(\.\(sptk\|dptk\|loop\|exit\)\)\(\.imp\)\=\>"
95 syn match ia64opcode "brp\.ret\(\.\(sptk\|dptk\)\)\{1}\(\.imp\)\=\>"
96 "bsw
97 syn match ia64opcode "bsw\.[01]\>"
98 "chk
99 syn match ia64opcode "chk\.\(s\(\.[im]\)\=\)\>"
100 syn match ia64opcode "chk\.a\.\(clr\|nc\)\>"
101 "clrrrb
102 syn match ia64opcode "clrrrb\(\.pr\)\=\>"
103 "cmp/cmp4
104 syn match ia64opcode "cmp4\=\.\(eq\|ne\|l[te]\|g[te]\|[lg]tu\|[lg]eu\)\(\.unc\)\=\>"
105 syn match ia64opcode "cmp4\=\.\(eq\|[lgn]e\|[lg]t\)\.\(\(or\(\.andcm\|cm\)\=\)\|\(and\(\(\.or\)\=cm\)\=\)\)\>"
106 "cmpxchg
107 syn match ia64opcode "cmpxchg[1248]\.\(acq\|rel\)\(\.nt1\|\.nta\)\=\>"
108 "czx
109 syn match ia64opcode "czx[12]\.[lr]\>"
110 "dep
111 syn match ia64opcode "dep\(\.z\)\=\>"
112 "extr
113 syn match ia64opcode "extr\(\.u\)\=\>"
114 "fadd
115 syn match ia64opcode "fadd\(\.[sd]\)\=\(\.s[0-3]\)\=\>"
116 "famax/famin
117 syn match ia64opcode "fa\(max\|min\)\(\.s[0-3]\)\=\>"
118 "fchkf/fmax/fmin
119 syn match ia64opcode "f\(chkf\|max\|min\)\(\.s[0-3]\)\=\>"
120 "fclass
121 syn match ia64opcode "fclass\(\.n\=m\)\(\.unc\)\=\>"
122 "fclrf/fpamax
123 syn match ia64opcode "f\(clrf\|pamax\|pamin\)\(\.s[0-3]\)\=\>"
124 "fcmp
125 syn match ia64opcode "fcmp\.\(n\=[lg][te]\|n\=eq\|\(un\)\=ord\)\(\.unc\)\=\(\.s[0-3]\)\=\>"
126 "fcvt/fcvt.xf/fcvt.xuf.pc.sf
127 syn match ia64opcode "fcvt\.\(\(fxu\=\(\.trunc\)\=\(\.s[0-3]\)\=\)\|\(xf\|xuf\(\.[sd]\)\=\(\.s[0-3]\)\=\)\)\>"
128 "fetchadd
129 syn match ia64opcode "fetchadd[48]\.\(acq\|rel\)\(\.nt1\|\.nta\)\=\>"
130 "fma/fmpy/fms
131 syn match ia64opcode "fm\([as]\|py\)\(\.[sd]\)\=\(\.s[0-3]\)\=\>"
132 "fmerge/fpmerge
133 syn match ia64opcode "fp\=merge\.\(ns\|se\=\)\>"
134 "fmix
135 syn match ia64opcode "fmix\.\(lr\|[lr]\)\>"
136 "fnma/fnorm/fnmpy
137 syn match ia64opcode "fn\(ma\|mpy\|orm\)\(\.[sd]\)\=\(\.s[0-3]\)\=\>"
138 "fpcmp
139 syn match ia64opcode "fpcmp\.\(n\=[lg][te]\|n\=eq\|\(un\)\=ord\)\(\.s[0-3]\)\=\>"
140 "fpcvt
141 syn match ia64opcode "fpcvt\.fxu\=\(\(\.trunc\)\=\(\.s[0-3]\)\=\)\>"
142 "fpma/fpmax/fpmin/fpmpy/fpms/fpnma/fpnmpy/fprcpa/fpsqrta
143 syn match ia64opcode "fp\(max\=\|min\|n\=mpy\|ms\|nma\|rcpa\|sqrta\)\(\.s[0-3]\)\=\>"
144 "frcpa/frsqrta
145 syn match ia64opcode "fr\(cpa\|sqrta\)\(\.s[0-3]\)\=\>"
146 "fsetc/famin/fchkf
147 syn match ia64opcode "f\(setc\|amin\|chkf\)\(\.s[0-3]\)\=\>"
148 "fsub
149 syn match ia64opcode "fsub\(\.[sd]\)\=\(\.s[0-3]\)\=\>"
150 "fswap
151 syn match ia64opcode "fswap\(\.n[lr]\=\)\=\>"
152 "fsxt
153 syn match ia64opcode "fsxt\.[lr]\>"
154 "getf
155 syn match ia64opcode "getf\.\([sd]\|exp\|sig\)\>"
156 "invala
157 syn match ia64opcode "invala\(\.[ae]\)\=\>"
158 "itc/itr
159 syn match ia64opcode "it[cr]\.[id]\>"
161 syn match ia64opcode "ld[1248]\>\|ld[1248]\(\.\(sa\=\|a\|c\.\(nc\|clr\(\.acq\)\=\)\|acq\|bias\)\)\=\(\.nt[1a]\)\=\>"
162 syn match ia64opcode "ld8\.fill\(\.nt[1a]\)\=\>"
163 "ldf
164 syn match ia64opcode "ldf[sde8]\(\(\.\(sa\=\|a\|c\.\(nc\|clr\)\)\)\=\(\.nt[1a]\)\=\)\=\>"
165 syn match ia64opcode "ldf\.fill\(\.nt[1a]\)\=\>"
166 "ldfp
167 syn match ia64opcode "ldfp[sd8]\(\(\.\(sa\=\|a\|c\.\(nc\|clr\)\)\)\=\(\.nt[1a]\)\=\)\=\>"
168 "lfetch
169 syn match ia64opcode "lfetch\(\.fault\(\.excl\)\=\|\.excl\)\=\(\.nt[12a]\)\=\>"
171 syn match ia64opcode "mf\(\.a\)\=\>"
172 "mix
173 syn match ia64opcode "mix[124]\.[lr]\>"
174 "mov
175 syn match ia64opcode "mov\(\.[im]\)\=\>"
176 syn match ia64opcode "mov\(\.ret\)\=\(\(\.sptk\|\.dptk\)\=\(\.imp\)\=\)\=\>"
177 "nop
178 syn match ia64opcode "nop\(\.[ibmfx]\)\=\>"
179 "pack
180 syn match ia64opcode "pack\(2\.[su]ss\|4\.sss\)\>"
181 "padd //padd4 added to keywords
182 syn match ia64opcode "padd[12]\(\.\(sss\|uus\|uuu\)\)\=\>"
183 "pavg
184 syn match ia64opcode "pavg[12]\(\.raz\)\=\>"
185 "pcmp
186 syn match ia64opcode "pcmp[124]\.\(eq\|gt\)\>"
187 "pmax/pmin
188 syn match ia64opcode "pm\(ax\|in\)\(\(1\.u\)\|2\)\>"
189 "pmpy
190 syn match ia64opcode "pmpy2\.[rl]\>"
191 "pmpyshr
192 syn match ia64opcode "pmpyshr2\(\.u\)\=\>"
193 "probe
194 syn match ia64opcode "probe\.[rw]\>"
195 syn match ia64opcode "probe\.\(\(r\|w\|rw\)\.fault\)\>"
196 "pshr
197 syn match ia64opcode "pshr[24]\(\.u\)\=\>"
198 "psub
199 syn match ia64opcode "psub[12]\(\.\(sss\|uu[su]\)\)\=\>"
200 "ptc
201 syn match ia64opcode "ptc\.\(l\|e\|ga\=\)\>"
202 "ptr
203 syn match ia64opcode "ptr\.\(d\|i\)\>"
204 "setf
205 syn match ia64opcode "setf\.\(s\|d\|exp\|sig\)\>"
206 "shr
207 syn match ia64opcode "shr\(\.u\)\=\>"
208 "srlz
209 syn match ia64opcode "srlz\(\.[id]\)\>"
211 syn match ia64opcode "st[1248]\(\.rel\)\=\(\.nta\)\=\>"
212 syn match ia64opcode "st8\.spill\(\.nta\)\=\>"
213 "stf
214 syn match ia64opcode "stf[1248]\(\.nta\)\=\>"
215 syn match ia64opcode "stf\.spill\(\.nta\)\=\>"
216 "sxt
217 syn match ia64opcode "sxt[124]\>"
218 "tbit/tnat
219 syn match ia64opcode "t\(bit\|nat\)\.nz\=\(\.\(unc\|or\(\.andcm\|cm\)\=\|and\(\.orcm\|cm\)\=\)\)\=\>"
220 "unpack
221 syn match ia64opcode "unpack[124]\.[lh]\>"
222 "xchq
223 syn match ia64opcode "xchg[1248]\(\.nt[1a]\)\=\>"
224 "xma/xmpy
225 syn match ia64opcode "xm\(a\|py\)\.[lh]u\=\>"
226 "zxt
227 syn match ia64opcode "zxt[124]\>"
230 "The regex for different ia64 registers are given below
232 "limits the rXXX and fXXX and cr suffix in the range 0-127
233 syn match ia64registers "\([fr]\|cr\)\([0-9]\|[1-9][0-9]\|1[0-1][0-9]\|12[0-7]\)\{1}\>"
234 "branch ia64registers
235 syn match ia64registers "b[0-7]\>"
236 "predicate ia64registers
237 syn match ia64registers "p\([0-9]\|[1-5][0-9]\|6[0-3]\)\>"
238 "application ia64registers
239 syn match ia64registers "ar\.\(fpsr\|mat\|unat\|rnat\|pfs\|bsp\|bspstore\|rsc\|lc\|ec\|ccv\|itc\|k[0-7]\)\>"
240 "ia32 AR's
241 syn match ia64registers "ar\.\(eflag\|fcr\|csd\|ssd\|cflg\|fsr\|fir\|fdr\)\>"
242 "sp/gp/pr/pr.rot/rp
243 syn keyword ia64registers sp gp pr pr.rot rp ip tp
244 "in/out/local
245 syn match ia64registers "\(in\|out\|loc\)\([0-9]\|[1-8][0-9]\|9[0-5]\)\>"
246 "argument ia64registers
247 syn match ia64registers "farg[0-7]\>"
248 "return value ia64registers
249 syn match ia64registers "fret[0-7]\>"
250 "psr
251 syn match ia64registers "psr\(\.\(l\|um\)\)\=\>"
253 syn match ia64registers "cr\.\(dcr\|itm\|iva\|pta\|ipsr\|isr\|ifa\|iip\|itir\|iipa\|ifs\|iim\|iha\|lid\|ivr\|tpr\|eoi\|irr[0-3]\|itv\|pmv\|lrr[01]\|cmcv\)\>"
254 "Indirect registers
255 syn match ia64registers "\(cpuid\|dbr\|ibr\|pkr\|pmc\|pmd\|rr\|itr\|dtr\)\>"
256 "MUX permutations for 8-bit elements
257 syn match ia64registers "\(@rev\|@mix\|@shuf\|@alt\|@brcst\)\>"
258 "floating point classes
259 syn match ia64registers "\(@nat\|@qnan\|@snan\|@pos\|@neg\|@zero\|@unorm\|@norm\|@inf\)\>"
260 "link relocation operators
261 syn match ia64registers "\(@\(\(gp\|sec\|seg\|image\)rel\)\|ltoff\|fptr\|ptloff\|ltv\|section\)\>"
263 "Data allocation syntax
264 syn match ia64data "data[1248]\>"
265 syn match ia64data "real\([48]\|1[06]\)\>"
266 syn match ia64data "stringz\=\>"
268 " Define the default highlighting.
269 " For version 5.7 and earlier: only when not done already
270 " For version 5.8 and later: only when an item doesn't have highlighting yet
271 if version >= 508 || !exists("did_ia64_syn_inits")
272         if version < 508
273                 let did_ia64_syn_inits = 1
274                 command -nargs=+ HiLink hi link <args>
275         else
276                 command -nargs=+ HiLink hi def link <args>
277         endif
279         "put masm groups with our groups
280         HiLink masmOperator    ia64operator
281         HiLink masmDirective   ia64Directive
282         HiLink masmOpcode      ia64Opcode
283         HiLink masmIdentifier  ia64Identifier
284         HiLink masmFloat       ia64Float
286         "ia64 specific stuff
287         HiLink ia64Label       Define
288         HiLink ia64Comment     Comment
289         HiLink ia64Directive   Type
290         HiLink ia64opcode      Statement
291         HiLink ia64registers   Operator
292         HiLink ia64string      String
293         HiLink ia64Hex         Number
294         HiLink ia64Binary      Number
295         HiLink ia64Octal       Number
296         HiLink ia64Float       Float
297         HiLink ia64Decimal     Number
298         HiLink ia64Identifier  Identifier
299         HiLink ia64data        Type
300         HiLink ia64delimiter   Delimiter
301         HiLink ia64operator    Operator
302         HiLink ia64Todo        Todo
304         delcommand HiLink
305 endif
307 let b:current_syntax = "ia64"
309 " vim: ts=8 sw=2