Library SelectOpSrc
Require Import Coqlib.
Require Import AST.
Require Import Integers.
Require Import Op.
Definition offset_addressing (a: addressing) (ofs: int) : addressing :=
match a with
| Aindexed n => Aindexed (Int.add n ofs)
| Aindexed2 n => Aindexed2 (Int.add n ofs)
| Ascaled sc n => Ascaled sc (Int.add n ofs)
| Aindexed2scaled sc n => Aindexed2scaled sc (Int.add n ofs)
| Aglobal id n => Aglobal id (Int.add n ofs)
| Abased id n => Abased id (Int.add n ofs)
| Abasedscaled sc id n => Abasedscaled sc id (Int.add n ofs)
| Ainstack n => Ainstack (Int.add n ofs)
end.
Definition shift_is_scale (n: int) : bool :=
Int.eq n (Int.repr 1) || Int.eq n (Int.repr 2) || Int.eq n (Int.repr 3).
Require Import AST.
Require Import Integers.
Require Import Op.
Definition offset_addressing (a: addressing) (ofs: int) : addressing :=
match a with
| Aindexed n => Aindexed (Int.add n ofs)
| Aindexed2 n => Aindexed2 (Int.add n ofs)
| Ascaled sc n => Ascaled sc (Int.add n ofs)
| Aindexed2scaled sc n => Aindexed2scaled sc (Int.add n ofs)
| Aglobal id n => Aglobal id (Int.add n ofs)
| Abased id n => Abased id (Int.add n ofs)
| Abasedscaled sc id n => Abasedscaled sc id (Int.add n ofs)
| Ainstack n => Ainstack (Int.add n ofs)
end.
Definition shift_is_scale (n: int) : bool :=
Int.eq n (Int.repr 1) || Int.eq n (Int.repr 2) || Int.eq n (Int.repr 3).