-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3537324
commit b56dc1f
Showing
14 changed files
with
122 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#ifndef AMD64ADD_H | ||
#define AMD64ADD_H | ||
|
||
#include "backend/amd64/instruction/Amd64Instruction.h" | ||
|
||
namespace city | ||
{ | ||
class Amd64Add : public Amd64Instruction | ||
{ | ||
public: | ||
static constexpr Amd64Add MR64(Amd64RegisterCode dst, Amd64RegisterCode src) | ||
{ | ||
Amd64Add inst; | ||
|
||
auto rexw = static_cast<std::uint8_t>(Amd64PrefixCode::REXW); | ||
inst.SetPrefix({rexw}); | ||
inst.SetOpcode({0x01}); | ||
inst.SetModRM(src, dst, Amd64Mod::Register); | ||
|
||
return inst; | ||
} | ||
}; | ||
} // namespace city | ||
|
||
#endif // AMD64ADD_H |
13 changes: 0 additions & 13 deletions
13
src/backend/amd64/instruction/arithmetic/Amd64AddMI32Inst.h
This file was deleted.
Oops, something went wrong.
22 changes: 0 additions & 22 deletions
22
src/backend/amd64/instruction/arithmetic/Amd64AddRM32Inst.h
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include "IRBinaryInstruction.h" | ||
|
||
using namespace city; | ||
|
||
Value *IRBinaryInstruction::GetLHS() const noexcept | ||
{ | ||
return this->lhs_; | ||
} | ||
|
||
Value *IRBinaryInstruction::GetRHS() const noexcept | ||
{ | ||
return this->rhs_; | ||
} | ||
|
||
IRBinaryInstruction::IRBinaryInstruction(Value *lhs, Value *rhs) : lhs_(lhs), rhs_(rhs) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef IRBINARYINSTRUCTION_H | ||
#define IRBINARYINSTRUCTION_H | ||
|
||
#include "IRInstruction.h" | ||
#include "value/Value.h" | ||
|
||
namespace city | ||
{ | ||
class IRBinaryInstruction : public IRInstruction | ||
{ | ||
protected: | ||
Value *lhs_; | ||
Value *rhs_; | ||
|
||
public: | ||
[[nodiscard]] Value *GetLHS() const noexcept; | ||
[[nodiscard]] Value *GetRHS() const noexcept; | ||
|
||
IRBinaryInstruction(Value *lhs, Value *rhs); | ||
}; | ||
} // namespace city | ||
|
||
#endif // IRBINARYINSTRUCTION_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters