Skip to content

Commit fec9620

Browse files
committed
Add support for Arm64EC
1 parent 7a3ff32 commit fec9620

File tree

4 files changed

+59
-2
lines changed

4 files changed

+59
-2
lines changed

.github/workflows/test.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,20 @@ jobs:
1919
fail-fast: false
2020
matrix:
2121
rust_toolchain: [nightly, stable, 1.63.0]
22-
os: [ubuntu-latest, windows-latest, macOS-latest]
22+
os: [ubuntu-latest, windows-latest, macOS-latest, windows-11-arm]
2323
mode: ["--release", "-Zminimal-versions", ""]
2424
manifest: ["psm/Cargo.toml", "Cargo.toml"]
2525
exclude:
2626
- rust_toolchain: stable
2727
mode: -Zminimal-versions
2828
- rust_toolchain: 1.63.0
2929
mode: -Zminimal-versions
30+
include:
31+
- os: windows-latest
32+
extra_target: i686-pc-windows-msvc
33+
- os: windows-11-arm
34+
rust_toolchain: nightly
35+
extra_target: arm64ec-pc-windows-msvc
3036
timeout-minutes: 10
3137
steps:
3238
- uses: actions/checkout@v4
@@ -46,6 +52,18 @@ jobs:
4652
with:
4753
command: test
4854
args: --manifest-path=${{ matrix.manifest }} ${{ matrix.mode }} --examples -- --nocapture
55+
- if: ${{ matrix.extra_target }}
56+
name: Test ${{ matrix.manifest}} with ${{ matrix.mode }} as ${{ matrix.extra_target }}
57+
uses: actions-rs/cargo@v1
58+
with:
59+
command: test
60+
args: --target=${{ matrix.extra_target }} --manifest-path=${{ matrix.manifest }} ${{ matrix.mode }} -- --nocapture
61+
- if: ${{ matrix.extra_target }}
62+
name: Test ${{ matrix.manifest}} examples with ${{ matrix.mode }} as ${{ matrix.extra_target }}
63+
uses: actions-rs/cargo@v1
64+
with:
65+
command: test
66+
args: --target=${{ matrix.extra_target }} --manifest-path=${{ matrix.manifest }} ${{ matrix.mode }} --examples -- --nocapture
4967

5068
clang-cl-test:
5169
name: Test ${{ matrix.manifest }} on ${{ matrix.rust_target }} with ${{ matrix.clang_cl }}

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ features = [
3535

3636

3737
[build-dependencies]
38-
cc = "1.1.22"
38+
cc = "1.2.33"

psm/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ fn find_assembly(
2828
Some(("src/arch/x86_64_windows_gnu.s", false))
2929
}
3030
("arm", _, "windows", "msvc") => Some(("src/arch/arm_armasm.asm", false)),
31+
("arm64ec", _, "windows", "msvc") => Some(("src/arch/arm64ec_armasm.asm", false)),
3132
("aarch64", _, "windows", _) => {
3233
if masm {
3334
Some(("src/arch/aarch64_armasm.asm", false))

psm/src/arch/arm64ec_armasm.asm

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
AREA |.text|, CODE, READONLY
2+
3+
GLOBAL |#rust_psm_stack_direction|
4+
ALIGN 4
5+
|#rust_psm_stack_direction| PROC
6+
orr w0, wzr, #2
7+
ret
8+
ENDP
9+
10+
11+
GLOBAL |#rust_psm_stack_pointer|
12+
ALIGN 4
13+
|#rust_psm_stack_pointer| PROC
14+
mov x0, sp
15+
ret
16+
ENDP
17+
18+
19+
GLOBAL |#rust_psm_replace_stack|
20+
ALIGN 4
21+
|#rust_psm_replace_stack| PROC
22+
mov sp, x2
23+
br x1
24+
ENDP
25+
26+
GLOBAL |#rust_psm_on_stack|
27+
ALIGN 4
28+
|#rust_psm_on_stack| PROC
29+
stp x29, x30, [sp, #-16]!
30+
mov x29, sp
31+
mov sp, x3
32+
blr x2
33+
mov sp, x29
34+
ldp x29, x30, [sp], #16
35+
ret
36+
ENDP
37+
38+
END

0 commit comments

Comments
 (0)