armoha / euddraft

System for pluginizing eudplib codes.
Other
29 stars 4 forks source link

Revise basic arithmetics #46

Closed armoha closed 2 years ago

armoha commented 2 years ago

See https://github.com/heinermann/llvm-bw/wiki/Instruction-Implementation

Implement followings:

Revise these:

armoha commented 2 years ago

Python (and other languages too?) does not have in-place bitwise not operator, but in-place not is special case of constant xor: ~A = A ^ -1

Related: https://stackoverflow.com/questions/20916404/python-in-place-complement-operator

armoha commented 2 years ago

Added ixor, ilshift, irshift by https://github.com/armoha/eudplib/commit/2c0ebd9b4b6ba99bb9ea411c41e29a806cb4ece2

armoha commented 2 years ago

Implemented for variables (EUDVariable, EUDLightVariable).

Should we expose these api for plain memory address? Or postpone it and rather focus on epScript compiler optimization?

armoha commented 2 years ago

Mostly added in https://github.com/armoha/eudplib/commit/f385a83dee3cff34f6f991ac7f56b2f85fdb77de, https://github.com/armoha/eudplib/commit/07c76e6c061bde36f4ffb836c82969cc2ff056eb

armoha commented 2 years ago

Mostly resolved and implemented by series of commits, released since euddraft 0.9.5.1: ^=, <<=, >>=: armoha/eudplib@2c0ebd9b4b6ba99bb9ea411c41e29a806cb4ece2 &=, |=: armoha/eudplib@3b3368062cb71b92807588743394ca35b413e0e4 , armoha/eudplib@2ee72cf8a7fce86a2063dfdbf5dcadecf68a0877 armoha/eudplib@e6d22884762e18ef044ff232bc7baf31cc2da30e armoha/eudplib@2a947b069dbedc02decbc8015199bc77a9802d21 &, |, ^, ~, -: armoha/eudplib@f385a83dee3cff34f6f991ac7f56b2f85fdb77de armoha/eudplib@9a9c89b8545c6d4d7f5990dad5c66f50ea7f334f <<: armoha/eudplib@07c76e6c061bde36f4ffb836c82969cc2ff056eb armoha/eudplib@78872f945b83ef0b3de2f8b573c484087b31aa4c armoha/eudplib@d834c38142b42d755c97355d8b40b4abe0f1b6c8

Further optimization on other types or simple memory address would be better implemented as compiler optimization.