Skip to content

Commit 1eb9d01

Browse files
committed
[rv32imcb] Update Ibex+B flags
This change updates the flags used for the Ibex+B toolchain to match only the "Balanced" configuration, rather than all of the B extension.
1 parent e540045 commit 1eb9d01

File tree

1 file changed

+28
-5
lines changed

1 file changed

+28
-5
lines changed

azure-pipelines.yml

Lines changed: 28 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ pr:
1616

1717
jobs:
1818
- job: "Toolchains_RV32IMC"
19-
displayName: "GCC and Clang/LLVM toolchains targeting RV32IMC (Ibex)"
19+
displayName: "Toolchains targeting Ibex"
2020
pool:
2121
vmImage: "ubuntu-16.04"
2222
timeoutInMinutes: 360
@@ -50,19 +50,42 @@ jobs:
5050
azure_name: rv32imc-toolchains
5151

5252
- job: "Toolchains_RV32IMCB"
53-
displayName: "GCC and Clang/LLVM toolchains targeting RV32IMC+B (Ibex with Bit Manipulation)"
53+
displayName: "Toolchains targeting Ibex with 'Balanced' Bit-manipulation"
54+
# These builds are using the 'Balanced' bit-manipulation subset identified in
55+
# https://github.com/lowRISC/opentitan/issues/2708, and formatted for the
56+
# correct versions as implemented by clang (B 0.92).
5457
pool:
5558
vmImage: "ubuntu-16.04"
5659
timeoutInMinutes: 360
5760
steps:
5861
- template: "_build-deps.yml"
5962

6063
- bash: |
64+
# HACK: GCC does not allow you to compile with just a subset of the B
65+
# extension using `-march=`, but it does assemble separately.
66+
#
67+
# So, we pass a more acceptable `-march=` to the assembler with `-Wa`.
68+
#
69+
# However, gcc will emit an assembly directive describing the arch it
70+
# wanted when it compiled, which the assembler will use in spite of the
71+
# `-march=` flag. So, we have to turn this off, using
72+
# `-mno-riscv-attribute`.
73+
#
74+
# The end result is: The compiler will not introduce B extension
75+
# instructions when compiling, but the assembler will understand them, so
76+
# they can be used in inline assembly.
77+
#
78+
# If you update the patches in `patches/lowrisc-toolchain-gcc-rv32imcb`,
79+
# you will need to revalidate that this behaviour works. A good testcase
80+
# is a file with a `pcnt` instruction in inline assembly.
81+
#
6182
./build-gcc-with-args.sh \
6283
"lowrisc-toolchain-gcc-rv32imcb" \
6384
"riscv32-unknown-elf" \
6485
"/tools/riscv" \
65-
"-march=rv32imcb" "-mabi=ilp32" "-mcmodel=medany"
86+
"-march=rv32imc" "-mabi=ilp32" "-mcmodel=medany" \
87+
"-Wa,-march=rv32imczbb0p92_zbf0p92_zbs0p92_zbt0p92" \
88+
"-mno-riscv-attribute"
6689
displayName: 'Build GCC toolchain'
6790
env:
6891
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)
@@ -73,8 +96,8 @@ jobs:
7396
"lowrisc-toolchain-rv32imcb" \
7497
"riscv32-unknown-elf" \
7598
"/tools/riscv" \
76-
"-march=rv32imcb0p92" "-mabi=ilp32" "-mcmodel=medany" \
77-
"-menable-experimental-extensions"
99+
"-march=rv32imczbb0p92_zbf0p92_zbs0p92_zbt0p92" \
100+
"-mabi=ilp32" "-mcmodel=medany" "-menable-experimental-extensions"
78101
displayName: "Build Clang toolchain"
79102
env:
80103
ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory)

0 commit comments

Comments
 (0)