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

Backport xtensa_codegen to main (v2) #7432

Open
wants to merge 635 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 250 commits
Commits
Show all changes
635 commits
Select commit Hold shift + click to select a range
d0cf547
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 15, 2022
7bc3baa
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 16, 2022
470da09
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 28, 2022
fea1299
Fix #7255 for Xtensa, too (#7257)
steven-johnson Dec 28, 2022
598c104
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 28, 2022
c35aa11
Add missing `cache.clear()` call at end of functions (#7259)
steven-johnson Dec 29, 2022
d6f1e5d
Merge branch 'main' into xtensa-codegen
vksnk Jan 5, 2023
e87e1e8
Avoid global variables in xtensa_dma & better clean-up on failure
vksnk Jan 5, 2023
73a3f16
Pass _ucon to halide_error for DMA check (#7267)
steven-johnson Jan 9, 2023
104f3d1
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 10, 2023
8efaaed
[xtensa] Extend fp16 support for Xtensa (#7288)
vksnk Jan 18, 2023
511a04e
[xtensa] set is_tcm to False when working with buffer (#7277)
Aelphy Jan 18, 2023
2e9ae6a
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 18, 2023
4023640
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 20, 2023
562d045
Post changes from #7291 to Codegen_Xtensa (#7299)
steven-johnson Jan 20, 2023
23da552
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 23, 2023
4605ac6
[xtensa] Minor DMA improvements (#7304)
vksnk Jan 25, 2023
f52351f
[xtensa] added code for running tests and commented failing i48 tests…
Aelphy Jan 26, 2023
1589189
Merge branch 'main' into xtensa-codegen
vksnk Jan 31, 2023
e989a3a
Add store<native_vector_i16_2x> implementation
vksnk Jan 31, 2023
75de60a
Add widening quad add
vksnk Jan 31, 2023
63175ac
Improved halide_xtensa_sat_narrow_i16
vksnk Jan 31, 2023
f338197
Do not inline generic gather_load + specialization for gather of nati…
vksnk Jan 31, 2023
6c521e0
Add __attribute__((malloc)) to halide_tcm_malloc
vksnk Jan 31, 2023
fae28de
Patterns for quad widening add + minor clean-up
vksnk Jan 31, 2023
0a1b5a1
Replace widening_shift_left with signed widening_mul when possible
vksnk Jan 31, 2023
78dc6a0
Pattern for narrow_i48_with_rounding_shift_i16
vksnk Jan 31, 2023
234bf6e
Merge branch 'main' into xtensa-codegen
vksnk Jan 31, 2023
9ab7a4d
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 3, 2023
7e93e0a
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 8, 2023
8efaae9
[xtensa] A few minor Xtensa fixes (#7333)
steven-johnson Feb 10, 2023
76dc02a
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 10, 2023
a0ac990
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 10, 2023
31e557f
Add [SKIP] to correctness_simd_op_check_xtensa
steven-johnson Feb 10, 2023
3e6a2c6
Remove Xtensa::compile(LoweredFunc), add Xtensa::preprocess_function_…
steven-johnson Feb 10, 2023
858ee30
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 11, 2023
7ea67a6
Remove unnecessary overrides in Codegen_Xtensa (#7342)
steven-johnson Feb 11, 2023
b467f28
[xtensa] Generate PACKVRNR for i16(i32(i48x) >> wild_i32) (#7349)
vksnk Feb 14, 2023
ec1159e
[xtensa] Remove __restrict from print_assignment (#7351)
vksnk Feb 14, 2023
49e7d35
[Xtensa] 8-bit arithmetic improvements + some other smaller changes (…
Aelphy Feb 15, 2023
f6731b0
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 15, 2023
310f641
[xtensa] Improvements to CodeGen_Xtensa (#7328)
Aelphy Feb 15, 2023
038d325
Add missing convert<native_vector_u16_x2, native_vector_i24>
vksnk Feb 15, 2023
21d7637
Merge branch 'main' into xtensa-codegen
vksnk Feb 15, 2023
e69fa42
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 22, 2023
29f3f42
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 22, 2023
ad6c84a
[xtensa] Clean up HalideFreeHelper code (#7368)
steven-johnson Feb 22, 2023
38057b8
Merge branch 'main' into xtensa-codegen
vksnk Feb 27, 2023
0091fd9
[xtensa] Limit the number of allowed DMA channels + allocate a separa…
vksnk Feb 28, 2023
2fb3b62
Better handling of u1 to i16 cast & clean-up
vksnk Feb 28, 2023
c16b5e2
[xtensa] removed tests that are failing to compile (#7362)
Aelphy Feb 28, 2023
040d773
Merge branch 'main' into xtensa-codegen
vksnk Mar 1, 2023
b48f78c
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
vksnk Mar 1, 2023
c855273
Merge branch 'main' into xtensa-codegen
vksnk Mar 3, 2023
5e81e91
Remove incorrect halide_xtensa_sat_narrow_u16
vksnk Mar 3, 2023
3a0b891
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 6, 2023
08d3c37
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 13, 2023
613655d
Add is_stack_private_to_thread()
steven-johnson Mar 13, 2023
afda48d
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 15, 2023
d598e54
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 16, 2023
d7153e3
Revert all apps/ to current top-of-tree status
steven-johnson Mar 16, 2023
d31dcb7
Add halide_xtensa_extract_*_of_4_u16
vksnk Mar 16, 2023
37329e1
Limit halide_xtensa_extract_*_of_* to native vectors
vksnk Mar 16, 2023
5a025a7
Fix formatting
vksnk Mar 16, 2023
bf1133a
Make sure that count for load_variable is positive
vksnk Mar 16, 2023
658ceba
Move large Xtensa-codegen source into external template files (#7430)
steven-johnson Mar 16, 2023
ec6c234
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 17, 2023
8495be1
[xtensa] Returned old free_helper (#7441)
Aelphy Mar 22, 2023
83adfa3
[xtensa] Added uint32 vector mul and fixed i16 -> i32_x2 vector conve…
Aelphy Mar 23, 2023
39eced3
Merge branch 'main' into xtensa-codegen
vksnk Mar 23, 2023
c4bd23e
Remove commented code
vksnk Mar 23, 2023
9af1278
Report an error in the end of suffix_for_type
vksnk Mar 23, 2023
9d06135
Refactor is_native_vector_type and is_double_native_vector_type
vksnk Mar 23, 2023
32d1a29
Move common logic into visit_comparison_op
vksnk Mar 27, 2023
5cb1b30
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 28, 2023
8ebc04a
WIP
steven-johnson Mar 28, 2023
6881545
Update XtensaOptimize.cpp
steven-johnson Mar 28, 2023
7614953
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 28, 2023
4e2aaab
Remove dupe func
steven-johnson Mar 28, 2023
0f23f14
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 28, 2023
7524d06
Fix is_double_native_vector_type
vksnk Mar 28, 2023
c7fb421
Add missing store_predicated
vksnk Mar 28, 2023
e0a1e65
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 29, 2023
33dee7f
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 29, 2023
48903c4
[xtensa] fixed few correctness issues in codegen + added new correctn…
Aelphy Mar 30, 2023
9f58631
Minor improvements to Xtensa codegen (#7463)
steven-johnson Mar 31, 2023
10124d3
Improve intrinsic_suffix_for_type() to be switch-based
steven-johnson Apr 1, 2023
614669a
Remove XTensa override of print_assignment()
steven-johnson Apr 1, 2023
e02255f
Make op_name_to_intrinsic a member variable
steven-johnson Apr 1, 2023
e57c5cf
Move Xtensa from Feature to Arch (#7467)
steven-johnson Apr 3, 2023
4b3f443
Use a real hash function for HalideTypeSet (#7469)
steven-johnson Apr 3, 2023
17d15a6
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 3, 2023
d477fd2
Update simd_op_check_xtensa.cpp
steven-johnson Apr 3, 2023
3fe791d
Update CodeGen_Xtensa.cpp
steven-johnson Apr 3, 2023
e99d060
Update CodeGen_Xtensa.cpp
steven-johnson Apr 3, 2023
d5f5cec
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 3, 2023
97c7f74
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 5, 2023
686bc74
Fix technically-illegal in-class specialization
steven-johnson Apr 6, 2023
127872b
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 7, 2023
d83dba0
trigger buildbots
steven-johnson Apr 7, 2023
e5e6d9e
Minor code cleanup in Xtensa (#7492)
steven-johnson Apr 10, 2023
262f7d3
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 11, 2023
62ba85b
Update CodeGen_Xtensa.cpp
steven-johnson Apr 11, 2023
e43507b
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 18, 2023
d0a1be0
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 19, 2023
3d8ed21
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 20, 2023
eb6d786
[xtensa] Fixed a bug in interleave RGB for Q8 (#7526)
Aelphy Apr 22, 2023
8eafd5d
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 24, 2023
ab5b52a
[xtensa] fixed regression due to a new pattern for narrow_predicate (…
Aelphy Apr 25, 2023
a0050eb
Merge branch 'main' into xtensa-codegen
vksnk Apr 25, 2023
34f2943
[xtensa] supported new narrow rules in XtensaOptimize (#7535)
Aelphy Apr 26, 2023
831e686
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 28, 2023
792d4ae
Merge branch 'main' into xtensa-codegen
steven-johnson May 2, 2023
5e38a83
Merge branch 'main' of https://github.com/halide/Halide into xtensa-c…
vksnk May 4, 2023
fbdabb7
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
vksnk May 4, 2023
7c93c61
Adds a function to extract every 8th element of vector
vksnk May 4, 2023
8ed6d2e
Add corresponding type
vksnk May 4, 2023
c153cda
Merge branch 'main' into xtensa-codegen
steven-johnson May 5, 2023
be1d051
Merge branch 'main' into xtensa-codegen
steven-johnson May 8, 2023
2764a26
Merge branch 'main' into xtensa-codegen
steven-johnson May 9, 2023
34fe122
Merge branch 'main' into xtensa-codegen
steven-johnson May 12, 2023
74f6fa5
Merge branch 'main' into xtensa-codegen
steven-johnson May 16, 2023
1723399
Merge branch 'main' of https://github.com/halide/Halide into xtensa-c…
vksnk May 18, 2023
41abd8a
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
vksnk May 18, 2023
a8cce9d
Use IEEE compliant square root intrinsic
vksnk May 18, 2023
c747082
Merge branch 'main' into xtensa-codegen
steven-johnson May 18, 2023
47d1ba4
Merge branch 'main' into xtensa-codegen
vksnk May 24, 2023
3b849f9
Fixes halide_xtensa_sat_narrow_shift_i32 intrinsic
vksnk May 24, 2023
306715b
Tighten Target parsing for Xtensa (#7589)
steven-johnson May 24, 2023
86628a4
Pacify clang-tidy by removing unused constant (#7590)
steven-johnson May 24, 2023
7805085
Trim xtensa symbol names to get under 65-char limit (#7595)
steven-johnson May 30, 2023
d9f328f
Merge branch 'main' into xtensa-codegen
steven-johnson May 30, 2023
1eb0051
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 5, 2023
462cb76
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 5, 2023
6df58b0
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 8, 2023
1e22d04
Merge branch 'main' into xtensa-codegen
vksnk Jun 14, 2023
78e3692
Optimize f32(i16(wild_i32x)) pattern
vksnk Jun 14, 2023
ca576e0
Generates & (2^n)-1 for % 2^n
vksnk Jun 14, 2023
701df75
Relaxes check for interleave op generation
vksnk Jun 14, 2023
15c387d
Puts small, constant-sized allocations with MemoryType::Auto on Stack
vksnk Jun 14, 2023
2605161
Adds implementations with intrinsics of f32 load/stores
vksnk Jun 14, 2023
675b0f2
Adds gather_load<native_vector_i16_x2>
vksnk Jun 14, 2023
69b254c
Adds missing function implementation
vksnk Jun 14, 2023
1d2b16a
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 20, 2023
2d3d3b9
[xtensa] widen ops, convert, division + abs, gather_load improvements…
Aelphy Jun 23, 2023
4a8d62f
Merge branch 'main' into xtensa-codegen
vksnk Jul 12, 2023
288a231
Workaround for compiler bug
vksnk Jul 13, 2023
9f6b861
Merge branch 'main' into xtensa-codegen
steven-johnson Jul 24, 2023
c7c4b35
Merge branch 'main' into xtensa-codegen
steven-johnson Jul 24, 2023
3a2cecc
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 7, 2023
58798f6
[xtensa] Applied xtensa_dma patch from Cadence (#7750)
Aelphy Aug 8, 2023
a3d1e71
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 24, 2023
996482b
Codegen fixes so it can compile with cstubs
vksnk Sep 13, 2023
39e3a78
Merge branch 'main' into xtensa-codegen
vksnk Sep 13, 2023
92ff9bb
Improve handling of bool vectors
vksnk Sep 18, 2023
9f044b5
Build rules for Xtensa tests with cstub library (#7852)
vksnk Sep 19, 2023
26c036b
Merge branch 'main' into xtensa-codegen
vksnk Oct 19, 2023
057050a
[xtensa] improved conversion ops and covered them with tests (#7859)
Aelphy Oct 20, 2023
e1eb59f
Merge branch 'main' into xtensa-codegen
vksnk Oct 23, 2023
b8a4523
Fix a test and disable two
vksnk Oct 23, 2023
5439f01
Merge branch 'main' into xtensa-codegen
vksnk Oct 31, 2023
7486c0c
Merge branch 'main' into xtensa-codegen
vksnk Nov 6, 2023
dcfa415
Shuffles for fp16 and support all of the immediate shuffles
vksnk Nov 6, 2023
0f4a488
Format
vksnk Nov 6, 2023
01f3132
Pre-convert indices for gather
vksnk Nov 6, 2023
4fa8f86
Merge branch 'main' into xtensa-codegen
vksnk Nov 9, 2023
e9d0319
Add missing override
vksnk Nov 10, 2023
804f37b
[xtensa] Improved load_predicated for float (#7943)
Aelphy Nov 10, 2023
d6b0816
[xtensa] Clean up (#7953)
Aelphy Nov 20, 2023
46ef7ac
Merge branch 'main' into xtensa-codegen
vksnk Nov 21, 2023
71e2728
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 28, 2023
68a6652
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 28, 2023
80e8daa
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 28, 2023
fc4ff80
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 29, 2023
fadcbeb
[xtensa] Clean up (#7961)
Aelphy Nov 29, 2023
d95b65a
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 5, 2023
d84e3a6
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 8, 2023
2c48ba8
Fix boolean Or for q8 and add support of boolean Add and Not
vksnk Dec 8, 2023
b1dd8de
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 13, 2023
e1e4193
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 13, 2023
7d83daf
Merge branch 'main' into xtensa-codegen
vksnk Dec 15, 2023
a20dbef
Interleave functions for fp16
vksnk Dec 15, 2023
4306918
Merge branch 'main' into xtensa-codegen
vksnk Dec 19, 2023
5212015
Formatting fixes
vksnk Dec 19, 2023
aec7d7b
[xtensa] index cast to uint16 for gath_load is at least sometimes wrong
Aelphy Dec 21, 2023
43df465
[xtensa] undo disabling of ConvertGatherLoadIndex
Aelphy Dec 21, 2023
e2a58dd
Merge branch 'main' into xtensa-codegen
vksnk Jan 3, 2024
76d8e37
Swap loop_carry and align_loads
vksnk Jan 3, 2024
b12448e
Add runtime function to wait for specific dma transaction
vksnk Jan 3, 2024
846ac52
Schedule ahead DMA copy if ring_buffer is defined
vksnk Jan 3, 2024
a925471
Merge branch 'main' into xtensa-codegen
steven-johnson Jan 17, 2024
e5d4a57
Fix clang-tidy errors in InjectDmaTransfer (#8033)
steven-johnson Jan 17, 2024
4a3378f
[xtensa] adjusted the tests to be launchable for Q8 (#8011)
Aelphy Jan 17, 2024
05d4412
Skip the double buffering for DMA if the allocation and compute is at…
vksnk Jan 19, 2024
958037a
[xtensa] Added efficient gather load to Q7 (#8026)
Aelphy Jan 23, 2024
9e17fc7
[xtensa] Added float16 interleaves (#8050)
Aelphy Jan 29, 2024
f32f95e
[xtensa] added vector load_predicated for f16 (#8057)
Aelphy Feb 1, 2024
35e97c6
Merge branch 'main' into xtensa-codegen
vksnk Feb 1, 2024
8c7d78c
Fix warning
vksnk Feb 1, 2024
feb0b93
[xtensa] Added int32 by int16 vector division + maintenance work (#8058)
Aelphy Feb 6, 2024
ea03af7
[xtensa] Added int32<->float vector reinterprets (#8070)
Aelphy Feb 7, 2024
3285236
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 7, 2024
77fc71b
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
steven-johnson Feb 7, 2024
a732568
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 14, 2024
6b2b35b
Fix simd_op_check_xtensa (#8095)
steven-johnson Feb 14, 2024
b8d576f
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 14, 2024
72603c2
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 18, 2024
0e69339
[xtensa] added vector extracts for floats + moved float16 and int48 (…
Aelphy Feb 19, 2024
15e80e9
[xtensa] Fixed halide_xtensa_interleave_f16 (#8109)
Aelphy Feb 19, 2024
91b3273
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 26, 2024
3e59768
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 26, 2024
85b6d7e
Merge branch 'main' into xtensa-codegen
steven-johnson Feb 27, 2024
aa696b5
[Xtensa codegen] Specializations for load/store and fma support (#8126)
vksnk Feb 27, 2024
b248fa9
[xtensa] Added gather_load for float16 (#8128)
Aelphy Feb 28, 2024
c9bbd19
Merge branch 'main' into xtensa-codegen
vksnk Feb 28, 2024
b6449b3
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 5, 2024
aad94de
Disable halide_xtensa_mul_add_f32 temporarily
vksnk Mar 5, 2024
30f29fc
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 8, 2024
f60781f
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 15, 2024
cff71e1
Merge branch 'main' into xtensa-codegen
steven-johnson Mar 29, 2024
f42a3d7
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 5, 2024
f247636
Merge branch 'main' into xtensa-codegen
vksnk Apr 12, 2024
3e712ba
Disable fused mul-add for f16 while investigating
vksnk Apr 12, 2024
3101277
Merge branch 'main' into xtensa-codegen
steven-johnson Apr 29, 2024
d61390a
[xtensa] Fixed index conversion for gather_load with undefined ramp (…
Aelphy May 10, 2024
17d4351
Merge branch 'main' into xtensa-codegen
steven-johnson May 20, 2024
8a316d1
[xtensa] Added vector load for two vectors for f16 and f32 (#8226)
Aelphy May 23, 2024
3ea4747
[xtensa] added support for sqrt_f16 (#8247)
Aelphy May 30, 2024
1ef63f7
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 3, 2024
5b5b0c6
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 5, 2024
69bfd80
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 5, 2024
83476fb
[xtensa] Fixed broadcast for Q8 (#8271)
Aelphy Jun 7, 2024
eeda6e6
[xtensa] Added a new optimize rule (#8276)
Aelphy Jun 11, 2024
51c5bea
Merge branch 'main' into xtensa-codegen
vksnk Jun 13, 2024
6c9b492
Merge branch 'xtensa-codegen' of https://github.com/halide/Halide int…
vksnk Jun 13, 2024
1b5db56
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 26, 2024
7c7ca23
Merge branch 'main' into xtensa-codegen
steven-johnson Jun 28, 2024
42db6c6
abs for f16 types
vksnk Jul 17, 2024
3cb0b00
Adds specializations for aligned loads and stores for f16 type
vksnk Jul 17, 2024
e208b47
Fix dumb mistake
vksnk Jul 18, 2024
0b18cf7
Merge branch 'main' into xtensa-codegen
steven-johnson Jul 24, 2024
92abb5f
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 1, 2024
80443bf
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 15, 2024
e1f962e
Merge branch 'main' into xtensa-codegen
steven-johnson Aug 23, 2024
90f1acc
Merge branch 'main' into xtensa-codegen
steven-johnson Sep 17, 2024
1dbe8c5
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 6, 2024
75d3228
Merge branch 'main' into xtensa-codegen
steven-johnson Nov 8, 2024
25ebbb3
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 9, 2024
e995c89
Fix Xtensa code for as_const API change (#8502)
steven-johnson Dec 9, 2024
d9420d3
Merge branch 'main' into xtensa-codegen
steven-johnson Dec 16, 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
37 changes: 34 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ SOURCE_FILES = \
CodeGen_WebAssembly.cpp \
CodeGen_WebGPU_Dev.cpp \
CodeGen_X86.cpp \
CodeGen_Xtensa.cpp \
CompilerLogger.cpp \
CPlusPlusMangle.cpp \
CSE.cpp \
Expand Down Expand Up @@ -476,6 +477,7 @@ SOURCE_FILES = \
HexagonOptimize.cpp \
ImageParam.cpp \
InferArguments.cpp \
InjectDmaTransfer.cpp \
InjectHostDevBufferCopies.cpp \
Inline.cpp \
InlineReductions.cpp \
Expand Down Expand Up @@ -579,11 +581,14 @@ SOURCE_FILES = \
Var.cpp \
VectorizeLoops.cpp \
WasmExecutor.cpp \
WrapCalls.cpp
WrapCalls.cpp \
XtensaOptimize.cpp

C_TEMPLATE_FILES = \
CodeGen_C_prologue \
CodeGen_C_vectors
CodeGen_C_vectors \
CodeGen_Xtensa_prologue \
CodeGen_Xtensa_vectors

# The externally-visible header files that go into making Halide.h.
# Don't include anything here that includes llvm headers.
Expand Down Expand Up @@ -624,6 +629,7 @@ HEADER_FILES = \
CodeGen_PyTorch.h \
CodeGen_Targets.h \
CodeGen_WebGPU_Dev.h \
CodeGen_Xtensa.h \
CompilerLogger.h \
ConciseCasts.h \
CPlusPlusMangle.h \
Expand Down Expand Up @@ -664,6 +670,7 @@ HEADER_FILES = \
HexagonOptimize.h \
ImageParam.h \
InferArguments.h \
InjectDmaTransfer.h \
InjectHostDevBufferCopies.h \
Inline.h \
InlineReductions.h \
Expand Down Expand Up @@ -751,7 +758,8 @@ HEADER_FILES = \
Util.h \
Var.h \
VectorizeLoops.h \
WrapCalls.h
WrapCalls.h \
XtensaOptimize.h

OBJECTS = $(SOURCE_FILES:%.cpp=$(BUILD_DIR)/%.o)
HEADERS = $(HEADER_FILES:%.h=$(SRC_DIR)/%.h)
Expand Down Expand Up @@ -1168,6 +1176,10 @@ clean:
rm -rf $(DISTRIB_DIR)
rm -rf $(ROOT_DIR)/apps/*/bin

.PHONY: clean_xtensa
clean_xtensa:
rm -rf $(XTENSA_RUNTIME_OBJS) $(DISTRIB_DIR)/lib/libHalideRuntime-xtensa.a

CORRECTNESS_TESTS = $(shell ls $(ROOT_DIR)/test/correctness/*.cpp) $(shell ls $(ROOT_DIR)/test/correctness/*.c)
PERFORMANCE_TESTS = $(shell ls $(ROOT_DIR)/test/performance/*.cpp)
ERROR_TESTS = $(shell ls $(ROOT_DIR)/test/error/*.cpp)
Expand Down Expand Up @@ -2395,6 +2407,25 @@ $(DISTRIB_DIR)/lib/libautoschedule_adams2019.$(PLUGIN_EXT)
.PHONY: distrib
distrib: $(DISTRIB_DIR)/lib/libHalide.$(SHARED_EXT) autoschedulers

XTENSA_RUNTIME_SRC=$(ROOT_DIR)/src/runtime/alignment_128.cpp \
$(ROOT_DIR)/src/runtime/errors.cpp \
$(ROOT_DIR)/src/runtime/posix_error_handler.cpp \
$(ROOT_DIR)/src/runtime/msan_stubs.cpp \
$(ROOT_DIR)/src/runtime/to_string.cpp \
$(ROOT_DIR)/src/runtime/posix_print.cpp \
$(ROOT_DIR)/src/runtime/posix_io.cpp \
$(ROOT_DIR)/src/runtime/xtensa_dma.cpp \

XTENSA_RUNTIME_OBJS=$(patsubst $(ROOT_DIR)/src/runtime/%,$(BIN_DIR)/%,$(patsubst %.cpp,%.o,$(XTENSA_RUNTIME_SRC)))

$(XTENSA_RUNTIME_OBJS): $(BIN_DIR)/%.o: $(ROOT_DIR)/src/runtime/%.cpp
xt-clang++ -O2 -mlongcalls -c -std=c++17 -stdlib=libc++ -D COMPILING_HALIDE_RUNTIME -DBITS_32 -ffreestanding $< -o $@

$(DISTRIB_DIR)/lib/libHalideRuntime-xtensa.a: $(XTENSA_RUNTIME_OBJS)
xt-ar rcs $@ $^

xtensa-runtime: distrib $(DISTRIB_DIR)/lib/libHalideRuntime-xtensa.a

$(DISTRIB_DIR)/halide.tgz: distrib
ln -sf $(DISTRIB_DIR) halide
tar -czf $(BUILD_DIR)/halide.tgz \
Expand Down
2 changes: 2 additions & 0 deletions python_bindings/src/halide/halide_/PyEnums.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,8 @@ void define_enums(py::module &m) {
.value("SVE2", Target::Feature::SVE2)
.value("ARMDotProd", Target::Feature::ARMDotProd)
.value("ARMFp16", Target::Feature::ARMFp16)
.value("Xtensa", Target::Feature::Xtensa)
.value("XtensaQ8", Target::Feature::XtensaQ8)
.value("LLVMLargeCodeModel", Target::Feature::LLVMLargeCodeModel)
.value("RVV", Target::Feature::RVV)
.value("ARMv81a", Target::Feature::ARMv81a)
Expand Down
2 changes: 2 additions & 0 deletions python_bindings/src/halide/halide_/PyFunc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,8 @@ void define_func(py::module &m) {

.def("infer_arguments", &Func::infer_arguments)

.def("dma", (Func & (Func::*)()) & Func::dma)

.def("__repr__", [](const Func &func) -> std::string {
std::ostringstream o;
o << "<halide.Func '" << func.name() << "'>";
Expand Down
18 changes: 12 additions & 6 deletions src/AssociativeOpsTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ enum class ValType {
UInt64 = 4,
Int8 = 5,
Int16 = 6,
Int32 = 7,
Int64 = 8,
Float16 = 9,
Float32 = 10,
Float64 = 11,
All = 12, // General type (including all previous types)
Int24 = 7,
Int32 = 8,
Int48 = 9,
Int64 = 10,
Float16 = 11,
Float32 = 12,
Float64 = 13,
All = 14, // General type (including all previous types)
};

ValType convert_halide_type_to_val_type(const Type &halide_t) {
Expand All @@ -63,8 +65,12 @@ ValType convert_halide_type_to_val_type(const Type &halide_t) {
val_t = ValType::Int8;
} else if (halide_t.bits() == 16) {
val_t = ValType::Int16;
} else if (halide_t.bits() == 24) {
val_t = ValType::Int24;
} else if (halide_t.bits() == 32) {
val_t = ValType::Int32;
} else if (halide_t.bits() == 48) {
val_t = ValType::Int48;
} else {
internal_assert(halide_t.bits() == 64);
val_t = ValType::Int64;
Expand Down
8 changes: 8 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ set(HEADER_FILES
CodeGen_PyTorch.h
CodeGen_Targets.h
CodeGen_WebGPU_Dev.h
CodeGen_Xtensa.h
CompilerLogger.h
ConciseCasts.h
CPlusPlusMangle.h
Expand Down Expand Up @@ -80,6 +81,7 @@ set(HEADER_FILES
HexagonOptimize.h
ImageParam.h
InferArguments.h
InjectDmaTransfer.h
InjectHostDevBufferCopies.h
Inline.h
InlineReductions.h
Expand Down Expand Up @@ -168,6 +170,7 @@ set(HEADER_FILES
VectorizeLoops.h
WasmExecutor.h
WrapCalls.h
XtensaOptimize.h
)

set(SOURCE_FILES
Expand Down Expand Up @@ -210,6 +213,7 @@ set(SOURCE_FILES
CodeGen_WebAssembly.cpp
CodeGen_WebGPU_Dev.cpp
CodeGen_X86.cpp
CodeGen_Xtensa.cpp
CompilerLogger.cpp
CPlusPlusMangle.cpp
CSE.cpp
Expand Down Expand Up @@ -244,6 +248,7 @@ set(SOURCE_FILES
HexagonOptimize.cpp
ImageParam.cpp
InferArguments.cpp
InjectDmaTransfer.cpp
InjectHostDevBufferCopies.cpp
Inline.cpp
InlineReductions.cpp
Expand Down Expand Up @@ -348,11 +353,14 @@ set(SOURCE_FILES
VectorizeLoops.cpp
WasmExecutor.cpp
WrapCalls.cpp
XtensaOptimize.cpp
)

set(TEMPLATE_FILES
CodeGen_C_prologue
CodeGen_C_vectors
CodeGen_Xtensa_prologue
CodeGen_Xtensa_vectors
)

##
Expand Down
2 changes: 1 addition & 1 deletion src/CodeGen_C.h
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ class CodeGen_C : public IRPrinter {
void emit_constexpr_function_info(const std::string &function_name,
const std::vector<LoweredArgument> &args,
const MetadataNameMap &metadata_name_map);
void emit_halide_free_helper(const std::string &alloc_name, const std::string &free_function);
virtual void emit_halide_free_helper(const std::string &alloc_name, const std::string &free_function);
};

} // namespace Internal
Expand Down
Loading