5773c09eb1
a whole bunch of new devices.
114 lines
4.2 KiB
Plaintext
114 lines
4.2 KiB
Plaintext
$OpenBSD: patch-gas_config_tc-avr_c,v 1.2 2009/12/09 16:55:52 ckuethe Exp $
|
|
--- gas/config/tc-avr.c.orig Fri Aug 29 09:58:02 2008
|
|
+++ gas/config/tc-avr.c Sun Dec 6 21:48:53 2009
|
|
@@ -27,20 +27,21 @@
|
|
|
|
struct avr_opcodes_s
|
|
{
|
|
- char * name;
|
|
- char * constraints;
|
|
- int insn_size; /* In words. */
|
|
- int isa;
|
|
+ char *name;
|
|
+ char *constraints;
|
|
+ char *opcode;
|
|
+ int insn_size; /* In words. */
|
|
+ int isa;
|
|
unsigned int bin_opcode;
|
|
};
|
|
|
|
#define AVR_INSN(NAME, CONSTR, OPCODE, SIZE, ISA, BIN) \
|
|
-{#NAME, CONSTR, SIZE, ISA, BIN},
|
|
+{#NAME, CONSTR, OPCODE, SIZE, ISA, BIN},
|
|
|
|
struct avr_opcodes_s avr_opcodes[] =
|
|
{
|
|
#include "opcode/avr.h"
|
|
- {NULL, NULL, 0, 0, 0}
|
|
+ {NULL, NULL, NULL, 0, 0, 0}
|
|
};
|
|
|
|
const char comment_chars[] = ";";
|
|
@@ -79,6 +80,13 @@ static struct mcu_type_s mcu_types[] =
|
|
{"avr5", AVR_ISA_AVR51, bfd_mach_avr5},
|
|
{"avr51", AVR_ISA_AVR51, bfd_mach_avr51},
|
|
{"avr6", AVR_ISA_AVR6, bfd_mach_avr6},
|
|
+ {"avrxmega1", AVR_ISA_XMEGA, bfd_mach_avrxmega1},
|
|
+ {"avrxmega2", AVR_ISA_XMEGA, bfd_mach_avrxmega2},
|
|
+ {"avrxmega3", AVR_ISA_XMEGA, bfd_mach_avrxmega3},
|
|
+ {"avrxmega4", AVR_ISA_XMEGA, bfd_mach_avrxmega4},
|
|
+ {"avrxmega5", AVR_ISA_XMEGA, bfd_mach_avrxmega5},
|
|
+ {"avrxmega6", AVR_ISA_XMEGA, bfd_mach_avrxmega6},
|
|
+ {"avrxmega7", AVR_ISA_XMEGA, bfd_mach_avrxmega7},
|
|
{"at90s1200", AVR_ISA_1200, bfd_mach_avr1},
|
|
{"attiny11", AVR_ISA_AVR1, bfd_mach_avr1},
|
|
{"attiny12", AVR_ISA_AVR1, bfd_mach_avr1},
|
|
@@ -173,6 +181,7 @@ static struct mcu_type_s mcu_types[] =
|
|
{"atmega32c1", AVR_ISA_AVR5, bfd_mach_avr5},
|
|
{"atmega32m1", AVR_ISA_AVR5, bfd_mach_avr5},
|
|
{"atmega32u4", AVR_ISA_AVR5, bfd_mach_avr5},
|
|
+ {"atmega32u6", AVR_ISA_AVR5, bfd_mach_avr5},
|
|
{"at90usb646", AVR_ISA_AVR5, bfd_mach_avr5},
|
|
{"at90usb647", AVR_ISA_AVR5, bfd_mach_avr5},
|
|
{"at94k", AVR_ISA_94K, bfd_mach_avr5},
|
|
@@ -185,6 +194,16 @@ static struct mcu_type_s mcu_types[] =
|
|
{"at90usb1287",AVR_ISA_AVR51, bfd_mach_avr51},
|
|
{"atmega2560", AVR_ISA_AVR6, bfd_mach_avr6},
|
|
{"atmega2561", AVR_ISA_AVR6, bfd_mach_avr6},
|
|
+ {"atxmega16a4", AVR_ISA_XMEGA, bfd_mach_avrxmega2},
|
|
+ {"atxmega16d4", AVR_ISA_XMEGA, bfd_mach_avrxmega2},
|
|
+ {"atxmega32d4", AVR_ISA_XMEGA, bfd_mach_avrxmega2},
|
|
+ {"atxmega32a4", AVR_ISA_XMEGA, bfd_mach_avrxmega3},
|
|
+ {"atxmega64a3", AVR_ISA_XMEGA, bfd_mach_avrxmega4},
|
|
+ {"atxmega64a1", AVR_ISA_XMEGA, bfd_mach_avrxmega5},
|
|
+ {"atxmega128a3", AVR_ISA_XMEGA, bfd_mach_avrxmega6},
|
|
+ {"atxmega256a3", AVR_ISA_XMEGA, bfd_mach_avrxmega6},
|
|
+ {"atxmega256a3b",AVR_ISA_XMEGA, bfd_mach_avrxmega6},
|
|
+ {"atxmega128a1", AVR_ISA_XMEGA, bfd_mach_avrxmega7},
|
|
{NULL, 0, 0}
|
|
};
|
|
|
|
@@ -362,6 +381,11 @@ md_show_usage (FILE *stream)
|
|
" avr5 - enhanced AVR core with up to 64K program memory\n"
|
|
" avr51 - enhanced AVR core with up to 128K program memory\n"
|
|
" avr6 - enhanced AVR core with up to 256K program memory\n"
|
|
+ " avrxmega3 - XMEGA, > 8K, <= 64K FLASH, > 64K RAM\n"
|
|
+ " avrxmega4 - XMEGA, > 64K, <= 128K FLASH, <= 64K RAM\n"
|
|
+ " avrxmega5 - XMEGA, > 64K, <= 128K FLASH, > 64K RAM\n"
|
|
+ " avrxmega6 - XMEGA, > 128K, <= 256K FLASH, <= 64K RAM\n"
|
|
+ " avrxmega7 - XMEGA, > 128K, <= 256K FLASH, > 64K RAM\n"
|
|
" or immediate microcontroller name.\n"));
|
|
fprintf (stream,
|
|
_(" -mall-opcodes accept all AVR opcodes, even if not supported by MCU\n"
|
|
@@ -789,7 +813,12 @@ avr_operand (struct avr_opcodes_s *opcode,
|
|
if (*str == '+')
|
|
{
|
|
++str;
|
|
- op_mask |= 1;
|
|
+ char *s;
|
|
+ for (s = opcode->opcode; *s; ++s)
|
|
+ {
|
|
+ if (*s == '+')
|
|
+ op_mask |= (1 << (15 - (s - opcode->opcode)));
|
|
+ }
|
|
}
|
|
|
|
/* attiny26 can do "lpm" and "lpm r,Z" but not "lpm r,Z+". */
|
|
@@ -906,6 +935,16 @@ avr_operand (struct avr_opcodes_s *opcode,
|
|
}
|
|
break;
|
|
|
|
+ case 'E':
|
|
+ {
|
|
+ unsigned int x;
|
|
+
|
|
+ x = avr_get_constant (str, 15);
|
|
+ str = input_line_pointer;
|
|
+ op_mask |= (x << 4);
|
|
+ }
|
|
+ break;
|
|
+
|
|
case '?':
|
|
break;
|
|
|