|
16 | 16 |
|
17 | 17 | jobs: |
18 | 18 | - job: "Toolchains_RV32IMC" |
19 | | - displayName: "GCC and Clang/LLVM toolchains targeting RV32IMC (Ibex)" |
| 19 | + displayName: "Toolchains targeting Ibex" |
20 | 20 | pool: |
21 | 21 | vmImage: "ubuntu-16.04" |
22 | 22 | timeoutInMinutes: 360 |
@@ -50,19 +50,42 @@ jobs: |
50 | 50 | azure_name: rv32imc-toolchains |
51 | 51 |
|
52 | 52 | - 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). |
54 | 57 | pool: |
55 | 58 | vmImage: "ubuntu-16.04" |
56 | 59 | timeoutInMinutes: 360 |
57 | 60 | steps: |
58 | 61 | - template: "_build-deps.yml" |
59 | 62 |
|
60 | 63 | - 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 | + # |
61 | 82 | ./build-gcc-with-args.sh \ |
62 | 83 | "lowrisc-toolchain-gcc-rv32imcb" \ |
63 | 84 | "riscv32-unknown-elf" \ |
64 | 85 | "/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" |
66 | 89 | displayName: 'Build GCC toolchain' |
67 | 90 | env: |
68 | 91 | ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory) |
|
73 | 96 | "lowrisc-toolchain-rv32imcb" \ |
74 | 97 | "riscv32-unknown-elf" \ |
75 | 98 | "/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" |
78 | 101 | displayName: "Build Clang toolchain" |
79 | 102 | env: |
80 | 103 | ARTIFACT_STAGING_DIR: $(Build.ArtifactStagingDirectory) |
|
0 commit comments