aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/php
diff options
context:
space:
mode:
authorEduardo Julian2018-05-06 03:30:47 -0400
committerEduardo Julian2018-05-06 03:30:47 -0400
commite65e734e5df3746ffb7df2cc9fa33826e0083fcd (patch)
treec67b1105a4b421d527804ccbfcab4d29ec20e744 /new-luxc/source/luxc/lang/translation/php
parentf5a6fe62a612c0727063fa9e530d53ddda5fcd82 (diff)
- Re-named shift-left -> left-shift, shift-right -> logical-right-shift, signed-shift-right -> arithmetic-right-shift.
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/php')
-rw-r--r--new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux12
-rw-r--r--new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux40
2 files changed, 8 insertions, 44 deletions
diff --git a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
index 33c7d645e..5850c0098 100644
--- a/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/php/procedure/common.jvm.lux
@@ -161,7 +161,7 @@
## [bit//xor _.bit-xor]
## )
-## (def: (bit//shift-left [subjectO paramO])
+## (def: (bit//left-shift [subjectO paramO])
## Binary
## (|> (_.bit-shl paramO subjectO)
## runtimeT.bit//64))
@@ -171,8 +171,8 @@
## Binary
## (<op> paramO subjectO))]
-## [bit//shift-right _.bit-shr]
-## [bit//unsigned-shift-right runtimeT.bit//shift-right]
+## [bit//arithmetic-right-shift _.bit-shr]
+## [bit//logical-right-shift runtimeT.bit//logical-right-shift]
## )
## (def: bit-procs
@@ -183,9 +183,9 @@
## (install "and" (binary bit//and))
## (install "or" (binary bit//or))
## (install "xor" (binary bit//xor))
-## (install "shift-left" (binary bit//shift-left))
-## (install "unsigned-shift-right" (binary bit//unsigned-shift-right))
-## (install "shift-right" (binary bit//shift-right))
+## (install "left-shift" (binary bit//left-shift))
+## (install "logical-right-shift" (binary bit//logical-right-shift))
+## (install "arithmetic-right-shift" (binary bit//arithmetic-right-shift))
## )))
## ## [[Arrays]]
diff --git a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux
index 66827025e..c7262a291 100644
--- a/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/php/runtime.jvm.lux
@@ -216,41 +216,7 @@
(_.then! @@product//right)
(_.then! @@sum//get)))
-## (def: full-32-bits (_.code "0xFFFFFFFF"))
-
-## (runtime: (bit//32 input)
-## (with-vars [capped]
-## (_.cond! (list [(|> input (_.> full-32-bits))
-## (_.return! (|> input (_.bit-and full-32-bits) bit//32))]
-## [(|> input (_.> (_.code "0x7FFFFFFF")))
-## ($_ _.then!
-## (_.set! (list capped)
-## (_.apply (list (|> (_.code "0x100000000")
-## (_.- input)))
-## (_.global "int")))
-## (_.if! (|> (@@ capped) (_.<= (_.int 2147483647)))
-## (_.return! (|> (@@ capped) (_.* (_.int -1))))
-## (_.return! (_.int -2147483648))))])
-## (_.return! input))))
-
-## (def: full-64-bits (_.code "0xFFFFFFFFFFFFFFFF"))
-
-## (runtime: (bit//64 input)
-## (with-vars [capped]
-## (_.cond! (list [(|> input (_.> full-64-bits))
-## (_.return! (|> input (_.bit-and full-64-bits) bit//64))]
-## [(|> input (_.> (_.code "0x7FFFFFFFFFFFFFFF")))
-## ($_ _.then!
-## (_.set! (list capped)
-## (_.apply (list (|> (_.code "0x10000000000000000")
-## (_.- input)))
-## (_.global "int")))
-## (_.if! (|> (@@ capped) (_.<= (_.code "9223372036854775807L")))
-## (_.return! (|> (@@ capped) (_.* (_.int -1))))
-## (_.return! (_.code "-9223372036854775808L"))))])
-## (_.return! input))))
-
-## (runtime: (bit//shift-right param subject)
+## (runtime: (bit//logical-right-shift param subject)
## (let [mask (|> (_.int 1)
## (_.bit-shl (_.- param (_.int 64)))
## (_.- (_.int 1)))]
@@ -261,9 +227,7 @@
## (def: runtime//bit
## Runtime
## ($_ _.then!
-## @@bit//32
-## @@bit//64
-## @@bit//shift-right))
+## @@bit//logical-right-shift))
## (runtime: (text//index subject param start)
## (with-vars [idx]