diff options
| author | Drahflow <drahflow@gmx.de> | 2015-04-11 00:59:04 +0200 |
|---|---|---|
| committer | Drahflow <drahflow@gmx.de> | 2015-04-11 00:59:04 +0200 |
| commit | 3e22eb797f02cdb54a5eccc8c6ebce33e1e1d7d5 (patch) | |
| tree | a3683561e3ca0edc0e431a8aa142b86842db27a8 /compiler/elymasAsmOps.ey | |
| parent | f0a883a15138991e09d4657b7d2aab491dafbc7b (diff) | |
Sane handling of integer division
Diffstat (limited to 'compiler/elymasAsmOps.ey')
| -rw-r--r-- | compiler/elymasAsmOps.ey | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/compiler/elymasAsmOps.ey b/compiler/elymasAsmOps.ey index 64b80f2..3adba21 100644 --- a/compiler/elymasAsmOps.ey +++ b/compiler/elymasAsmOps.ey @@ -119,10 +119,10 @@ %07 base regno band add } /sib deff -{ 8 { _ 256 mod -01 256 div } rep -- } /imm64 deff # div / mod unsigned -{ _ 0 lt { 4294967296 add } rep 4294967295 band 4 { _ 256 mod -01 256 div } rep -- } /imm32 deff -{ _ 0 lt { 65536 add } rep 65535 band 2 { _ 256 mod -01 256 div } rep -- } /imm16 deff -{ _ 0 lt { 256 add } rep 255 band } /imm8 deff +{ 8 { _ 256 umod -01 256 udiv } rep -- } /imm64 deff # div / mod unsigned +{ _ 0 lt { 4294967296 add } rep 4294967295 band 4 { _ 256 umod -01 256 udiv } rep -- } /imm32 deff +{ _ 0 lt { 65536 add } rep 65535 band 2 { _ 256 umod -01 256 udiv } rep -- } /imm16 deff +{ _ 0 lt { 256 add } rep 255 band } /imm8 deff { %66 } /width16 deff @@ -801,6 +801,15 @@ memoryAddressingVariants keys { ==variant memoryAddressingVariants variant . =*p { parse ==mem mem .base regno %07 gt mem .idx regno %07 gt or { 0 /none mem .idx mem .base rex } rep + %DF + /seven mem .encode + } /fistp64 variant defOp +} each + +memoryAddressingVariants keys { ==variant memoryAddressingVariants variant . =*parse + { parse ==mem + mem .base regno %07 gt mem .idx regno %07 gt or + { 0 /none mem .idx mem .base rex } rep %DD /zero mem .encode } /fld64 variant defOp |
