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 /elymas/lib/math.ey | |
| parent | f0a883a15138991e09d4657b7d2aab491dafbc7b (diff) | |
Sane handling of integer division
Diffstat (limited to 'elymas/lib/math.ey')
| -rw-r--r-- | elymas/lib/math.ey | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/elymas/lib/math.ey b/elymas/lib/math.ey index db04c7b..cc9b288 100644 --- a/elymas/lib/math.ey +++ b/elymas/lib/math.ey @@ -24,4 +24,26 @@ } /base deff > /math defv +# FIXME: INTEGRATE +# # 0 -> float +# # 0 <- the int portion of the float, rounded towards zero +# [[ +# /rbx :popqReg +# +# # allocate result int +# ::internalAllocateInteger /rax :movqImmReg +# /rax :callqReg +# +# # actual conversion +# /rcx :popqReg +# 8 /rcx :fld64MemDisp8 +# 8 /rax :fistp64MemDisp8 +# +# # push int on program stack +# /rax :pushqReg +# +# /rbx :pushqReg +# :retn +# ]] /eytrunc defv + # vim: syn=elymas |
