diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 5 | ||||
-rw-r--r-- | include/opcode/arc-func.h | 17 |
2 files changed, 21 insertions, 1 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 874088d..755c014 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2016-04-05 Cupertino Miranda <cmiranda@synopsys.com> + + * opcode/arc-func.h (replace_bits24): Changed. + (replace_bits24_be): Created. + 2016-03-29 Claudiu Zissulescu <claziss@synopsys.com> * opcode/arc.h (insn_subclass_t): Add QUARKSE subclass. diff --git a/include/opcode/arc-func.h b/include/opcode/arc-func.h index 47451a6..cafb92f 100644 --- a/include/opcode/arc-func.h +++ b/include/opcode/arc-func.h @@ -66,13 +66,28 @@ replace_bits16 (unsigned insn, int value ATTRIBUTE_UNUSED) ATTRIBUTE_UNUSED static unsigned replace_bits24 (unsigned insn, int value ATTRIBUTE_UNUSED) { + insn = insn & ~0xffffff; + insn |= ((value >> 0) & 0xffffff) << 0; + + return insn; +} + +#endif /* REPLACE_bits24 */ + +/* Special 24 bit replace for big endian. */ +/* mask = 111111111111111111111111. */ +#ifndef REPLACE_bits24_be +#define REPLACE_bits24_be +ATTRIBUTE_UNUSED static unsigned +replace_bits24_be (unsigned insn, int value ATTRIBUTE_UNUSED) +{ insn = insn & ~0xffffff00; insn |= ((value >> 0) & 0xffffff) << 8; return insn; } -#endif /* REPLACE_bits24 */ +#endif /* REPLACE_bits24_be */ /* mask = 11111111111111111111111111111111. */ #ifndef REPLACE_word32 |