Post Ap6REj8VDZHCL86dDE by [email protected] | |
More posts by [email protected] | |
Post #Ap6Lgv25yqYbcVAWp6 by [email protected] | |
0 likes, 0 repeats | |
today in completely normal codegen: this code divides by 0x32 | |
Post #Ap6LiCUWYVEo3Y4qbQ by [email protected] | |
0 likes, 0 repeats | |
multiplicative identity! | |
Post #Ap6NLbEyZXQU3w9hiq by [email protected] | |
0 likes, 0 repeats | |
@whitequark dividing by 50 never looked so hard. | |
Post #Ap6P11eXNPlro1Qem0 by [email protected] | |
0 likes, 0 repeats | |
@whitequark Just glancing over it makes my head hurt 😣 | |
Post #Ap6PBvX8T7WA0pAI5Y by [email protected] | |
0 likes, 0 repeats | |
@whitequark I understand multiplying by 2^x/50 and taking the result from RDX (… | |
Post #Ap6PvLfg8TZM6mosMa by [email protected] | |
0 likes, 0 repeats | |
@whitequark try using different constants to suicide by; this is a special case… | |
Post #Ap6Q84cQqamYzCMvLM by [email protected] | |
0 likes, 0 repeats | |
@robryk i have no idea, i'm just reverse-engineering this | |
Post #Ap6QFusWwgQr5rdduS by [email protected] | |
0 likes, 0 repeats | |
@whitequark of I remember by the time I'm home in the evening I will get go… | |
Post #Ap6QKOsTLrZJIBkWPo by [email protected] | |
0 likes, 0 repeats | |
@whitequark oh wow modular arithmetic trickery. I've also seen versions of… | |
Post #Ap6QpcK1PqLfxyWLVA by [email protected] | |
0 likes, 0 repeats | |
@robryk fwiw this was emitted by msvc | |
Post #Ap6REj8VDZHCL86dDE by [email protected] | |
0 likes, 0 repeats | |
@whitequark I'll add this to my collection. I like to remind my students th… | |
Post #Ap6Yf1JYx8u5vYlQWG by [email protected] | |
0 likes, 0 repeats | |
@pointingdevice @whitequark That's pretty much what this is? Or, at least, … | |
Post #Ap6Yf1TUMEqMQLPLzU by [email protected] | |
0 likes, 0 repeats | |
@sabik @whitequark Yes, but I don’t understand the significance of that numbe… | |
Post #Ap6Yf1cLpHvsrpYQnw by [email protected] | |
0 likes, 0 repeats | |
@sabik @whitequark On a second look, the fact that the result is 32 bits (and m… | |
Post #Ap6Yf1jnNbt5Ev2NPM by [email protected] | |
0 likes, 0 repeats | |
@pointingdevice @sabik should be unsigned as this is a count/length | |
Post #Ap6jlIAUIsC7QniEN6 by [email protected] | |
0 likes, 0 repeats | |
@whitequark @pointingdevice @sabik Compilers will use a multiplicative inverse … | |
Post #Ap6klEkl6GrunIDQ24 by [email protected] | |
0 likes, 0 repeats | |
@whitequark I think this unintentionally explains some disassembly I see in 809… | |
Post #Ap6muYacuwHCpZ32qe by [email protected] | |
0 likes, 0 repeats | |
@pkhuong @whitequark @pointingdevice @sabik Yep, this is it! And in this case t… | |
Post #Ap6muYhiUZwpBYMhto by [email protected] | |
0 likes, 0 repeats | |
@typeswitch @pkhuong @pointingdevice @sabik you might be amused by knowing that… | |
Post #Ap6qTK0lPYl9c9XgJs by [email protected] | |
0 likes, 0 repeats | |
@whitequark Divide A (0-255) by 50:lsr asta templsr alsr alsr aadc tempror alsr… | |
Post #Ap72gGLJYqBPS25krw by [email protected] | |
0 likes, 0 repeats | |
@whitequark All compilers I've seen can do this optimization. See for examp… | |
Post #Ap79jqn1CyVz2Lhxdg by [email protected] | |
0 likes, 0 repeats | |
@0x10f aaaaaa i'm getting 8051 flashbacks | |
Post #Ap7HdJsdS1fErkjS76 by [email protected] | |
0 likes, 0 repeats | |
@whitequark writing code like this is called job security | |
Post #Ap7HgcOb4ERZ9xFrFo by [email protected] | |
0 likes, 0 repeats | |
@chx this code was written by a compiler | |
Post #Ap7PVewk2i0pWCVkW0 by [email protected] | |
0 likes, 0 repeats | |
@whitequark this doesn’t seem cursed at all to me. I guess I’m too close to… |