mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-11-26 23:21:11 +00:00
Update LLVM release/17.x
This commit is contained in:
parent
9e66027aaf
commit
406db7f1fe
@ -173,7 +173,7 @@ bool checkRegister(const ThumbRelocation &R, HalfWords Reg) {
|
||||
}
|
||||
|
||||
template <EdgeKind_aarch32 Kind>
|
||||
bool writeRegister(WritableThumbRelocation &R, HalfWords Reg) {
|
||||
void writeRegister(WritableThumbRelocation &R, HalfWords Reg) {
|
||||
static constexpr HalfWords Mask = FixupInfo<Kind>::RegMask;
|
||||
assert((Mask.Hi & Reg.Hi) == Reg.Hi && (Mask.Hi & Reg.Hi) == Reg.Hi &&
|
||||
"Value bits exceed bit range of given mask");
|
||||
|
@ -991,12 +991,12 @@ void RISCVDAGToDAGISel::Select(SDNode *Node) {
|
||||
unsigned TrailingOnes = llvm::countr_one(Mask);
|
||||
if (ShAmt >= TrailingOnes)
|
||||
break;
|
||||
// If the mask has 32 trailing ones, use SRLIW.
|
||||
// If the mask has 32 trailing ones, use SRLI on RV32 or SRLIW on RV64.
|
||||
if (TrailingOnes == 32) {
|
||||
SDNode *SRLIW =
|
||||
CurDAG->getMachineNode(RISCV::SRLIW, DL, VT, N0->getOperand(0),
|
||||
CurDAG->getTargetConstant(ShAmt, DL, VT));
|
||||
ReplaceNode(Node, SRLIW);
|
||||
SDNode *SRLI = CurDAG->getMachineNode(
|
||||
Subtarget->is64Bit() ? RISCV::SRLIW : RISCV::SRLI, DL, VT,
|
||||
N0->getOperand(0), CurDAG->getTargetConstant(ShAmt, DL, VT));
|
||||
ReplaceNode(Node, SRLI);
|
||||
return;
|
||||
}
|
||||
|
||||
|
21
llvm/test/CodeGen/RISCV/aext.ll
Normal file
21
llvm/test/CodeGen/RISCV/aext.ll
Normal file
@ -0,0 +1,21 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
||||
; RUN: llc -mtriple=riscv32 -verify-machineinstrs < %s \
|
||||
; RUN: | FileCheck -check-prefix=RV32I %s
|
||||
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
|
||||
; RUN: | FileCheck -check-prefix=RV64I %s
|
||||
|
||||
define i24 @aext(i32 %0) {
|
||||
; RV32I-LABEL: aext:
|
||||
; RV32I: # %bb.0:
|
||||
; RV32I-NEXT: srli a0, a0, 8
|
||||
; RV32I-NEXT: ret
|
||||
;
|
||||
; RV64I-LABEL: aext:
|
||||
; RV64I: # %bb.0:
|
||||
; RV64I-NEXT: srliw a0, a0, 8
|
||||
; RV64I-NEXT: ret
|
||||
%2 = and i32 %0, -256
|
||||
%3 = lshr exact i32 %2, 8
|
||||
%4 = trunc i32 %3 to i24
|
||||
ret i24 %4
|
||||
}
|
@ -272,7 +272,7 @@ def ptxas_version(ptxas):
|
||||
ptxas_cmd = subprocess.Popen([ptxas, "--version"], stdout=subprocess.PIPE)
|
||||
ptxas_out = ptxas_cmd.stdout.read().decode("ascii")
|
||||
ptxas_cmd.wait()
|
||||
match = re.search("release (\d+)\.(\d+)", ptxas_out)
|
||||
match = re.search(r"release (\d+)\.(\d+)", ptxas_out)
|
||||
if match:
|
||||
return (int(match.group(1)), int(match.group(2)))
|
||||
print("couldn't determine ptxas version")
|
||||
|
@ -33,12 +33,14 @@ if(LLVM_BUILD_LLVM_DYLIB)
|
||||
add_llvm_library(LLVM SHARED DISABLE_LLVM_LINK_LLVM_DYLIB SONAME ${INSTALL_WITH_TOOLCHAIN} ${SOURCES})
|
||||
|
||||
list(REMOVE_DUPLICATES LIB_NAMES)
|
||||
if(("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") OR (MINGW) OR (HAIKU)
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
|
||||
if((MINGW) OR (HAIKU)
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "GNU")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "NetBSD")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "DragonFly")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "Android")
|
||||
OR ("${CMAKE_SYSTEM_NAME}" STREQUAL "SunOS")) # FIXME: It should be "GNU ld for elf"
|
||||
configure_file(
|
||||
|
@ -202,7 +202,7 @@ def expand_glob_expressions(args, cwd):
|
||||
|
||||
|
||||
def quote_windows_command(seq):
|
||||
"""
|
||||
r"""
|
||||
Reimplement Python's private subprocess.list2cmdline for MSys compatibility
|
||||
|
||||
Based on CPython implementation here:
|
||||
@ -1558,7 +1558,7 @@ def applySubstitutions(script, substitutions, conditions={}, recursion_limit=Non
|
||||
return cond, ln
|
||||
|
||||
def tryParseElse(ln):
|
||||
match = _caching_re_compile("^\s*%else\s*(%{)?").search(ln)
|
||||
match = _caching_re_compile(r"^\s*%else\s*(%{)?").search(ln)
|
||||
if not match:
|
||||
return False, ln
|
||||
if not match.group(1):
|
||||
|
Loading…
Reference in New Issue
Block a user