aboutsummaryrefslogtreecommitdiff
path: root/libcpp/include/cpplib.h
diff options
context:
space:
mode:
authorJozef Lawrynowicz <jozef.l@mittosystems.com>2020-11-13 15:35:47 +0000
committerJozef Lawrynowicz <jozef.l@mittosystems.com>2020-11-13 15:36:30 +0000
commit546c8f955804ad74b0382b012f64e621a02eebde (patch)
tree53ade7d1dd5544885a644fe2a30923907e8baafc /libcpp/include/cpplib.h
parentf62dd3982398d031bc26c853522c5f4e20ef08fc (diff)
downloadgcc-546c8f955804ad74b0382b012f64e621a02eebde.zip
gcc-546c8f955804ad74b0382b012f64e621a02eebde.tar.gz
gcc-546c8f955804ad74b0382b012f64e621a02eebde.tar.bz2
MSP430: Add defaulting to the insn length attribute
The length of MSP430 instructions is mostly just a function of the type and number of operands. Setting the "type" attribute on all insns describes the number of operands, and the position of the source and destination operands. In most cases, defaulting in the "length" and "extension" attribute definitions can then be used to calculate the total length of the instruction by using the value of the "type" attribute to examine the operands. gcc/ChangeLog: * config/msp430/msp430-protos.h (msp430x_extendhisi): Return int instead of char *. (msp430_output_asm_shift_insns): Likewise. Add new return_length argument. (msp430x_insn_required): Add prototype. * config/msp430/msp430.c (msp430_output_asm_shift_insns): Return the total length, in bytes, of the emitted instructions. (msp430x_insn_required): New function. (msp430x_extendhisi): Return the total length, in bytes, of the emitted instructions. * config/msp430/msp430.h (ADJUST_INSN_LENGTH): Define. * config/msp430/msp430.md: New define_attr "type". New define_attr "extension". New define_attr "length_multiplier". New define_attr "extra_length". Rewrite define_attr "length". Set type, extension, length, length_multiplier or extra_length insn attributes on all insns, as appropriate. (andneghi3): Rewrite using constraints instead of C code to decide output insns. * config/msp430/predicates.md (msp430_cheap_operand): New predicate. (msp430_high_memory_operand): New predicate.
Diffstat (limited to 'libcpp/include/cpplib.h')
0 files changed, 0 insertions, 0 deletions