diff options
Diffstat (limited to 'include/opcode/arc-func.h')
-rw-r--r-- | include/opcode/arc-func.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/opcode/arc-func.h b/include/opcode/arc-func.h index cafb92f..c92382b 100644 --- a/include/opcode/arc-func.h +++ b/include/opcode/arc-func.h @@ -264,3 +264,18 @@ replace_disp9s1 (unsigned insn, int value ATTRIBUTE_UNUSED) } #endif /* REPLACE_disp9s1 */ + +/* mask = 00000000000000000000111111222222. */ +#ifndef REPLACE_disp12s +#define REPLACE_disp12s +ATTRIBUTE_UNUSED static unsigned +replace_disp12s (unsigned insn, int value ATTRIBUTE_UNUSED) +{ + insn = insn & ~0xfff; + insn |= ((value >> 0) & 0x003f) << 6; + insn |= ((value >> 6) & 0x003f) << 0; + + return insn; +} + +#endif /* REPLACE_disp12s */ |