diff options
author | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2015-04-22 14:27:12 +0200 |
---|---|---|
committer | Xavier Leroy <xavierleroy@users.noreply.github.com> | 2015-04-22 14:27:12 +0200 |
commit | 0bf99217426a44046ef0aaa7f84a9b2a3646ed89 (patch) | |
tree | e4f983980a5001792b90ed8f3dbd8fa241e43eb1 /cparser/Cabs.v | |
parent | 08b2b46f15e70b11c044e4e9a7c8438a96d57ed7 (diff) | |
parent | ca4aa822693f4d98de99fd3f13c1523d733e1cb0 (diff) | |
download | compcert-kvx-0bf99217426a44046ef0aaa7f84a9b2a3646ed89.tar.gz compcert-kvx-0bf99217426a44046ef0aaa7f84a9b2a3646ed89.zip |
Merge pull request #40 from AbsInt/inline-asm
GCC-style extended inline asm.
The subset implemented is:
- zero or one output
- output constraints "=r" (to register) or "=m" (to memory)
- zero, one or several inputs
- input constraints "r" (in register), "m" (in memory), "i" and "n" (compile-time integer constant)
- clobbered registers (the 3rd argument)
- both anonymous (%3) and named (%[name]) operands
- modifiers %R and %Q to refer to the most significant / least significant part of a register pair holding a 64-bit integer. (Undocumented GCC ARM feature.)
All asm statements are treated as "volatile", possibly modifying memory and condition codes.
Diffstat (limited to 'cparser/Cabs.v')
-rw-r--r-- | cparser/Cabs.v | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/cparser/Cabs.v b/cparser/Cabs.v index 920f4603..6d9e95d5 100644 --- a/cparser/Cabs.v +++ b/cparser/Cabs.v @@ -180,6 +180,12 @@ Definition init_name_group := (list spec_elem * list init_name)%type. (* e.g.: int x, y; *) Definition name_group := (list spec_elem * list name)%type. +(* GCC extended asm *) +Inductive asm_operand := +| ASMOPERAND: option string -> bool -> list char_code -> expression -> asm_operand. + +Definition asm_flag := (bool * list char_code)%type. + (* ** Declaration definition (at toplevel) *) @@ -209,7 +215,7 @@ with statement := | DEFAULT : statement -> cabsloc -> statement | LABEL : string -> statement -> cabsloc -> statement | GOTO : string -> cabsloc -> statement - | ASM : bool -> list char_code -> cabsloc -> statement + | ASM : list cvspec -> bool -> list char_code -> list asm_operand -> list asm_operand -> list asm_flag -> cabsloc -> statement | DEFINITION : definition -> statement (*definition or declaration of a variable or type*) with for_clause := |