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

Merge latest changes #58

Merged
merged 89 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
3a99a67
experiments with RV32P
PhilippvK Feb 21, 2024
3d7af8b
move to llvm 18
PhilippvK Feb 21, 2024
a202492
add legalizer info to settings (WIP)
PhilippvK Feb 21, 2024
2a124c8
fix patterngen mattr
PhilippvK Feb 21, 2024
852cc05
implement automatic lookup up llvm version
PhilippvK Feb 21, 2024
26ac012
minor fix
PhilippvK Feb 21, 2024
c87f0aa
filter_model: fix and implement missing major opcodes
PhilippvK Feb 21, 2024
5f89324
add insert markers patch for llvm 18
PhilippvK Feb 21, 2024
67d273e
add examples/cfg/riscv.yml
PhilippvK Feb 21, 2024
d9dd74b
add insert markers patch for llvm 18
PhilippvK Feb 21, 2024
77bdd33
refactor pattern-gen flow (setup)
PhilippvK Feb 21, 2024
54638b8
riscv_isa_info: llvm18 fix
PhilippvK Feb 21, 2024
0ecbf08
insert_markers_llvm18: fix typo
PhilippvK Feb 21, 2024
b32330b
add backend if legalizer settings
PhilippvK Feb 21, 2024
0c67a66
update cdsl2llvm dependency branch
PhilippvK Feb 21, 2024
eee3148
RV32P.core_desc: split sunpkd8xy into multiple instrs
PhilippvK Feb 26, 2024
b4bb65a
RV32P.core_desc: add GPR32Pair register alias (unused)
PhilippvK Feb 26, 2024
55f32b8
RV32P.core_desc: try new zpfsoperand mechanic (for better register pa…
PhilippvK Feb 26, 2024
fb0c2f5
filter.yml: update
PhilippvK Feb 26, 2024
222143c
riscv.yml: update legalizer settings
PhilippvK Feb 26, 2024
d0c9095
demo.py: load test files
PhilippvK Feb 26, 2024
a303895
demo.py: fix
PhilippvK Feb 26, 2024
78ec345
llvmir writer fix
PhilippvK Feb 26, 2024
6444449
riscv_gisel_legalizer: fix
PhilippvK Feb 26, 2024
c3ef953
flow: support user-provided test files (#50)
PhilippvK Feb 26, 2024
808541e
flow: detect duplicate patches
PhilippvK Feb 26, 2024
845a3d0
flow: gmir fix
PhilippvK Feb 26, 2024
1d91ee8
flow: refactor generate (skip/only)
PhilippvK Feb 26, 2024
af97dc7
flow: support user-provided test files (#50)
PhilippvK Feb 26, 2024
a301924
default settings: fix typos
PhilippvK Feb 26, 2024
1bb8c79
cdsl2llvm fix
PhilippvK Feb 26, 2024
363ed15
examples: add missing files
PhilippvK Feb 26, 2024
d4f0384
update filter
PhilippvK Feb 26, 2024
05fd99f
demo: disable everything except test and nand
PhilippvK Feb 26, 2024
a34bf3c
migrate to new pass infra
PhilippvK Feb 26, 2024
6a02b0a
add missing assertion msgs
PhilippvK Feb 26, 2024
3643e2c
support assembly test files
PhilippvK Feb 26, 2024
503cf55
fix lint warning
PhilippvK Feb 26, 2024
46469f4
test stage: make FileCheck available
PhilippvK Feb 26, 2024
bd310a6
examples/cdsl/RV32P.core_desc update
PhilippvK Mar 1, 2024
b4f4e83
flow fix
PhilippvK Mar 1, 2024
3018fcc
update demo
PhilippvK Mar 1, 2024
380ca20
lint
PhilippvK Mar 1, 2024
47a441f
fix last patch stage being skipped
PhilippvK Mar 1, 2024
556c881
more linting
PhilippvK Mar 1, 2024
f32c80b
address pr comment
PhilippvK Mar 1, 2024
894d080
add missing test file
PhilippvK Mar 1, 2024
19dea0b
update cv_nand tests
PhilippvK Mar 1, 2024
c1727d2
fix after linting
PhilippvK Mar 1, 2024
5a760c5
add PassResult and PassManager
PhilippvK Mar 4, 2024
a3d4353
update pass function args (expect input model name
PhilippvK Mar 4, 2024
bf1a3a7
add metrics to settings
PhilippvK Mar 4, 2024
a9b89da
fix
PhilippvK Mar 4, 2024
c578332
pass settings to passes
PhilippvK Mar 4, 2024
0031a57
temp
PhilippvK Mar 4, 2024
41348cc
fix
PhilippvK Mar 4, 2024
dfa4b17
pass shell env to passes
PhilippvK Mar 4, 2024
162a424
move pass helper properties to settings
PhilippvK Mar 4, 2024
ae31473
move passes to seperate file
PhilippvK Mar 4, 2024
557bbfb
passes: add PassFormat (unused)
PhilippvK Mar 4, 2024
84418db
PassResult: add outputs field (unused)
PhilippvK Mar 4, 2024
b5be067
passes: add PassFormat (unused)
PhilippvK Mar 4, 2024
b28c17b
fixes
PhilippvK Mar 4, 2024
c6d0d43
try to split pattern gen step into formats and patterns
PhilippvK Mar 4, 2024
be629e7
fix Example.core_desc
PhilippvK Mar 4, 2024
5218135
update demo
PhilippvK Mar 4, 2024
d62b338
patterngen fix
PhilippvK Mar 4, 2024
b8430f0
update cdsl2llvm branch
PhilippvK Mar 4, 2024
2c1eff1
allow (per-model) pass skipping via settings
PhilippvK Mar 4, 2024
c593fa7
fixes for cleanup and export step
PhilippvK Mar 4, 2024
6d39cb7
more fixes
PhilippvK Mar 4, 2024
386a8ed
passes: implement multiprocessing depending on number of cpus
PhilippvK Mar 4, 2024
dc5ed75
settings: avoid duplicated list items when merging
PhilippvK Mar 4, 2024
67a5a9c
update xcorev cdsl submodule
PhilippvK Mar 4, 2024
86effd5
update demo
PhilippvK Mar 5, 2024
eb18cc0
generate instr info
PhilippvK Mar 5, 2024
d64ce00
support model specific overrides
PhilippvK Mar 5, 2024
b2fdfe2
ignore 2 xcvalu instrs whihc fail type infer during llvm-tblgen
PhilippvK Mar 5, 2024
9b2c885
generate instr info (fixes)
PhilippvK Mar 5, 2024
94ec993
generate instr info (fixes)
PhilippvK Mar 5, 2024
c84e476
lint
PhilippvK Mar 5, 2024
659f7d8
generate instr info (fixes)
PhilippvK Mar 5, 2024
c40dd95
add instr_info_notes
PhilippvK Mar 5, 2024
d114f5e
generate instr info (fixes)
PhilippvK Mar 5, 2024
1618895
update examples
PhilippvK Mar 5, 2024
0241f63
fix
PhilippvK Mar 5, 2024
6152ec1
cleanup
PhilippvK Mar 5, 2024
6b4f4cd
fix
PhilippvK Mar 5, 2024
01dab0b
lint
PhilippvK Mar 5, 2024
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
3 changes: 1 addition & 2 deletions examples/cdsl/Example.core_desc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ InstructionSet XExample extends RV32I {
instructions {
// TODO: remove/replace prefix
CV_SUBINCACC {
// encoding: 7'b0101000 :: 5'b00000 :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
encoding: 7'b0101000 :: rs2[4:0] :: rs1[4:0] :: 3'b011 :: rd[4:0] :: 7'b0101011;
assembly: "{name(rd)}, {name(rs1)}";
assembly: "{name(rd)}, {name(rs1)}, {name(rs2)}";
behavior: {
if (rd != 0) {
X[rd] += X[rs1] - X[rs2] + 1;
Expand Down
808 changes: 808 additions & 0 deletions examples/cdsl/RV32P.core_desc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/cdsl/rv_tumeda/XCoreVNand.core_desc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ InstructionSet XCoreVNand extends RV32I {
// }
CV_NAND_BITWISE {
encoding: 7'b1001001 :: rs2[4:0] :: rs1[4:0] :: 3'b110 :: rd[4:0] :: 7'b0101011;
assembly: {"cv.nand_bitwise", "{name(rd)}, {name(rs1)}, {name(rs2)}"};
assembly: {"cv.nand.bitwise", "{name(rd)}, {name(rs1)}, {name(rs2)}"};
behavior: {
if(rd != 0) X[rd] = ~(X[rs1] & X[rs2]);
}
Expand Down
2 changes: 1 addition & 1 deletion examples/cdsl/rv_xcorev
8 changes: 5 additions & 3 deletions examples/cfg/filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
filter:
sets:
# keep: [XCoreVAlu]
drop: [RISCVBase, RISCVEncoding, Zicsr, Zifencei, RVSMode, RVDebug, RV32I, RVNMode, XCoreVSimd]
# drop: [RISCVBase, RISCVEncoding, Zicsr, Zifencei, RVSMode, RVDebug, RV32I, RVNMode, XCoreVSimd]
drop: [RISCVBase, RISCVEncoding, Zicsr, Zifencei, RVSMode, RVDebug, RV32I, RVNMode]
# drop: [RISCVBase, RISCVEncoding, Zicsr, Zifencei, RVSMode, RVDebug, RV32I, RVNMode, RV32Zpsfoperand]
instructions:
# keep: [CV_ABS, CV_ADD_B]
drop: [CV_CLIPU, CV_CLIPR, CV_CLIPUR]
drop: [CV_CLIPU, CV_CLIPR, CV_CLIPUR, CV_SLET, CV_SLETU]
opcodes:
keep: [custom-0, custom-1, custom-2 ,custom-3, 0b00000]
keep: [custom-0, custom-1, custom-2 ,custom-3, 0b00000, OP-P, OP]
encoding_sizes:
keep: [32]
4 changes: 3 additions & 1 deletion examples/cfg/patches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ patches:
# file: gitlab_ci.patch
# file: llvm/gitlab_ci.patch
# file: /absolute/path/to/gitlab_ci.patch
- name: insert_markers_llvm17
# - name: insert_markers_llvm17
- name: insert_markers_llvm18
# TODO: automatially select patch depending on llvm version
# generated patch (TODO: implement)
# - name: ???
# target: llvm
Expand Down
76 changes: 76 additions & 0 deletions examples/cfg/riscv.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
riscv:
xlen: 32
features:
- m
- fast-unaligned-access
legalization:
gisel:
ops:
# TODO: simd shift?
# TODO: rotate left/right?
# - name: [G_SMAX, G_UMAX, G_SMIN, G_UMIN, G_ABS]
# types: [s32]
# onlyif: [HasVendorXCValu]
# - name: [G_ADD, G_SUB, G_AND, G_OR, G_XOR, G_ASHR, G_LSHR, G_SHL]
# types: [v4i8, v2i16]
# onlyif: [HasVendorXCVsimd]
# - name: G_INSERT_VECTOR_ELT
# types: [v4i8, v2i16]
# onlyif: [HasVendorXCVsimd]
# - name: [G_ADD]
# types: [v4i8, v2i16]
# onlyif: [HasExtmyextsimd]
- name: [G_ADD]
types: [s16, s32]
onlyif: [HasExtmyextalu]
# - name: [G_ADD, G_SMAX]
# types: [v4i8, v2i16]
# onlyif: [HasExtRV32Zpn]
# - name: [G_SHL, G_SMIN, G_SUB]
# types: [v4i8]
# onlyif: [HasExtRV32Zpn]
# - name: [G_SMIN, G_SMAX] # TODO: CLZ, REV, CMIX
# types: [s32]
# onlyif: [HasExtRV32Zbpo]
# # TODO: RV32Zpsfoperand (register pairs)
# TODO: G_BITCAST
transform_info:
shouldFoldTerminatingConditionAfterLSR: true
prefersVectorizedAddressing: false
enableInterleavedAccessVectorization: true
enableMaskedInterleavedAccessVectorization: null
enableScalableVectorization: false
preferEpilogueVectorization: null
supportsScalableVectors: false
# getInliningThresholdMultiplier: ?
# getInliningCostBenefitAnalysisSavingsMultiplier: ?
# getInliningCostBenefitAnalysisProfitableMultiplier: ?
# getInlinerVectorBonusPercent: ?
# getFlatAddressSpace: ?
# getMinVectorRegisterBitWidth: ?
# getCacheLineSize: ?
# getPrefetchDistance: ?
# getMaxPrefetchIterationsAhead: ?
# getMaxMemIntrinsicInlineSizeThreshold: ?
# getAtomicMemIntrinsicMaxElementSize: ?
# getMaxNumArgs: ?
# getGISelRematGlobalCost: ?
# getMinTripCountTailFoldingThreshold: ?
# getMaxVScale: ?
# getVScaleForTuning: ?
# getPredictableBranchThreshold: ?
# isSingleThreaded: ?
# isNumRegsMajorCostOfLSR: ?
# canMacroFuseCmp: ?
# enableOrderedReductions: ?
# LSRWithInstrQueries: ?
# useAA: ?
# shouldBuildLookupTables: ?
# shouldBuildRelLookupTables: ?
# supportsEfficientVectorElementLoadStore: ?
# supportsTailCalls: ?
# enableSelectOptimize: ?
# isFPVectorizationPotentiallyUnsafe: ?
# isVScaleKnownToBeAPowerOfTwo: ?
# enableWritePrefetching: ?
5 changes: 5 additions & 0 deletions examples/cfg/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
test:
paths: []
# - MC/RISCV
# - CodeGen/RISCV
9 changes: 8 additions & 1 deletion examples/cfg/xcorev/XCoreVAlu.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
extensions:
XCoreVAlu:
feature: XCVAlu
feature: XCValu
arch: xcvalu
version: "1.0"
experimental: false
vendor: true
# patches: []
passes:
per_model:
XCoreVAlu:
skip: [riscv_features, riscv_isa_info, riscv_instr_formats, riscv_instr_info, behav_to_pat]
override:
behav_to_pat:
patterns: false
9 changes: 8 additions & 1 deletion examples/cfg/xcorev/XCoreVBitmanip.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
extensions:
XCoreVBitmanip:
feature: XCVBitmanip
feature: XCVbitmanip
arch: xcvbitmanip
version: "1.0"
experimental: false
vendor: true
# patches: []
passes:
per_model:
XCoreVBitmanip:
skip: [riscv_features, riscv_isa_info, riscv_instr_formats, riscv_instr_info, behav_to_pat]
override:
behav_to_pat:
patterns: false
9 changes: 8 additions & 1 deletion examples/cfg/xcorev/XCoreVBranchImmediate.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
extensions:
XCoreVBranchImmediate:
feature: XCVBi
feature: XCVbi
arch: xcvbi
version: "1.0"
experimental: false
vendor: true
# patches: []
passes:
per_model:
XCoreVBranchImmediate:
skip: [riscv_features, riscv_isa_info, riscv_instr_formats, riscv_instr_info, behav_to_pat]
override:
behav_to_pat:
patterns: false
9 changes: 8 additions & 1 deletion examples/cfg/xcorev/XCoreVMac.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
extensions:
XCoreVMac:
feature: XCVMac
feature: XCVmac
arch: xcvmac
version: "1.0"
experimental: false
vendor: true
# patches: []
passes:
per_model:
XCoreVMac:
skip: [riscv_features, riscv_isa_info, riscv_instr_formats, riscv_instr_info, behav_to_pat]
override:
behav_to_pat:
patterns: false
9 changes: 8 additions & 1 deletion examples/cfg/xcorev/XCoreVMem.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
extensions:
XCoreVMem:
feature: XCVMem
feature: XCVmem
arch: xcvmem
version: "1.0"
experimental: false
vendor: true
# patches: []
passes:
per_model:
XCoreVMem:
skip: [riscv_features, riscv_isa_info, riscv_instr_formats, riscv_instr_info, behav_to_pat]
override:
behav_to_pat:
patterns: false
9 changes: 8 additions & 1 deletion examples/cfg/xcorev/XCoreVSimd.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
---
extensions:
XCoreVSimd:
feature: XCVSimd
feature: XCVsimd
arch: xcvsimd
version: "1.0"
experimental: false
vendor: true
# patches: []
passes:
per_model:
XCoreVSimd:
skip: [riscv_features, riscv_isa_info, riscv_instr_formats, riscv_instr_info, behav_to_pat]
override:
behav_to_pat:
patterns: false
77 changes: 54 additions & 23 deletions examples/demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,38 +34,38 @@
# VERBOSE = True
# FAST = False
FAST = True
SKIP_PATTERNS = False
# SKIP_PATTERNS = True
INTERACTIVE = False


seal5_flow = Seal5Flow("/tmp/seal5_llvm_demo", "demo")

# Optional: clean existing settings/models for fresh run
seal5_flow.reset(settings=True, interactive=False)
seal5_flow.clean(temp=True, patches=True, models=True, inputs=True, interactive=INTERACTIVE)

# Clone LLVM and init seal5 metadata directory
seal5_flow.initialize(
clone=True,
clone_url="https://github.com/llvm/llvm-project.git",
clone_ref="llvmorg-17.0.6",
# clone_ref="llvmorg-17.0.6",
clone_ref="llvmorg-18.1.0-rc3",
force=True,
verbose=VERBOSE,
)

# Optional: clean existing settings/models for fresh run
seal5_flow.reset(settings=True, interactive=False)

# Clone Seal5 dependencies
# 1. M2-ISA-R (frontend only)
# 2. CDSL2LLVM (later)
# TODO: refresh refs
seal5_flow.setup(force=True, verbose=VERBOSE)

# Load CoreDSL inputs
cdsl_files = [
# XCOREV
EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVMac.core_desc",
EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVAlu.core_desc",
EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVBitmanip.core_desc",
EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVSimd.core_desc",
EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVMem.core_desc",
EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVBranchImmediate.core_desc",
# EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVBitmanip.core_desc",
# EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVSimd.core_desc",
# EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVMem.core_desc",
# EXAMPLES_DIR / "cdsl" / "rv_xcorev" / "XCoreVBranchImmediate.core_desc",
# RVP (will not work)
# EXAMPLES_DIR / "cdsl" / "RV32P.core_desc",
# EXAMPLES_DIR / "cdsl" / "RVP.core_desc",
# S4E (untested) -> undefined XLEN
# EXAMPLES_DIR / "cdsl" / "rv_s4e" / "s4e-mac.core_desc",
Expand All @@ -78,26 +78,43 @@
]
seal5_flow.load(cdsl_files, verbose=VERBOSE, overwrite=True)

# Load test inputs
test_files = [
# EXAMPLES_DIR / "tests" / "xcorev" / "cv_abs.test.c",
EXAMPLES_DIR / "tests" / "cv_nand" / "cv_nand.c",
EXAMPLES_DIR / "tests" / "cv_nand" / "cv_nand.s",
EXAMPLES_DIR / "tests" / "cv_nand" / "cv_nand_invalid.s",
# TODO: support subdirectories to avoid duplicate test names (WARN!)
# EXAMPLES_DIR / "tests" / "cv_nand" / "*.c", # TODO: support glob patterns
]
seal5_flow.load(test_files, verbose=VERBOSE, overwrite=True)

# Load YAML inputs
cfg_files = [
# XCOREV
EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVMac.yml",
EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVAlu.yml",
EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVBitmanip.yml",
EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVSimd.yml",
EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVMem.yml",
EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVBranchImmediate.yml",
# EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVBitmanip.yml",
# EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVSimd.yml",
# EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVMem.yml",
# EXAMPLES_DIR / "cfg" / "xcorev" / "XCoreVBranchImmediate.yml",
# S4E
# TUMEDA
# GENERATED
# OTHERS
EXAMPLES_DIR / "cfg" / "llvm.yml",
EXAMPLES_DIR / "cfg" / "filter.yml",
EXAMPLES_DIR / "cfg" / "patches.yml",
EXAMPLES_DIR / "cfg" / "riscv.yml",
EXAMPLES_DIR / "cfg" / "tests.yml",
EXAMPLES_DIR / "cfg" / "git.yml",
]
seal5_flow.load(cfg_files, verbose=VERBOSE, overwrite=False)

# Clone & install Seal5 dependencies
# 1. CDSL2LLVM (add PHASE_0 patches)
seal5_flow.setup(force=True, verbose=VERBOSE)

# Apply initial patches
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_0])

Expand All @@ -111,11 +128,25 @@
# 3. Analyse/optimize instructions
seal5_flow.transform(verbose=VERBOSE)

# Generate patches
seal5_flow.generate(verbose=VERBOSE)
# Generate patches (except Patterns)
seal5_flow.generate(verbose=VERBOSE, skip=["pattern_gen"])

# Apply next patches
seal5_flow.patch(verbose=VERBOSE, stages=[PatchStage.PHASE_1, PatchStage.PHASE_2])

if not FAST:
# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config="release")
if not SKIP_PATTERNS:
# Build PatternGen & llc
seal5_flow.build(verbose=VERBOSE, config="release", target="pattern-gen")
seal5_flow.build(verbose=VERBOSE, config="release", target="llc")

# Generate remaining patches
seal5_flow.generate(verbose=VERBOSE, only=["pattern_gen"])

# Apply patches
seal5_flow.patch(verbose=VERBOSE)
# Apply patches
seal5_flow.patch(verbose=VERBOSE)

# Build patched LLVM
seal5_flow.build(verbose=VERBOSE, config="release")
Expand All @@ -130,4 +161,4 @@
seal5_flow.export("/tmp/seal5_llvm_demo.tar.gz", verbose=VERBOSE)

# Optional: cleanup temorary files, build dirs,...
# seal5.cleanup(temp=True, build=True, deps=True, force=True)
# seal5.clean(temp=True, build=True, deps=True, interactive=INTERACTIVE)
16 changes: 16 additions & 0 deletions examples/tests/cv_nand/cv_nand.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// RUN: clang -cc1 -triple riscv32 -target-feature +m -target-feature +xcorevnand -mllvm -global-isel=1 -S -O3 %s -o - \
// RUN: | FileCheck %s -check-prefix=CHECK

// CHECK-LABEL: nand_bitwise_s32:
// CHECK-COUNT-1: cv.nand.bitwise {{.*}}
signed int nand_bitwise_s32(signed int a, signed int b)
{
return ~(a & b);
}

// CHECK-LABEL: nand_bitwise_u32:
// CHECK-COUNT-1: cv.nand.bitwise {{.*}}
unsigned int nand_bitwise_u32(unsigned int a, unsigned int b)
{
return ~(a & b);
}
Loading
Loading