File: Remove64.h

package info (click to toggle)
storm-lang 0.7.4-1
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 52,004 kB
  • sloc: ansic: 261,462; cpp: 140,405; sh: 14,891; perl: 9,846; python: 2,525; lisp: 2,504; asm: 860; makefile: 678; pascal: 70; java: 52; xml: 37; awk: 12
file content (58 lines) | stat: -rw-r--r-- 1,944 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#pragma once
#include "../Transform.h"
#include "../OpTable.h"
#include "../UsedRegs.h"

namespace code {
	namespace x86 {
		STORM_PKG(core.asm.x86);

		/**
		 * Remove any 64-bit operands.
		 */
		class Remove64 : public Transform {
			STORM_CLASS;
		public:
			STORM_CTOR Remove64();

			// Start transform.
			virtual void STORM_FN before(Listing *dest, Listing *src);

			// Transform one instruction.
			virtual void STORM_FN during(Listing *dest, Listing *src, Nat line);

		private:
			// Remember used registers.
			Array<RegSet *> *used;

			// Signature for transform functions.
			typedef void (Remove64::*TransformFn)(Listing *dest, Instr *src, RegSet *used);

			// Transform table.
			static const OpEntry<TransformFn> transformMap[];

			// Transform functions.
			void movTfm(Listing *to, Instr *instr, RegSet *used);
			void shadowMovTfm(Listing *to, Instr *instr, RegSet *used);
			void swapTfm(Listing *to, Instr *instr, RegSet *used);
			void addTfm(Listing *to, Instr *instr, RegSet *used);
			void adcTfm(Listing *to, Instr *instr, RegSet *used);
			void borTfm(Listing *to, Instr *instr, RegSet *used);
			void bandTfm(Listing *to, Instr *instr, RegSet *used);
			void bnotTfm(Listing *to, Instr *instr, RegSet *used);
			void subTfm(Listing *to, Instr *instr, RegSet *used);
			void sbbTfm(Listing *to, Instr *instr, RegSet *used);
			void bxorTfm(Listing *to, Instr *instr, RegSet *used);
			void cmpTfm(Listing *to, Instr *instr, RegSet *used);
			void testTfm(Listing *to, Instr *instr, RegSet *used);
			void mulTfm(Listing *to, Instr *instr, RegSet *used);
			void idivTfm(Listing *to, Instr *instr, RegSet *used);
			void udivTfm(Listing *to, Instr *instr, RegSet *used);
			void imodTfm(Listing *to, Instr *instr, RegSet *used);
			void umodTfm(Listing *to, Instr *instr, RegSet *used);
			void pushTfm(Listing *to, Instr *instr, RegSet *used);
			void popTfm(Listing *to, Instr *instr, RegSet *used);
		};

	}
}