//
//===----------------------------------------------------------------------===//
-#ifndef X86MODRMFILTERS_H
-#define X86MODRMFILTERS_H
+#ifndef LLVM_UTILS_TABLEGEN_X86MODRMFILTERS_H
+#define LLVM_UTILS_TABLEGEN_X86MODRMFILTERS_H
#include "llvm/Support/DataTypes.h"
/// require a ModR/M byte or instructions where the entire ModR/M byte is used
/// for operands.
class DumbFilter : public ModRMFilter {
- virtual void anchor();
+ void anchor() override;
public:
- bool isDumb() const {
+ bool isDumb() const override {
return true;
}
-
- bool accepts(uint8_t modRM) const {
+
+ bool accepts(uint8_t modRM) const override {
return true;
}
};
/// Some instructions are classified based on whether they are 11 or anything
/// else. This filter performs that classification.
class ModFilter : public ModRMFilter {
- virtual void anchor();
+ void anchor() override;
bool R;
public:
/// Constructor
R(r) {
}
- bool accepts(uint8_t modRM) const {
+ bool accepts(uint8_t modRM) const override {
return (R == ((modRM & 0xc0) == 0xc0));
}
};
-/// AddRegEscapeFilter - Some escape opcodes have one of the register operands
-/// added to the ModR/M byte, meaning that a range of eight ModR/M values
-/// maps to a single instruction. Such instructions require the ModR/M byte
-/// to fall between 0xc0 and 0xff.
-class AddRegEscapeFilter : public ModRMFilter {
- virtual void anchor();
- uint8_t ModRM;
-public:
- /// Constructor
- ///
- /// \param modRM The value of the ModR/M byte when the register operand
- /// refers to the first register in the register set.
- AddRegEscapeFilter(uint8_t modRM) : ModRM(modRM) {
- }
-
- bool accepts(uint8_t modRM) const {
- return (modRM >= ModRM && modRM < ModRM + 8);
- }
-};
-
/// ExtendedFilter - Extended opcodes are classified based on the value of the
/// mod field [bits 7-6] and the value of the nnn field [bits 5-3].
class ExtendedFilter : public ModRMFilter {
- virtual void anchor();
+ void anchor() override;
bool R;
uint8_t NNN;
public:
NNN(nnn) {
}
- bool accepts(uint8_t modRM) const {
+ bool accepts(uint8_t modRM) const override {
return (((R && ((modRM & 0xc0) == 0xc0)) ||
(!R && ((modRM & 0xc0) != 0xc0))) &&
(((modRM & 0x38) >> 3) == NNN));
/// ExactFilter - The occasional extended opcode (such as VMCALL or MONITOR)
/// requires the ModR/M byte to have a specific value.
class ExactFilter : public ModRMFilter {
- virtual void anchor();
+ void anchor() override;
uint8_t ModRM;
public:
/// Constructor
ModRM(modRM) {
}
- bool accepts(uint8_t modRM) const {
+ bool accepts(uint8_t modRM) const override {
return (ModRM == modRM);
}
};