Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build zerolibnative.obj for x86 Windows #70

Merged
merged 1 commit into from
Dec 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 32 additions & 1 deletion .github/workflows/bflat-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,30 @@ jobs:
shell: cmd
run: src\tests\run.cmd runnativeaottests release ${{ matrix.arch }}
if: ${{ matrix.vm == 'windows-latest' && github.event.inputs.version == '' && matrix.arch != 'arm64' }}

build_x86_windows:
runs-on: windows-latest
name: Build and test windows x86
steps:
- uses: actions/checkout@v3
- name: Build the product (Windows)
shell: cmd
run: bldx86.cmd
- name: ZIP libs (Windows)
run: |
mkdir artifacts\bflat-libs
copy artifacts\bin\coreclr\Windows.x86.Release\aotsdk\* artifacts\bflat-libs\
pushd artifacts\bflat-libs\
Compress-Archive * $Env:GITHUB_WORKSPACE\artifacts\bflat-libs-windows-x86.zip
popd
- name: Archive libs
uses: actions/upload-artifact@v2
with:
name: libs
path: artifacts/bflat-libs-windows-x86.zip

publish:
needs: build_and_test
needs: [ build_and_test, build_x86_windows ]
runs-on: ubuntu-latest
name: Publish release and NuGet
if: ${{ github.event.inputs.version != '' && github.actor == 'MichalStrehovsky' }}
Expand Down Expand Up @@ -203,6 +224,16 @@ jobs:
asset_name: bflat-refs.zip
asset_content_type: application/zip

- name: Upload libs (windows-x86)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: libs/bflat-libs-windows-x86.zip
asset_name: bflat-libs-windows-x86.zip
asset_content_type: application/zip

- name: Upload native compiler (windows-x64)
uses: actions/upload-release-asset@v1
env:
Expand Down
8 changes: 8 additions & 0 deletions bldx86.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
@echo off

for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -find vc\Auxiliary\Build\vcvarsall.bat`) do (
"%%i" amd64_x86
mkdir artifacts\bin\coreclr\windows.x86.Release\aotsdk
ml /c /Foartifacts\bin\coreclr\windows.x86.Release\aotsdk\zerolibnative.obj /Zi src\coreclr\nativeaot\zerolib.native\x86\stubs.asm
exit /b !errorlevel!
)
61 changes: 61 additions & 0 deletions src/coreclr/nativeaot/zerolib.native/x86/stubs.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.586
.xmm
.model flat

ALTERNATE_ENTRY macro Name

Name label proc
PUBLIC Name
endm

.code

PUBLIC RhpByRefAssignRef
RhpByRefAssignRef PROC
movs dword ptr es:[edi],dword ptr [esi]
ret
RhpByRefAssignRef ENDP

PUBLIC RhpCheckedAssignRefEAX
ALTERNATE_ENTRY RhpAssignRefEAX
RhpCheckedAssignRefEAX PROC
mov DWORD PTR [edx], eax
ret
RhpCheckedAssignRefEAX ENDP

PUBLIC RhpCheckedAssignRefEBX
ALTERNATE_ENTRY RhpAssignRefEBX
RhpCheckedAssignRefEBX PROC
mov DWORD PTR [edx], ebx
ret
RhpCheckedAssignRefEBX ENDP

PUBLIC RhpCheckedAssignRefECX
ALTERNATE_ENTRY RhpAssignRefECX
RhpCheckedAssignRefECX PROC
mov DWORD PTR [edx], ecx
ret
RhpCheckedAssignRefECX ENDP

PUBLIC RhpCheckedAssignRefESI
ALTERNATE_ENTRY RhpAssignRefESI
RhpCheckedAssignRefESI PROC
mov DWORD PTR [edx], esi
ret
RhpCheckedAssignRefESI ENDP

PUBLIC RhpCheckedAssignRefEDI
ALTERNATE_ENTRY RhpAssignRefEDI
RhpCheckedAssignRefEDI PROC
mov DWORD PTR [edx], edi
ret
RhpCheckedAssignRefEDI ENDP

PUBLIC RhpCheckedAssignRefEBP
ALTERNATE_ENTRY RhpAssignRefEBP
RhpCheckedAssignRefEBP PROC
mov DWORD PTR [edx], ebp
ret
RhpCheckedAssignRefEBP ENDP

end