mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Change how so_imm and t2_so_imm are handled. At instruction selection time, the immediates are no longer encoded in the imm8 + rot format, that are left as it is. The encoding is now done in ams printing and code emission time instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75048 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -273,29 +273,6 @@ namespace ARM_AM {
|
||||
return V >> getThumbImmValShift(V);
|
||||
}
|
||||
|
||||
/// getT2SOImmValDecode - Given a 12-bit encoded Thumb-2 modified immediate,
|
||||
/// return the corresponding 32-bit immediate value.
|
||||
/// See ARM Reference Manual A6.3.2.
|
||||
static inline unsigned getT2SOImmValDecode(unsigned Imm) {
|
||||
unsigned Base = Imm & 0xff;
|
||||
switch ((Imm >> 8) & 0xf) {
|
||||
case 0:
|
||||
return Base;
|
||||
case 1:
|
||||
return Base | (Base << 16);
|
||||
case 2:
|
||||
return (Base << 8) | (Base << 24);
|
||||
case 3:
|
||||
return Base | (Base << 8) | (Base << 16) | (Base << 24);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
// shifted immediate
|
||||
unsigned RotAmount = ((Imm >> 7) & 0x1f) - 8;
|
||||
return (Base | 0x80) << (24 - RotAmount);
|
||||
}
|
||||
|
||||
/// getT2SOImmValSplat - Return the 12-bit encoded representation
|
||||
/// if the specified value can be obtained by splatting the low 8 bits
|
||||
/// into every other byte or every byte of a 32-bit value. i.e.,
|
||||
|
Reference in New Issue
Block a user