|
|
@ -93,8 +93,8 @@
|
|
|
|
(*%token EXTRACTVALUE*)
|
|
|
|
(*%token EXTRACTVALUE*)
|
|
|
|
(*%token INSERTVALUE*)
|
|
|
|
(*%token INSERTVALUE*)
|
|
|
|
(* memory access and addressing operations *)
|
|
|
|
(* memory access and addressing operations *)
|
|
|
|
|
|
|
|
%token ALIGN (* argument for below operations *)
|
|
|
|
%token ALLOCA
|
|
|
|
%token ALLOCA
|
|
|
|
%token ALIGN (* argument for alloca *)
|
|
|
|
|
|
|
|
%token LOAD
|
|
|
|
%token LOAD
|
|
|
|
%token STORE
|
|
|
|
%token STORE
|
|
|
|
(*%token FENCE*)
|
|
|
|
(*%token FENCE*)
|
|
|
@ -195,12 +195,15 @@ instr:
|
|
|
|
| BR LABEL lbl = variable { UncondBranch lbl }
|
|
|
|
| BR LABEL lbl = variable { UncondBranch lbl }
|
|
|
|
| BR BIT op = operand COMMA LABEL lbl1 = variable COMMA LABEL lbl2 = variable { CondBranch (op, lbl1, lbl2) }
|
|
|
|
| BR BIT op = operand COMMA LABEL lbl1 = variable COMMA LABEL lbl2 = variable { CondBranch (op, lbl1, lbl2) }
|
|
|
|
(* Memory access operations *)
|
|
|
|
(* Memory access operations *)
|
|
|
|
| var=variable EQUALS ALLOCA tp=typ (*COMMA ALIGN sz=CONSTANT_INT*) { Alloc (var, tp, 1, 1) }
|
|
|
|
| var = variable EQUALS ALLOCA tp = typ option(align) { Alloc (var, tp, 1) }
|
|
|
|
| var = variable EQUALS LOAD tp = ptr_typ ptr = variable { Load (var, tp, ptr) }
|
|
|
|
| var = variable EQUALS LOAD tp = ptr_typ ptr = variable option(align) { Load (var, tp, ptr) }
|
|
|
|
| STORE val_tp = typ value = operand COMMA ptr_tp = ptr_typ var = variable { Store (value, val_tp, var) }
|
|
|
|
| STORE val_tp = typ value = operand COMMA ptr_tp = ptr_typ var = variable option(align) { Store (value, val_tp, var) }
|
|
|
|
(* don't yet know why val_tp and ptr_tp would be different *)
|
|
|
|
(* don't yet know why val_tp and ptr_tp would be different *)
|
|
|
|
| variable EQUALS binop { Binop }
|
|
|
|
| variable EQUALS binop { Binop }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
align:
|
|
|
|
|
|
|
|
| COMMA ALIGN sz = CONSTANT_INT { sz }
|
|
|
|
|
|
|
|
|
|
|
|
binop:
|
|
|
|
binop:
|
|
|
|
| ADD arith_options binop_args { () }
|
|
|
|
| ADD arith_options binop_args { () }
|
|
|
|
| FADD fast_math_flags binop_args { () }
|
|
|
|
| FADD fast_math_flags binop_args { () }
|
|
|
|