Skip to content

Commit

Permalink
8296163: [aarch64] Cleanup Pre/Post addressing mode classes
Browse files Browse the repository at this point in the history
Reviewed-by: chagedorn, aph
  • Loading branch information
Kim Barrett committed Nov 2, 2022
1 parent f84b0ad commit c7b95a8
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/hotspot/cpu/aarch64/assembler_aarch64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,24 +303,29 @@ class Instruction_aarch64 {
class PrePost {
int _offset;
Register _r;
public:
protected:
PrePost(Register reg, int o) : _offset(o), _r(reg) { }
int offset() { return _offset; }
Register reg() { return _r; }
~PrePost() = default;
PrePost(const PrePost&) = default;
PrePost& operator=(const PrePost&) = default;
public:
int offset() const { return _offset; }
Register reg() const { return _r; }
};

class Pre : public PrePost {
public:
Pre(Register reg, int o) : PrePost(reg, o) { }
};

class Post : public PrePost {
Register _idx;
bool _is_postreg;
public:
Post(Register reg, int o) : PrePost(reg, o) { _idx = noreg; _is_postreg = false; }
Post(Register reg, Register idx) : PrePost(reg, 0) { _idx = idx; _is_postreg = true; }
Register idx_reg() { return _idx; }
bool is_postreg() {return _is_postreg; }
Post(Register reg, int o) : PrePost(reg, o), _idx(noreg), _is_postreg(false) {}
Post(Register reg, Register idx) : PrePost(reg, 0), _idx(idx), _is_postreg(true) {}
Register idx_reg() const { return _idx; }
bool is_postreg() const { return _is_postreg; }
};

namespace ext
Expand Down

1 comment on commit c7b95a8

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.