summaryrefslogtreecommitdiff
path: root/parse/ops.def
blob: e2f0b5083f3680ba9352ba3e25790bb6c99802ed (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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
/* operator name, is it pure, pretty name */
O(Obad,         1,	OTmisc,	"BAD")
O(Oauto,	1,	OTpre,	"auto")
O(Oadd,	        1,	OTbin,	"+")
O(Osub,	        1,	OTbin,	"-")
O(Omul,	        1,	OTbin,	"*")
O(Odiv,	        1,	OTbin,	"/")
O(Omod,	        1,	OTbin,	"%")
O(Oneg,	        1,	OTpre,	"-")
O(Obor,	        1,	OTbin,	"|")
O(Oband,	1,	OTbin,  "&")
O(Obxor,	1,	OTbin,  "^")
O(Obsl,	        1,	OTbin,  "<<")
O(Obsr,	        1,	OTbin,  ">>")
O(Obnot,	1,	OTpre,  "~")
O(Opreinc,	1,	OTpre,  "++")
O(Opostinc,	1,	OTpost, "++")
O(Opredec,	1,	OTpre,  "--")
O(Opostdec,	1,	OTpost, "--")
O(Oaddr,	1,	OTpre,  "&")
O(Oderef,	1,	OTpost, "#")
O(Olor,	        1,	OTbin,  "||")
O(Oland,	1,	OTbin,  "&&")
O(Olnot,	1,	OTpre,  "!")
O(Oeq,	        1,	OTbin,  "==")
O(One,	        1,	OTbin,  "!=")
O(Ogt,	        1,	OTbin,  ">")
O(Oge,	        1,	OTbin,  ">=")
O(Olt,	        1,	OTbin,  "<")
O(Ole,	        1,	OTbin,  "<=")
O(Oasn,	        1,	OTbin,  "=")
O(Oaddeq,	1,	OTbin,  "+=")
O(Osubeq,	1,	OTbin,  "-=")
O(Omuleq,	1,	OTbin,  "*=")
O(Odiveq,	1,	OTbin,  "/=")
O(Omodeq,	1,	OTbin,  "%=")
O(Oboreq,	1,	OTbin,  "|=")
O(Obandeq,	1,	OTbin,  "&=")
O(Obxoreq,	1,	OTbin,  "^=")
O(Obsleq,	1,	OTbin,  "<<=")
O(Obsreq,	1,	OTbin,  ">>=")
O(Oidx,	        1,	OTmisc,  NULL)
O(Oslice,	1,	OTmisc,  NULL)
O(Omemb,	1,	OTmisc,  NULL)
O(Otupmemb,	1,	OTmisc,	NULL)
O(Osize,	1,	OTmisc,  NULL)
O(Ocall,	0,	OTmisc,  NULL)
O(Ocast,	1,	OTmisc,  NULL)
O(Oret,	        1,	OTpre,  "->")
O(Ojmp,	        0,	OTpre,  "goto")
O(Obreak,	0,	OTzarg, "break")
O(Ocontinue,	0,	OTzarg, "continue")
O(Ovar,	        1,	OTmisc, NULL)
O(Ogap,	        1,	OTmisc, NULL)
O(Olit,	        1,	OTmisc, NULL)
O(Oucon,	1,	OTmisc, "`")
O(Otup,	        1,	OTmisc, NULL)
O(Ostruct,	1,	OTmisc, NULL)
O(Oarr,	        1,	OTmisc, NULL)
O(Otern,        1,	OTmisc, "?:")

/* all below this point are backend-only */
O(Odead,        0,      OTmisc, "DEAD")         /* dead code */
O(Oundef,       0,      OTmisc, "UNDEF")        /* undefined var */
O(Odef,         0,      OTmisc, "DEF")          /* defined var */
O(Ocjmp,	1,	OTmisc, "CJMP")         /* conditional jump */
O(Ovjmp,	1,	OTmisc, "VJMP")		/* variable arg list jump */
O(Oset,	        1,	OTbin,  "=")            /* store to var */
O(Osllen,	1,	OTpre,  "SLLEN")        /* size of slice */
O(Oslbase,	1,	OTpre,  "SLBASE")       /* base of sice */
O(Outag,	1,	OTpre,  "UTAG")	        /* tag of union */
O(Oudata,	1,	OTpre,  "UDATA")        /* pointer to contents of union */
O(Otupget,	1,	OTpre,  "TUPGET")        /* pointer to contents of union */
O(Oblit,	1,	OTbin,  "BLIT")         /* blit memory */
O(Oclear,       1,      OTpre,  "CLEAR")        /* zero */
O(Ocallind,     1,      OTpre,  "CALL")         /* call with environment */

/* integer conversions */
O(Otrunc,	1,	OTmisc, NULL)   /* truncating cast */
O(Ozwiden,	1,	OTmisc, NULL)   /* zero-extending widening cast */
O(Oswiden,	1,	OTmisc, NULL)   /* sign-extending widening cast */

/* float conversions */
O(Oflt2int,	1,	OTmisc, NULL)   /* float to int conversion */
O(Oint2flt,	1,	OTmisc, NULL)   /* int to float conversion */
O(Oflt2flt,	1,	OTmisc, NULL)   /* flt32<->flt64 conversion */

/* floating arithmetic */
O(Ofadd,	1,	OTmisc, NULL)
O(Ofsub,	1,	OTmisc, NULL)
O(Ofmul,	1,	OTmisc, NULL)
O(Ofdiv,	1,	OTmisc, NULL)
O(Ofneg,	1,	OTmisc, NULL)

/* floating point comparisons */
O(Ofeq,	        1,	OTmisc, NULL)
O(Ofne,	        1,	OTmisc, NULL)
O(Ofgt,	        1,	OTmisc, NULL)
O(Ofge,	        1,	OTmisc, NULL)
O(Oflt,	        1,	OTmisc, NULL)
O(Ofle,	        1,	OTmisc, NULL)

/* unsigned comparisons */
O(Oueq,	        1,	OTmisc, NULL)
O(Oune,	        1,	OTmisc, NULL)
O(Ougt,	        1,	OTmisc, NULL)
O(Ouge,	        1,	OTmisc, NULL)
O(Oult,	        1,	OTmisc, NULL)
O(Oule,	        1,	OTmisc, NULL)