StanfordPL / x64asm

x86-64 assembler library
Apache License 2.0
470 stars 60 forks source link

Cleanup refactoring #172

Open eschkufz opened 9 years ago

eschkufz commented 9 years ago

There are lots of places where the code can be cleaned up given some of the changes that have happened over the last year. I'll make this and report back to this ticket as I go.

eschkufz commented 9 years ago

Time was, the only operand type that used both of its underlying 64-bit registers was MoffsXXX. Now that we store type info in the upper quad, this is true of all operands.

This means we don't need to explicitly redefine comparison and equality operators for every class.

For that matter... since all the operand class really is internally is an std pair, we don't need to define this stuff anywhere. We can just inherit from std::pair.

eschkufz commented 9 years ago

The same is true of EnvReg and EnvBits.

eschkufz commented 9 years ago

There's also lots of places where we do bit masking and I'm finding errors here and there. I'm going to refactor all of this bit setting/getting into operand.

eschkufz commented 9 years ago

There's a lot of friendship floating around which should probably be reduced. Some of it can be fixed with API calls, some of it is just there for historical reasons and not necessary anymore. I'll remove.

eschkufz commented 9 years ago

Reopening this since I never successfully merged it.