Files
clang-p2996/llvm/test/CodeGen/AVR/PR37143.ll
Ben Shi 2a528760bf [AVR] Fix an issue of writing 16-bit ports
For 16-bit ports, the normal devices reqiure writing high byte first
and then low byte. But the XMEGA devices require the reverse order.

Fixes https://github.com/llvm/llvm-project/issues/58395

Reviewed By: aykevl, jacquesguan

Differential Revision: https://reviews.llvm.org/D141752
2023-04-17 15:35:33 +08:00

14 lines
422 B
LLVM

; RUN: llc -mattr=avr6,sram < %s -march=avr -verify-machineinstrs | FileCheck %s
; CHECK: ld {{r[0-9]+}}, [[PTR:[XYZ]]]
; CHECK: ldd {{r[0-9]+}}, [[PTR]]+1
; CHECK: std [[PTR2:[XYZ]]]+1, {{r[0-9]+}}
; CHECK: st [[PTR2]], {{r[0-9]+}}
define void @load_store_16(i16* nocapture %ptr) local_unnamed_addr #1 {
entry:
%0 = load i16, i16* %ptr, align 2
%add = add i16 %0, 5
store i16 %add, i16* %ptr, align 2
ret void
}