Activate AVR on all architectures

This commit is contained in:
serge-sans-paille 2019-11-26 06:02:40 +00:00
parent acf22be74c
commit 8ddd41e8d9
2 changed files with 47 additions and 3 deletions

View file

@ -0,0 +1,42 @@
From 29b4d8f19e30910c099c5453da258843d6b7869a Mon Sep 17 00:00:00 2001
From: serge_sans_paille <sguelton@redhat.com>
Date: Tue, 24 Sep 2019 10:20:08 +0200
Subject: [PATCH] [AVR] Fix endianness handling in AVR MC
Differential Revision: https://reviews.llvm.org/D67926
---
llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
index bc048877868..db995e24756 100644
--- a/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
+++ b/llvm/lib/Target/AVR/MCTargetDesc/AVRMCCodeEmitter.cpp
@@ -25,6 +25,7 @@
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/Support/Casting.h"
+#include "llvm/Support/EndianStream.h"
#include "llvm/Support/raw_ostream.h"
#define DEBUG_TYPE "mccodeemitter"
@@ -268,14 +269,11 @@ unsigned AVRMCCodeEmitter::getMachineOpValue(const MCInst &MI,
void AVRMCCodeEmitter::emitInstruction(uint64_t Val, unsigned Size,
const MCSubtargetInfo &STI,
raw_ostream &OS) const {
- const uint16_t *Words = reinterpret_cast<uint16_t const *>(&Val);
size_t WordCount = Size / 2;
for (int64_t i = WordCount - 1; i >= 0; --i) {
- uint16_t Word = Words[i];
-
- OS << (uint8_t) ((Word & 0x00ff) >> 0);
- OS << (uint8_t) ((Word & 0xff00) >> 8);
+ uint16_t Word = (Val >> (i * 16)) & 0xFFFF;
+ support::endian::write(OS, Word, support::endianness::little);
}
}
--
2.20.1

View file

@ -14,7 +14,7 @@
%global min_ver 0
%global patch_ver 0
#%%global rc_ver 3
%global baserelease 3
%global baserelease 4
%if %{with compat_build}
@ -56,6 +56,7 @@ Patch0: 0001-Filter-out-cxxflags-not-supported-by-clang.patch
Patch1: 0001-Pass-target-to-gold-linker-to-avoid-faliures-on-i686.patch
Patch2: 0001-CMake-Split-static-library-exports-into-their-own-ex.patch
Patch3: 0001-CMake-Split-test-binary-exports-into-their-own-expor.patch
Patch4: 0001-AVR-Fix-endianness-handling-in-AVR-MC.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@ -200,9 +201,7 @@ cd _build
%if %{with gold}
-DLLVM_BINUTILS_INCDIR=%{_includedir} \
%endif
%ifnarch s390 s390x
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=AVR \
%endif
\
-DLLVM_BUILD_RUNTIME:BOOL=ON \
\
@ -480,6 +479,9 @@ fi
%endif
%changelog
* Mon Nov 25 2019 sguelton@redhat.com - 9.0.0-4
- Activate AVR on all architectures
* Mon Sep 30 2019 Tom Stellard <tstellar@redhat.com> - 9.0.0-3
- Build libLLVM.so first to avoid OOM errors