1 " Syntax highlighting rules for RTL dump files (for Vim).
3 " Copyright (C) 2018 Free Software Foundation, Inc.
5 " This script is free software; you can redistribute it and/or modify
6 " it under the terms of the GNU General Public License as published by
7 " the Free Software Foundation; either version 3, or (at your option)
10 " For more instructions please see gimple.vim file in the same folder.
13 " Do not continue, if syntax is already enabled in current buffer.
14 if exists("b:current_syntax")
18 " General-purpose comments.
19 syn match rtlComment ";;.*$"
21 syn keyword rtlInstruction debug_expr insn_list int_list sequence
22 \ address debug_insn insn expr_list
23 \ jump_table_data barrier code_label
24 \ cond_exec parallel asm_input asm_operands
25 \ unspec unspec_volatile addr_vec
26 \ addr_diff_vec prefetch set use clobber
27 \ call return simple_return eh_return
28 \ trap_if scratch strict_low_part concat concatn
29 \ mem label_ref symbol_ref cc0 compare plus minus
30 \ neg mult ss_mult us_mult div ss_div us_div mod
31 \ udiv umod and ior xor not ashift rotate ashiftrt
32 \ lshiftrt rotatert smin smax umin umax pre_dec
33 \ pre_inc post_dec post_inc pre_modify post_modify
34 \ unordered ordered uneq unge ungt unle unlt ltgt sign_extend
35 \ zero_extend truncate float_extend float_truncate
36 \ float fix unsigned_float unsigned_fix fract_convert
37 \ unsigned_fract_convert sat_fract unsigned_sat_fract
38 \ abs sqrt bswap ffs clrsb clz ctz popcount parity
39 \ sign_extract zero_extract high lo_sum vec_merge
40 \ vec_select vec_concat vec_duplicate vec_series ss_plus
41 \ us_plus ss_minus ss_neg us_neg ss_abs ss_ashift
42 \ us_ashift us_minus ss_truncate us_truncate fma
43 \ entry_value exclusion_set presence_set final_presence_set
44 \ absence_set final_absence_set automata_option attr set_attr
45 \ set_attr_alternative eq_attr eq_attr_alt attr_flag cond
46 syn keyword rtlConditional call_insn jump_insn if_then_else
47 \ eq ne gt gtu lt ltu ge geu le leu
48 syn keyword rtlNote note barrier code_label
49 syn keyword rtlVariableLoation var_location
50 syn keyword rtlPcRegister pc
52 syn keyword rtlModes VOID BLK BI QI HI SI DI TI SF DF CC QQ HQ SQ
53 \ DQ TQ UQQ UHQ USQ UDQ UTQ HA SA DA TA UHA
54 \ USA UDA UTA SD DD TD
57 syn region rtlString start=/\v"/ skip=/\v\\./ end=/\v"/
59 syn match rtlNoteInsn "NOTE_INSN_[A-Z_]*"
60 syn match rtlIntegerConstant "\vconst_int -?\d+"
61 syn match rtlFloatConstant "\vconst_double:[A-Z]+ -?\d*\.\d+(e\+\d+)?"
62 syn match rtlRegister "\vreg(\/[a-z])?:[A-Z0-9]+ \d+ [a-z0-9]+"
63 syn match rtlLocation /\v"[^"]*":\d+/
65 hi def link rtlInstruction Statement
66 hi def link rtlConditional Conditional
67 hi def link rtlNote Debug
68 hi def link rtlNoteInsn Debug
69 hi def link rtlIntegerConstant Number
70 hi def link rtlFloatConstant Number
71 hi def link rtlRegister Type
72 hi def link rtlPcRegister Type
73 hi def link rtlModes Type
74 hi def link rtlVariableLoation Debug
75 hi def link rtlComment Comment
76 hi def link rtlLocation Debug
77 hi def link rtlString String
79 let b:current_syntax = "gcc-rtl"