Skip to content

Commit

Permalink
[SOL] Use R10 as the stack pointer (#117)
Browse files Browse the repository at this point in the history
* Use R10 as the stack pointer

* Use ubuntu 22 for CI

* Use R10 for pseudo stack pointer
  • Loading branch information
LucasSte authored Dec 11, 2024
1 parent f082558 commit 59716aa
Show file tree
Hide file tree
Showing 37 changed files with 132 additions and 145 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-ci-container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
build-ci-container:
if: github.repository_owner == 'llvm'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
packages: write
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ on:
jobs:
check-docs-build:
name: "Test documentation build"
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'llvm/llvm-project'
steps:
# Don't fetch before checking for file changes to force the file changes
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/issue-release-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
jobs:
backport-commits:
name: Backport Commits
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: >-
(github.repository == 'llvm/llvm-project') &&
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
create-pull-request:
name: Create Pull Request
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: >-
(github.repository == 'llvm/llvm-project') &&
!startswith(github.event.comment.body, '<!--IGNORE-->') &&
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-subscriber.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:

jobs:
auto-subscribe:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'llvm/llvm-project'
steps:
- name: Checkout Automation Script
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/libclang-abi-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ concurrency:
jobs:
abi-dump-setup:
if: github.repository_owner == 'llvm'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }}
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
abi-dump:
if: github.repository_owner == 'llvm'
needs: abi-dump-setup
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
name:
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:

abi-compare:
if: github.repository_owner == 'llvm'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- abi-dump-setup
- abi-dump
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/libclang-python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ jobs:
projects: clang
# There is an issue running on "windows-2019".
# See https://github.com/llvm/llvm-project/issues/76601#issuecomment-1873049082.
os_list: '["ubuntu-latest"]'
os_list: '["ubuntu-22.04"]'
python_version: ${{ matrix.python-version }}
2 changes: 1 addition & 1 deletion .github/workflows/libcxx-check-generated-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:

jobs:
check_generated_files:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Fetch LLVM sources
uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/llvm-bugs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:

jobs:
auto-subscribe:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'llvm/llvm-project'
steps:
- uses: actions/setup-node@v3
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/llvm-project-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
required: false
os_list:
required: false
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
default: '["ubuntu-22.04", "windows-2019", "macOS-13"]'
python_version:
required: false
type: string
Expand All @@ -39,7 +39,7 @@ on:
type: string
# Use windows-2019 due to:
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
default: '["ubuntu-22.04", "windows-2019", "macOS-13"]'

python_version:
required: false
Expand All @@ -66,7 +66,7 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-latest
- ubuntu-22.04
# Use windows-2019 due to:
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
- windows-2019
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/llvm-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:

abi-dump-setup:
#if: github.repository_owner == 'llvm'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
outputs:
BASELINE_REF: ${{ steps.vars.outputs.BASELINE_REF }}
ABI_HEADERS: ${{ steps.vars.outputs.ABI_HEADERS }}
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
abi-dump:
#if: github.repository_owner == 'llvm'
needs: abi-dump-setup
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
strategy:
matrix:
name:
Expand Down Expand Up @@ -170,7 +170,7 @@ jobs:

abi-compare:
#if: github.repository_owner == 'llvm'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs:
- abi-dump-setup
- abi-dump
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/new-issues.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
automate-issues-labels:
permissions:
issues: write
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'llvm/llvm-project'
steps:
- uses: llvm/actions/issue-labeler@main
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/new-prs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:

jobs:
greeter:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
pull-requests: write
# Only comment on PRs that have been opened for the first time, by someone
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
automate-prs-labels:
# Greet first so that only the author gets that notification.
needs: greeter
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
# Ignore PRs with more than 10 commits. Pull requests with a lot of
# commits tend to be accidents usually when someone made a mistake while trying
# to rebase. We want to ignore these pull requests to avoid excessive
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-code-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ permissions:

jobs:
code_formatter:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'llvm/llvm-project'
steps:
- name: Fetch LLVM sources
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-request-release-note.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
github.repository_owner == 'llvm' &&
startsWith(github.ref, 'refs/heads/release')
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
# We need to pull the script from the main branch, so that we ensure
# we get the latest version of this script.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-subscriber.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ permissions:

