-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: - Added AMX classifier API: xed_classify_amx() - Added CPUID bit definition for [F,]CMOV*, FCOMI* and MMX technology - Added AMX tests Modified: - Modified xed versioning to <year>.<month>.<day> - Improved re-encoding of vector instructions Fixed: - Fixed [LD,ST]TILECFG memory width definition - Fixed MOV[H,L,LH,HL]P[S,D] register's access definition - Fixed [,V]MASKMOVDQU register's element type - Fixed RING0 attribute for CLAC and STAC - Fixed JKZD/JKNZD VEX.L bit (#282) - Fixed KNC build and decoder - Fixed Clang13 build error for "-Werror=sign-compare" flag
- Loading branch information
Showing
141 changed files
with
761 additions
and
676 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,168 @@ | ||
# BEGIN_LEGAL | ||
# | ||
# Copyright (c) 2022 Intel Corporation | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# END_LEGAL | ||
""" run CI checks """ | ||
import os | ||
import platform | ||
import subprocess | ||
import sys | ||
from datetime import datetime | ||
from typing import Dict | ||
|
||
sys.path = ['scripts'] + sys.path | ||
|
||
|
||
class JobStatus: | ||
"""record job status (success, failure and (retval,job) list""" | ||
def __init__(self): | ||
self.jobs = 0 | ||
self.fails = 0 | ||
self.successes = 0 | ||
self.start_time = datetime.now() | ||
self.commands = [] # list of tuples of (retval, command) | ||
|
||
def __str__(self): | ||
s = [f"JOBS: {self.jobs}, SUCCESSES: {self.successes}, FAILS: {self.fails}"] | ||
|
||
for index, (r, c) in enumerate(self.commands): | ||
s.append(f"{index}: status: {r} cmd: {c}") | ||
return os.linesep.join(s) + os.linesep | ||
|
||
def addjob(self, retval, cmd): | ||
self.jobs += 1 | ||
self.commands.append((retval, cmd)) | ||
|
||
def fail(self, retval, cmd): | ||
self.fails += 1 | ||
self.addjob(retval, cmd) | ||
|
||
def success(self, retval, cmd): | ||
self.successes += 1 | ||
self.addjob(retval, cmd) | ||
|
||
def merge(self, status): | ||
"""merge status object""" | ||
self.jobs += status.jobs | ||
self.fails += status.fails | ||
self.successes += status.successes | ||
self.commands.extend(status.commands) | ||
|
||
def pass_rate_fraction(self): | ||
return f'{self.successes}/{self.jobs}' | ||
|
||
|
||
def success(status): | ||
sys.stdout.write(str(status)) | ||
sys.stdout.write(f'[ELAPSED TIME] {datetime.now() - status.start_time}\n') | ||
sys.stdout.write("[FINAL STATUS] PASS\n") | ||
sys.stdout.flush() | ||
sys.exit(0) | ||
|
||
|
||
def fail(status): | ||
sys.stdout.write(str(status)) | ||
sys.stdout.write(f'[ELAPSED TIME] {datetime.now() - status.start_time}\n') | ||
sys.stdout.write("[FINAL STATUS] FAIL\n") | ||
sys.stdout.flush() | ||
sys.exit(1) | ||
|
||
|
||
def ensure_string(x): | ||
'''handle non unicode output''' | ||
if isinstance(x, bytes): | ||
return x.decode('utf-8') | ||
return x | ||
|
||
|
||
def run_subprocess(cmd, **kwargs): | ||
'''front end to running subprocess''' | ||
sub = subprocess.Popen(cmd, | ||
shell=True, | ||
stdout=subprocess.PIPE, | ||
stderr=subprocess.STDOUT, | ||
**kwargs) | ||
lines = sub.stdout.readlines() | ||
lines = [ensure_string(x) for x in lines] | ||
sub.wait() | ||
return sub.returncode, lines | ||
|
||
|
||
def run(status:JobStatus, cmd, required=False, cwd=None): | ||
"""run subprocess, and record fails""" | ||
print(cmd, flush=True) | ||
retval, output = run_subprocess(cmd, cwd=cwd) | ||
for line in output: | ||
sys.stdout.write(line) | ||
if retval == 0: | ||
print("[SUCCESS]") | ||
status.success(retval, cmd) | ||
else: | ||
print(f"[FAIL] retval = {retval}") | ||
status.fail(retval, cmd) | ||
if required: | ||
fail(status) | ||
return retval == 0 # 1=ok! | ||
|
||
|
||
def get_python_cmds(): | ||
'''find python verions. return tuples of (name, command)''' | ||
if platform.system() == 'Windows': | ||
for x in ['37']: | ||
p_path = f'C:/python{x}/python' | ||
if os.path.exists(p_path): | ||
return [(x, p_path)] | ||
if platform.system() in ['Darwin', 'Linux']: | ||
# The file .travis.yml installs python3 on linux. Already present on mac | ||
return [('3.x', 'python3')] | ||
return [('dfltpython', 'python')] | ||
|
||
|
||
def main(): | ||
status = JobStatus() | ||
|
||
for pyver, pycmd in get_python_cmds(): | ||
cmd = f'{pycmd} -m pip install --user ./mbuild' | ||
run(status, cmd, required=True) | ||
|
||
# {32b,64b} x {shared,dynamic} link | ||
for size in ['ia32', 'x86-64']: | ||
for linkkind, link in [('static', ''), ('dynamic', '--shared')]: | ||
build_dir = f'obj-general-{pyver}-{size}-{linkkind}' | ||
cmd = f'{pycmd} mfile.py --build-dir={build_dir} host_cpu={size} {link} test' | ||
run(status, cmd) | ||
|
||
# do a build with asserts enabled | ||
build_dir = f'obj-assert-{pyver}-{"x86-64"}' | ||
cmd = f'{pycmd} mfile.py --asserts --build-dir={build_dir} host_cpu={"x86-64"} test' | ||
run(status, cmd) | ||
|
||
# knc test | ||
size = 'x86-64' | ||
linkkind = 'static' | ||
build_dir = f'obj-knc-{pyver}-{size}-{linkkind}' | ||
cmd = f'{pycmd} mfile.py --knc --build-dir={build_dir} host_cpu={size} test' | ||
run(status, cmd) | ||
|
||
|
||
if status.fails == 0: | ||
success(status) | ||
fail(status) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() | ||
sys.exit(0) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
name: External Test | ||
on: | ||
pull_request: | ||
branches: | ||
- external | ||
jobs: | ||
test: | ||
runs-on: | ||
- self-hosted | ||
- xed-runners | ||
container: | ||
image: ger-is-registry.caas.intel.com/bit/xed:latest | ||
steps: | ||
- name: Checkout xed | ||
uses: actions/checkout@v2 | ||
- name: Checkout mbuild | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: intelxed/mbuild | ||
ref: main | ||
path: mbuild | ||
token: ${{ secrets.PAT }} | ||
- name: test | ||
run: | | ||
python3 .github/scripts/ci_external.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: External release | ||
on: | ||
push: | ||
branches: | ||
- external | ||
|
||
jobs: | ||
external_release: | ||
runs-on: | ||
- self-hosted | ||
- xed-runners | ||
steps: | ||
- name: Checkout external branch | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
fetch-depth: 0 | ||
ref: external | ||
path: external | ||
- name: Get external commit message description | ||
id: commit-body | ||
run: | | ||
cd external | ||
echo | ||
echo "$(git log -1 --pretty=%B)" >> ../body.txt | ||
- name: Checkout main | ||
uses: actions/checkout@v3 | ||
with: | ||
token: ${{ secrets.PAT }} | ||
fetch-depth: 0 | ||
ref: main | ||
path: main | ||
- name: Get version | ||
id: get-version | ||
run: echo "::set-output name=version::$(cat external/VERSION)" | ||
- name: Git config | ||
uses: ./main/.github/actions/set-git-credentials | ||
with: | ||
token: ${{ secrets.PAT }} | ||
path: main | ||
remote: origin | ||
- name: Replace .rc with .external tag on main | ||
run: | | ||
cd main | ||
set tag_sha=$(git rev-list -n 1 "${{steps.get-version.outputs.version}}.rc") | ||
echo $tag_sha | ||
git push --delete origin "${{steps.get-version.outputs.version}}.external" || true | ||
git push --delete origin "${{steps.get-version.outputs.version}}.rc" || true | ||
git tag -d "${{steps.get-version.outputs.version}}.rc" || true | ||
git tag --force "${{steps.get-version.outputs.version}}.external" -a -F ../body.txt $tag_sha | ||
git push origin "${{steps.get-version.outputs.version}}.external" | ||
- name: Git config | ||
uses: ./main/.github/actions/set-git-credentials | ||
with: | ||
token: ${{ secrets.PAT }} | ||
path: external | ||
remote: origin | ||
- name: Tag external branch | ||
run: | | ||
cd external | ||
git push --delete origin "${{steps.get-version.outputs.version}}" || true | ||
git tag -d "${{steps.get-version.outputs.version}}" || true | ||
git tag --force "${{steps.get-version.outputs.version}}" -a -F ../body.txt ${{ github.sha }} | ||
git push origin "${{steps.get-version.outputs.version}}" | ||
- name: Git config external repo | ||
uses: ./main/.github/actions/set-git-credentials | ||
with: | ||
token: ${{ secrets.PAT }} | ||
path: external | ||
remote: external | ||
repository: ${{ secrets.EXTERNAL_REPO }} | ||
- name: Push to external repo | ||
run: | | ||
cd external | ||
git push external HEAD:main | ||
- name: Tag external repo | ||
run: | | ||
cd external | ||
git push --delete external "${{steps.get-version.outputs.version}}" || true | ||
git tag --force "${{steps.get-version.outputs.version}}" -a -F ../body.txt ${{ github.sha }} | ||
git push external "${{steps.get-version.outputs.version}}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,8 @@ xed-install* | |
TAGS | ||
/VS10/xed.vcxproj.user | ||
/VS10/xed.sdf | ||
/.vs/ | ||
.idea/ | ||
kits/* | ||
logs/* | ||
.developer | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
13.0.0 | ||
v2022.04.17 |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.