Skip to content

Commit 1d722f8

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

File tree

4 files changed

+43
-2
lines changed

4 files changed

+43
-2
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ 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:
@@ -57,6 +57,8 @@ jobs:
5757
rust_target:
5858
- x86_64-pc-windows-msvc
5959
- i686-pc-windows-msvc
60+
- aarch64-pc-windows-msvc
61+
- arm64ec-pc-windows-msvc
6062
include:
6163
- rust_target: x86_64-pc-windows-msvc
6264
clang_cl: C:/msys64/mingw64/bin/clang-cl.exe

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)