https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106542
>From a7b7545c2e895b46a5aaa7525ad030ea0c48c163 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Wed, 28 Aug 2024 16:09:44 +0300
Subject: [PATCH] [SimplifyLibCalls] Add initial support for non-8-bit by
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106541
>From 1591f0bc03f6e8437fad91870fddae87cf270ffd Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Wed, 28 Aug 2024 23:51:13 +0300
Subject: [PATCH] [ValueTracking] Add CharWidth argument to
getConstantS
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106539
>From caa10b7614c372aea15ad17a23ec6e0a6b29f6a7 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 22 Aug 2024 15:10:58 +0300
Subject: [PATCH] [IRBuilder] Add getByteTy and use it in CreatePtrAdd
T
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106540
>From 4d50f231545a49befa155dd68cb1e55cf8d7af33 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 29 Aug 2024 00:54:20 +0300
Subject: [PATCH] [IR] Account for byte width in m_PtrAdd
The method has
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106538
>From 4650b11d6d467e0ca66fed3cea61ed3d77f98fd4 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Fri, 2 Aug 2024 13:14:49 +0300
Subject: [PATCH] [ValueTracking] Make isBytewiseValue byte width agnostic
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106542
>From c46fbb92b0573dc5dd79b6da7b6955df8b7db7c8 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Wed, 28 Aug 2024 16:09:44 +0300
Subject: [PATCH] [SimplifyLibCalls] Add initial support for non-8-bit by
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106537
>From 2080c3eacf59f6a63aa8b400af9e1177f6f52cbd Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 1 Aug 2024 23:47:25 +0300
Subject: [PATCH] [IR] Make @llvm.memset prototype byte width dependent
T
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106542
>From 4bf7017413eafc29a432941a56cb7356074828f7 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Wed, 28 Aug 2024 16:09:44 +0300
Subject: [PATCH] [SimplifyLibCalls] Add initial support for non-8-bit by
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106541
>From b878d8834e17681c4d53f2b65c6ed7b24d89f3c4 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Wed, 28 Aug 2024 23:51:13 +0300
Subject: [PATCH] [ValueTracking] Add CharWidth argument to
getConstantS
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106540
>From 68b0d700521ba040347ad0a04cf2e090fdd81d93 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 29 Aug 2024 00:54:20 +0300
Subject: [PATCH] [IR] Account for byte width in m_PtrAdd
The method has
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106539
>From 1655f416864eb0c5849d96aa10c1eb9214aecf5c Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 22 Aug 2024 15:10:58 +0300
Subject: [PATCH] [IRBuilder] Add getByteTy and use it in CreatePtrAdd
T
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106538
>From 1f681888e8eb5629894a094755bc0c596cf62e6a Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Fri, 2 Aug 2024 13:14:49 +0300
Subject: [PATCH] [ValueTracking] Make isBytewiseValue byte width agnostic
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106537
>From 28662b70cdb4dbd2aafe3feddd2a09e14ea018aa Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 1 Aug 2024 23:47:25 +0300
Subject: [PATCH] [IR] Make @llvm.memset prototype byte width dependent
T
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106542
>From d2b8f2e23d50c638c31c787003c0e67feac98f18 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Wed, 28 Aug 2024 16:09:44 +0300
Subject: [PATCH] [SimplifyLibCalls] Add initial support for non-8-bit by
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106541
>From 0a21746432336f2460bb916ede9cdb1a1ea61dd6 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Wed, 28 Aug 2024 23:51:13 +0300
Subject: [PATCH] [ValueTracking] Add CharWidth argument to
getConstantS
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106540
>From 161e6baa5bd1b8349d79e4cf1f4d3ce32348502f Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 29 Aug 2024 00:54:20 +0300
Subject: [PATCH] [IR] Account for byte width in m_PtrAdd
The method has
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106539
>From 517a87c03b68e0a9392841276fd69dd3c483eb12 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 22 Aug 2024 15:10:58 +0300
Subject: [PATCH] [IRBuilder] Add getByteTy and use it in CreatePtrAdd
T
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106538
>From 81781bc2aa7360f50688e24b361ef768d4d6f961 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Fri, 2 Aug 2024 13:14:49 +0300
Subject: [PATCH] [ValueTracking] Make isBytewiseValue byte width agnostic
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106537
>From 83efc1aa133fb2e52e81ae4319c978859da61911 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 1 Aug 2024 23:47:25 +0300
Subject: [PATCH] [IR] Make @llvm.memset prototype byte width dependent
T
@@ -0,0 +1,28 @@
+//===- llvm/CodeGen/ProcessImplicitDefs.h ---*- C++
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,98 @@
+//===--- SparcInstrCrypto.td - cryptographic extensions
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,98 @@
+//===--- SparcInstrCrypto.td - cryptographic extensions
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/139451
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -0,0 +1,98 @@
+//===--- SparcInstrCrypto.td - cryptographic extensions
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/s-barannikov approved this pull request.
LGTM with formatting nits
https://github.com/llvm/llvm-project/pull/139451
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listin
@@ -0,0 +1,98 @@
+//===--- SparcInstrCrypto.td - cryptographic extensions
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,98 @@
+//===--- SparcInstrCrypto.td - cryptographic extensions
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,98 @@
+//===--- SparcInstrCrypto.td - cryptographic extensions
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,98 @@
+//===--- SparcInstrCrypto.td - cryptographic extensions
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
@@ -0,0 +1,98 @@
+//===--- SparcInstrCrypto.td - cryptographic extensions
---===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/s-barannikov approved this pull request.
https://github.com/llvm/llvm-project/pull/138403
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -102,6 +102,49 @@ class F2_4 pattern = [], InstrItinClass itin = NoItinerary>
+ : InstSP {
+ bits<10> imm10;
+ bits<5> rs1;
+ bits<5> rs2;
+ bits<4> cond;
+
+ let op = 0; // op = 0
+
+ let Inst{29}= cond{3};
+ let Inst{28}= 1;
+ let Inst{27-25} = c
@@ -0,0 +1,267 @@
+! RUN: llvm-mc -triple=sparcv9 -mattr=+osa2011 -filetype=obj %s | llvm-objdump
--mattr=+osa2011 --no-print-imm-hex -d - | FileCheck %s --check-prefix=BIN
+
+!! SPARCv9/SPARC64 BPr branches have different offset encoding from
the others,
---
@@ -408,6 +427,46 @@ defm : reg_cond_alias<"ne", 0b101>;
defm : reg_cond_alias<"gz", 0b110>;
defm : reg_cond_alias<"gez", 0b111>;
+defm : cwb_cond_alias<"ne", 0b1001>;
+defm : cwb_cond_alias<"e",0b0001>;
+defm : cwb_cond_alias<"g",0b1010>;
+defm : cwb_cond_alias
@@ -102,6 +102,49 @@ class F2_4 pattern = [], InstrItinClass itin = NoItinerary>
+ : InstSP {
s-barannikov wrote:
```suggestion
: InstSP {
```
https://github.com/llvm/llvm-project/pull/138403
___
llvm-branch-comm
@@ -141,6 +147,26 @@ getMachineOpValue(const MCInst &MI, const MCOperand &MO,
return 0;
}
+unsigned SparcMCCodeEmitter::getSImm5OpValue(const MCInst &MI, unsigned OpNo,
+ SmallVectorImpl &Fixups,
+
@@ -331,6 +331,25 @@ multiclass reg_cond_alias {
Requires<[Is64Bit]>;
}
+// Instruction aliases for compare-and-branch.
+multiclass cwb_cond_alias {
+ def : InstAliashttps://github.com/llvm/llvm-project/pull/138403
_
@@ -665,3 +724,9 @@ def : InstAlias<"signx $rs1, $rd", (SRArr IntRegs:$rd,
IntRegs:$rs1, G0), 0>, Re
// sir -> sir 0
def : InstAlias<"sir", (SIR 0), 0>;
+
+// pause reg_or_imm -> wrasr %g0, reg_or_imm, %asr27
+let Predicates = [HasOSA2011] in {
+def : InstAlias<"pause $rs2",
@@ -217,6 +243,18 @@ unsigned SparcMCCodeEmitter::getBranchOnRegTargetOpValue(
return 0;
}
+unsigned SparcMCCodeEmitter::getCompareAndBranchTargetOpValue(
+const MCInst &MI, unsigned OpNo, SmallVectorImpl &Fixups,
+const MCSubtargetInfo &STI) const {
+ const MCOpera
@@ -50,6 +50,15 @@ static unsigned adjustFixupValue(unsigned Kind, uint64_t
Value) {
return (d16hi << 20) | d16lo;
}
+ case ELF::R_SPARC_WDISP10: {
+// 7.17 Compare and Branch
+// Inst{20-19} = d10hi;
+// Inst{12-5} = d10lo;
+unsigned d10hi = (Value >>
https://github.com/s-barannikov approved this pull request.
https://github.com/llvm/llvm-project/pull/138401
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -0,0 +1,28 @@
+//=== SparcInstrUAOSA.td - UltraSPARC/Oracle SPARC Architecture extensions
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/s-barannikov approved this pull request.
https://github.com/llvm/llvm-project/pull/138400
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -38,3 +53,92 @@ def FNMADDD : FourOp<"fnmaddd", 0b110111, 0b1110, DFPRegs>;
def FNMSUBS : FourOp<"fnmsubs", 0b110111, 0b1001, FPRegs>;
def FNMSUBD : FourOp<"fnmsubd", 0b110111, 0b1010, DFPRegs>;
} // Predicates = [HasUA2007]
+
+// Oracle SPARC Architecture 2011 Instructions
@@ -19,3 +25,16 @@ def ALLCLEAN : InstSP<(outs), (ins), "allclean", []> {
let Inst{18-0} = 0;
}
} // Predicates = [HasUA2005]
+
+// UltraSPARC Architecture 2007 Instructions
+let Predicates = [HasUA2007] in {
+def FMADDS : FourOp<"fmadds", 0b110111, 0b0001, FPRegs>;
+def FM
@@ -152,13 +155,15 @@ def : Proc<"ultrasparc3", [FeatureV9,
FeatureV8Deprecated, FeatureVIS,
FeatureVIS2],
[TuneSlowRDPC]>;
def : Proc<"niagara", [FeatureV9, FeatureV8Deprecated, FeatureVIS,
-
@@ -0,0 +1,36 @@
+//=== SparcInstrUAOSA.td - UltraSPARC/Oracle SPARC Architecture extensions
===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apa
https://github.com/s-barannikov approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/138402
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commit
@@ -0,0 +1,21 @@
+//=== SparcInstrVIS.td - Visual Instruction Set extensions (VIS) -===//
s-barannikov wrote:
Copy&paste bug
https://github.com/llvm/llvm-project/pull/138400
___
llvm-branch-commits mailing list
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/138400
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/s-barannikov commented:
What about other instructions? (OTHERW, NORMALW, INVALWP)
https://github.com/llvm/llvm-project/pull/138400
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bi
@@ -0,0 +1,21 @@
+//=== SparcInstrVIS.td - Visual Instruction Set extensions (VIS) -===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apach
https://github.com/s-barannikov approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/138399
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commit
s-barannikov wrote:
Is something blocking this PR?
https://github.com/llvm/llvm-project/pull/135894
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -1,70 +1,438 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=sparc -mcpu=v9 | FileCheck %s
+; RUN: llc < %s -mtriple=sparc | FileCheck %s -check-prefix=SPARC
+; RUN: llc < %s -mtriple=sparc -mattr=popc | FileCheck %s
https://github.com/s-barannikov approved this pull request.
LGTM with one note
https://github.com/llvm/llvm-project/pull/135894
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm
@@ -1,70 +1,438 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=sparc -mcpu=v9 | FileCheck %s
+; RUN: llc < %s -mtriple=sparc | FileCheck %s -check-prefix=SPARC
+; RUN: llc < %s -mtriple=sparc -mattr=popc | FileCheck %s
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/135894
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106542
>From bb76990f184c59abfcaa7c5f9409ec8d9b309636 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Wed, 28 Aug 2024 16:09:44 +0300
Subject: [PATCH] [SimplifyLibCalls] Add initial support for non-8-bit by
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106541
>From 24ff5d64d01e02e2d3641fad6b72ddab6bb32eea Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Wed, 28 Aug 2024 23:51:13 +0300
Subject: [PATCH] [ValueTracking] Add CharWidth argument to
getConstantS
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106540
>From 5604e7a7d06d4b367f765e15a929b9dd7760d6f8 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 29 Aug 2024 00:54:20 +0300
Subject: [PATCH] [IR] Account for byte width in m_PtrAdd
The method has
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106539
>From c335952171cd7907e38c8a12b4b50ea1fb384bb0 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 22 Aug 2024 15:10:58 +0300
Subject: [PATCH] [IRBuilder] Add getByteTy and use it in CreatePtrAdd
T
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106538
>From 3036dfc0ddfad4aeee1b5bd23627ad1949875489 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Fri, 2 Aug 2024 13:14:49 +0300
Subject: [PATCH] [ValueTracking] Make isBytewiseValue byte width agnostic
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106537
>From 0bf73e36bee4838ec17742b123f7e5b97c4550b8 Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 1 Aug 2024 23:47:25 +0300
Subject: [PATCH] [IR] Make @llvm.memset prototype byte width dependent
T
@@ -0,0 +1,183 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
+; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s -check-prefix=POPC
+; RUN: llc < %s -mtriple=sparcv9 -mat
@@ -3599,6 +3615,15 @@ bool SparcTargetLowering::isFPImmLegal(const APFloat
&Imm, EVT VT,
bool SparcTargetLowering::isCtlzFast() const { return Subtarget->isVIS3(); }
+bool SparcTargetLowering::isCheapToSpeculateCttz(Type *Ty) const {
+ // We lack native cttz, however,
+ /
@@ -3599,6 +3615,15 @@ bool SparcTargetLowering::isFPImmLegal(const APFloat
&Imm, EVT VT,
bool SparcTargetLowering::isCtlzFast() const { return Subtarget->isVIS3(); }
+bool SparcTargetLowering::isCheapToSpeculateCttz(Type *Ty) const {
+ // We lack native cttz, however,
+ /
@@ -303,4 +303,10 @@ def : Pat<(i64 (mulhs i64:$lhs, i64:$rhs)),
(SUBrr (UMULXHI $lhs, $rhs),
(ADDrr (ANDrr (SRAXri $lhs, 63), $rhs),
(ANDrr (SRAXri $rhs, 63), $lhs)))>;
+
+def : Pat<(i64 (ctlz i64:$src)), (LZCNT $src)>;
+// 32-bit LZCNT.
@@ -303,4 +303,10 @@ def : Pat<(i64 (mulhs i64:$lhs, i64:$rhs)),
(SUBrr (UMULXHI $lhs, $rhs),
(ADDrr (ANDrr (SRAXri $lhs, 63), $rhs),
(ANDrr (SRAXri $rhs, 63), $lhs)))>;
+
+def : Pat<(i64 (ctlz i64:$src)), (LZCNT $src)>;
+// 32-bit LZCNT.
@@ -0,0 +1,183 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
+; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s -check-prefix=POPC
+; RUN: llc < %s -mtriple=sparcv9 -mat
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/135715
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -0,0 +1,183 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
+; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s -check-prefix=POPC
+; RUN: llc < %s -mtriple=sparcv9 -mat
https://github.com/s-barannikov approved this pull request.
Looks great, I left some final comments (few of them are actionable).
There is also a couple of methods in TargetLoweringBase that should be
implemented:
`isCheapToSpeculateCtlz()`, `isCtlzFast()`. I think they could improve codegen
a
@@ -0,0 +1,183 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
s-barannikov wrote:
Would be nice to check V8 as well.
https://github.com/llvm/llvm-project/pull/13
@@ -1815,7 +1817,8 @@ SparcTargetLowering::SparcTargetLowering(const
TargetMachine &TM,
setOperationAction(ISD::FREM , MVT::f32, Expand);
setOperationAction(ISD::FMA , MVT::f32, Expand);
setOperationAction(ISD::CTTZ , MVT::i32, Expand);
- setOperationAction(ISD::CTLZ ,
@@ -1815,7 +1817,8 @@ SparcTargetLowering::SparcTargetLowering(const
TargetMachine &TM,
setOperationAction(ISD::FREM , MVT::f32, Expand);
setOperationAction(ISD::FMA , MVT::f32, Expand);
setOperationAction(ISD::CTTZ , MVT::i32, Expand);
- setOperationAction(ISD::CTLZ ,
@@ -316,4 +316,17 @@ def : Pat<(i64 (sext (i32 (bitconvert f32:$src,
(MOVSTOSW $src)>;
def : Pat<(f32 (bitconvert i32:$src)), (MOVWTOS $src)>;
def : Pat<(i64 (bitconvert f64:$src)), (MOVDTOX $src)>;
def : Pat<(f64 (bitconvert i64:$src)), (MOVXTOD $src)>;
+
+// OP-then-neg
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/135715
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -1815,7 +1817,8 @@ SparcTargetLowering::SparcTargetLowering(const
TargetMachine &TM,
setOperationAction(ISD::FREM , MVT::f32, Expand);
setOperationAction(ISD::FMA , MVT::f32, Expand);
setOperationAction(ISD::CTTZ , MVT::i32, Expand);
- setOperationAction(ISD::CTLZ ,
@@ -1,70 +1,195 @@
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
-; RUN: llc < %s -mtriple=sparc -mcpu=v9 | FileCheck %s
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
+; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s
@@ -0,0 +1,313 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
+; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s -check-prefix=POPC
+; RUN: llc < %s -mtriple=sparcv9 -mat
@@ -294,4 +294,13 @@ def : Pat<(f32 fpnegimm0), (FNEGS (FZEROS))>;
// VIS3 instruction patterns.
let Predicates = [HasVIS3] in {
def : Pat<(i64 (adde i64:$lhs, i64:$rhs)), (ADDXCCC $lhs, $rhs)>;
+
+def : Pat<(i64 (mulhu i64:$lhs, i64:$rhs)), (UMULXHI $lhs, $rhs)>;
+// Signed "M
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/135714
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/s-barannikov approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/135714
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commit
https://github.com/s-barannikov approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/135716
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commit
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/135715
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/135715
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/135715
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -0,0 +1,315 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
+; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s -check-prefix=POPC
+; RUN: llc < %s -mtriple=sparcv9 -mat
@@ -303,4 +303,10 @@ def : Pat<(i64 (mulhs i64:$lhs, i64:$rhs)),
(SUBrr (UMULXHI $lhs, $rhs),
(ADDrr (ANDrr (SRAXri $lhs, 63), $rhs),
(ANDrr (SRAXri $rhs, 63), $lhs)))>;
+
+def : Pat<(i64 (ctlz i64:$src)), (LZCNT $src)>;
+// 32-bit LZCNT.
https://github.com/s-barannikov approved this pull request.
LGTM
https://github.com/llvm/llvm-project/pull/135713
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commit
@@ -1737,6 +1737,11 @@ SparcTargetLowering::SparcTargetLowering(const
TargetMachine &TM,
setOperationAction(ISD::SUBC, MVT::i32, Legal);
setOperationAction(ISD::SUBE, MVT::i32, Legal);
+ if (Subtarget->isVIS3()) {
+setOperationAction(ISD::ADDC, MVT::i64, Legal);
+
https://github.com/s-barannikov edited
https://github.com/llvm/llvm-project/pull/135714
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
@@ -294,4 +294,13 @@ def : Pat<(f32 fpnegimm0), (FNEGS (FZEROS))>;
// VIS3 instruction patterns.
let Predicates = [HasVIS3] in {
def : Pat<(i64 (adde i64:$lhs, i64:$rhs)), (ADDXCCC $lhs, $rhs)>;
+
+def : Pat<(i64 (mulhu i64:$lhs, i64:$rhs)), (UMULXHI $lhs, $rhs)>;
+// Signed "M
@@ -294,4 +294,13 @@ def : Pat<(f32 fpnegimm0), (FNEGS (FZEROS))>;
// VIS3 instruction patterns.
let Predicates = [HasVIS3] in {
def : Pat<(i64 (adde i64:$lhs, i64:$rhs)), (ADDXCCC $lhs, $rhs)>;
+
+def : Pat<(i64 (mulhu i64:$lhs, i64:$rhs)), (UMULXHI $lhs, $rhs)>;
+// Signed "M
@@ -0,0 +1,171 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
+; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s -check-prefix=POPC
+; RUN: llc < %s -mtriple=sparcv9 -mat
@@ -303,4 +303,10 @@ def : Pat<(i64 (mulhs i64:$lhs, i64:$rhs)),
(SUBrr (UMULXHI $lhs, $rhs),
(ADDrr (ANDrr (SRAXri $lhs, 63), $rhs),
(ANDrr (SRAXri $rhs, 63), $lhs)))>;
+
+def : Pat<(i64 (ctlz i64:$src)), (LZCNT $src)>;
+// 32-bit LZCNT.
@@ -0,0 +1,171 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
+; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s -check-prefix=POPC
+; RUN: llc < %s -mtriple=sparcv9 -mat
@@ -0,0 +1,171 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s -mtriple=sparcv9 | FileCheck %s -check-prefix=V9
+; RUN: llc < %s -mtriple=sparcv9 -mattr=popc | FileCheck %s -check-prefix=POPC
+; RUN: llc < %s -mtriple=sparcv9 -mat
https://github.com/s-barannikov updated
https://github.com/llvm/llvm-project/pull/106539
>From b8c20416dc61604cae2d0ec6bce1632ae54ed96d Mon Sep 17 00:00:00 2001
From: Sergei Barannikov
Date: Thu, 22 Aug 2024 15:10:58 +0300
Subject: [PATCH] [IRBuilder] Add getByteTy and use it in CreatePtrAdd
T
1 - 100 of 200 matches
Mail list logo