aboutsummaryrefslogtreecommitdiff
path: root/asm.peg
diff options
context:
space:
mode:
authorAndrew Chambers <[email protected]>2021-10-16 02:07:56 +1300
committerAndrew Chambers <[email protected]>2021-10-16 02:07:56 +1300
commit490cb559cc4713b43d38c5667e56abc2f52973f9 (patch)
tree808edd96ed4d84334953e5ca04972fd6d94115a8 /asm.peg
parente45f7325b6104396676deedfe203833a52a11b18 (diff)
Add instructions and refactor.
Diffstat (limited to 'asm.peg')
-rw-r--r--asm.peg8
1 files changed, 7 insertions, 1 deletions
diff --git a/asm.peg b/asm.peg
index f958b8c..fc904d5 100644
--- a/asm.peg
+++ b/asm.peg
@@ -31,7 +31,7 @@ directive =
| "byte" ws v:value
{ $$.dirbyte = (Byte){.kind = ASM_DIR_BYTE, .value = v.value }; }
| "short" ws v:value
- { $$.dirshort = (Short){.kind = ASM_DIR_BYTE, .value = v.value }; }
+ { $$.dirshort = (Short){.kind = ASM_DIR_SHORT, .value = v.value }; }
| "int" ws v:value
{ $$.dirint = (Int){.kind = ASM_DIR_INT, .value = v.value }; }
| "quad" ws v:value
@@ -115,6 +115,7 @@ instr =
# Floating point is less common, so check last.
| i:addss { $$ = i; }
| i:addsd { $$ = i; }
+ | i:divss { $$ = i; }
| i:divsd { $$ = i; }
| i:pxor { $$ = i; }
| i:xorpd { $$ = i; }
@@ -489,6 +490,11 @@ divsd = "divsd" (
| ws s:mem ws? ',' ws? d:xmm { $$ = INSTR2(1, s, d); }
) { $$.instr.kind = ASM_DIVSD; }
+divss = "divss" (
+ ws s:xmm ws? ',' ws? d:xmm { $$ = INSTR2(0, s, d); }
+ | ws s:mem ws? ',' ws? d:xmm { $$ = INSTR2(1, s, d); }
+) { $$.instr.kind = ASM_DIVSS; }
+
movaps = "movaps" (
ws s:xmm ws? ',' ws? d:xmm { $$ = INSTR2(0, s, d); }
| ws s:mem ws? ',' ws? d:xmm { $$ = INSTR2(1, s, d); }