jobs:
auto-subscribe:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'llvm/llvm-project'
steps:
- name: Checkout Automation Script
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
jobs:
release-documentation:
name: Build and Upload Release Documentation
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
env:
upload: ${{ inputs.upload && !contains(inputs.release-version, 'rc') }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-doxygen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ on:
jobs:
release-doxygen:
name: Build and Upload Release Doxygen
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
permissions:
contents: write
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-lit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
jobs:
release-lit:
name: Release Lit
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout LLVM
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
jobs:
validate-tag:
name: Validate Tag
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'llvm/llvm-project'
outputs:
release-version: ${{ steps.validate-tag.outputs.release-version }}
Expand All @@ -26,7 +26,7 @@ jobs:
release-create:
name: Create a New Release
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
needs: validate-tag

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ permissions:
jobs:
analysis:
name: Scorecard analysis
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
if: github.repository == 'llvm/llvm-project'
permissions:
# Needed to upload the results to code-scanning dashboard.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/spirv-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
build_target: check-llvm-codegen-spirv
projects:
extra_cmake_args: '-DLLVM_TARGETS_TO_BUILD="" -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD="SPIRV"'
os_list: '["ubuntu-latest"]'
os_list: '["ubuntu-22.04"]'
2 changes: 1 addition & 1 deletion .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ permissions:
jobs:
version_check:
if: github.repository_owner == 'llvm'
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Fetch LLVM sources
uses: actions/checkout@v4
Expand Down
10 changes: 6 additions & 4 deletions llvm/lib/Target/SBF/Disassembler/SBFDisassembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,8 @@ extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeSBFDisassembler() {

static const unsigned GPRDecoderTable[] = {
SBF::R0, SBF::R1, SBF::R2, SBF::R3, SBF::R4, SBF::R5,
SBF::R6, SBF::R7, SBF::R8, SBF::R9, SBF::R10, SBF::R11};
SBF::R6, SBF::R7, SBF::R8, SBF::R9, SBF::R10
};

static DecodeStatus DecodeGPRRegisterClass(MCInst &Inst, unsigned RegNo,
uint64_t /*Address*/,
Expand All @@ -101,12 +102,13 @@ static DecodeStatus DecodeGPRRegisterClass(MCInst &Inst, unsigned RegNo,

static const unsigned GPR32DecoderTable[] = {
SBF::W0, SBF::W1, SBF::W2, SBF::W3, SBF::W4, SBF::W5,
SBF::W6, SBF::W7, SBF::W8, SBF::W9, SBF::W10, SBF::W11};
SBF::W6, SBF::W7, SBF::W8, SBF::W9, SBF::W10
};

static DecodeStatus
DecodeGPR32RegisterClass(MCInst &Inst, unsigned RegNo, uint64_t /*Address*/,
const MCDisassembler * /*Decoder*/) {
if (RegNo > 11)
if (RegNo > 10)
return MCDisassembler::Fail;

unsigned Reg = GPR32DecoderTable[RegNo];
Expand All @@ -118,7 +120,7 @@ static DecodeStatus decodeMemoryOpValue(MCInst &Inst, unsigned Insn,
uint64_t Address,
const MCDisassembler *Decoder) {
unsigned Register = (Insn >> 16) & 0xf;
if (Register > 11)
if (Register > 10)
return MCDisassembler::Fail;

Inst.addOperand(MCOperand::createReg(GPRDecoderTable[Register]));
Expand Down
2 changes: 1 addition & 1 deletion llvm/lib/Target/SBF/MCTargetDesc/SBFMCTargetDesc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ static MCInstrInfo *createSBFMCInstrInfo() {

static MCRegisterInfo *createSBFMCRegisterInfo(const Triple &TT) {
MCRegisterInfo *X = new MCRegisterInfo();
InitSBFMCRegisterInfo(X, SBF::R11 /* RAReg doesn't exist */);
InitSBFMCRegisterInfo(X, SBF::R10 /* RAReg doesn't exist */);
return X;
}

Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/SBF/SBFFrameLowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ void adjustStackPointer(MachineFunction &MF, MachineBasicBlock &MBB,
DebugLoc Dl;
const SBFInstrInfo &TII =
*static_cast<const SBFInstrInfo *>(MF.getSubtarget().getInstrInfo());
BuildMI(MBB, MBBI, Dl, TII.get(SBF::ADD_ri), SBF::R11)
.addReg(SBF::R11)
BuildMI(MBB, MBBI, Dl, TII.get(SBF::ADD_ri), SBF::R10)
.addReg(SBF::R10)
.addImm(IsSubtract ? -NumBytes : NumBytes);
}
}
Expand Down
6 changes: 5 additions & 1 deletion llvm/lib/Target/SBF/SBFFrameLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ class SBFSubtarget;
class SBFFrameLowering : public TargetFrameLowering {
public:
explicit SBFFrameLowering(const SBFSubtarget &sti)
: TargetFrameLowering(TargetFrameLowering::StackGrowsDown, Align(8), 0) {}
: TargetFrameLowering(
TargetFrameLowering::StackGrowsDown,
Align(64),
0,
Align(64)) {}

void emitPrologue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override;
Expand Down
Loading

0 comments on commit 59716aa

Please sign in to comment.