Skip to content

Commit 07a96e3

Browse files
committed
[AVR] Add 16-bit version of load-from-global
1 parent de25392 commit 07a96e3

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/Target/AVR/AVRInstrInfo.td

+3-1
Original file line numberDiff line numberDiff line change
@@ -2033,8 +2033,10 @@ def Asr16 : ShiftPseudo<
20332033
// Non-Instruction Patterns
20342034
//===----------------------------------------------------------------------===//
20352035

2036-
def : Pat<(load (add i16:$offset, (AVRWrapper tglobaladdr:$base))),
2036+
def : Pat<(i8 (load (add i16:$offset, (AVRWrapper tglobaladdr:$base)))),
20372037
(LPMRdZ (SUBIWRdK i16:$offset, tglobaladdr:$base))>;
2038+
def : Pat<(i16 (load (add i16:$offset, (AVRWrapper tglobaladdr:$base)))),
2039+
(LPMWRdZ (SUBIWRdK i16:$offset, tglobaladdr:$base))>;
20382040

20392041
//:TODO: look in x86InstrCompiler.td for odd encoding trick related to
20402042
// add x, 128 -> sub x, -128. Clang is emitting an eor for this (ldi+eor)

0 commit comments

Comments
 (0)