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