Interface code generation - node operator

 

1V: represents syms [0] of the symbol point to a variable

1C: represents syms [0] is a constant

1L: syms [0] is a label

1S: syms [0] is constant and the constant value is the size in bytes 

2S: syms [0] is constant and the constant value is the byte size value syms [1] is also a constant, indicates the number of alignment byte

 

For most operators, type suffix indicates the type of operation to be performed and the result type. 

Operators

Type suffix

syms

kids

operating

ADDRF

P

1V

0

Parameters address

ADDRG

P

1V

0

Global Address

ADDRL

P

1V

0

Local address

CNST

CSIUPFD

1C

0

constant

Leaf operation address or generate a constant variable. syms [0] indicates that the variable or constant.

Operators

Type suffix

syms

kids

operating

BCOM

The

 

1

Bit complement

CVC

IU

 

1

Conversion from char

CVD

IF

 

1

From the double conversion

CVF

D

 

1

Conversion from float

CVI

CSUD

 

1

Conversion from int

CVP

The

 

1

From pointer

CVS

IU

 

1

From short conversion

CVU

CHIP

 

1

Conversion from unsigned

INDIR

CSIPFDB

 

1

Receiving an address to obtain the value of the address stored

NEG

IFD

 

1

non-

Unary operators addition INDIR, are accepted and generates a value, INDIR receiving an address stored in address value obtained. No BCOMI operator's complement signed integer using BCOMU obtained. 

Suffix indicates the type of conversion operation type of the result. For example, CVUI the unsigned number is converted to a signed integer. Unsigned number between and short integer, unsigned conversion between characters belonging and unsigned conversion, and conversion between integers and short integers, integers and characters belonging to symbol conversion.

Operators

Type suffix

syms

kids

operating

ADD

IUPFD

 

2

plus

BAND

The

 

2

Bits and

BORON

The

 

2

Position or

BXOR

The

 

2

Bit XOR

DIV

IUFD

 

2

except

LSH

IU

 

2

The left

MOD

IU

 

2

mold

I HAVE

IUFD

 

2

Multiply

RSH

IU

 

2

Right

SUB

IUPFD

 

2

Less

Binary operators accept two numbers, to generate a number. For most operators, suffix indicates the type of operation and the type of result types, ADDP, and to perform exception SUBP, wherein ADDP is integer operand kids [1] to the pointer operand kids [0] in, from the pointer SUBP kids subtracting operand [0] of the integer operation kids [1]. 

Operators

Type suffix

syms

kids

operating

ASGN

CSIPFDB

2S

2

Assignment, the kids [1] value into the kids [0] address location specified. syms [0] and syms [1] represents pointing kids [1] and the integer constant value symbol table entry size and alignment byte number

EQ

IFD

1L

2

Equal to the conversion

GIVE

IUFD

1L

2

Greater than or equal to transfer

GT

IUFD

1L

2

Greater than transfer

THE

IUFD

1L

2

less than or equal to

LT

IUFD

1L

2

Less than transfer

BORN

IFD

1L

2

不等于转移

ARG

IPFDB

2S

1

参数,零个或多个ARG节点加上CALL节点表示函数调用。ARG节点确立了kids[0]计算得出的傎作为下一个参数。syms[0]和syms[1]指向的符号表入口分别是参数的大小和对齐字节数的常量

CALL

IFDBV

1

1或2

函数调用,CALL节点的syms[0]所指向的符号的惟一非空域是type,表示被调用者的函数类型。 kids[0]计算被调用者的地址

RET

IFD

 

1

从函数返回

赋值、比较、参数和一些调用操作符没有返回结果,它们的类型后缀表明了要执行的操作类型。 

ASGN以及ASGN之后的操作符具有副作用,它们作为根节点出现在森林中,引用次数为0。CALLI、CALLF和CALLD可能产生一个值,此时它们作为ASGN节点的右操作数出现,且引用次数为1.除了这种例外情况,所有具有副作用的操作符总是出现在dag森林的根节点,出现的顺序与它们被执行的顺序一致。

操作符

类型后缀

syms

kids

操作

JUMP

V

 

1

无条件转换,转换地址由kids[0]计算得来

LABEL

V

1L

0

标号定义,定义的标号由syms[0]给出

 


  

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/mazhimazhi/p/11980640.html