已合并
Improve document links #372
bxr创建于 3月1日
Improve document links #372
已合并
bxr创建于 3月1日
303 个文件变更+5104-4384
@@ -49,7 +49,7 @@ Measured on Ascend A3 (24 cores) with fp16 inputs → fp32 output:
49| `m=6144` `k=6144` `n=6144` | 86.7% | 68.1% | 95.2% | 3.1% | 1.5060 |49| `m=6144` `k=6144` `n=6144` | 86.7% | 68.1% | 95.2% | 3.1% | 1.5060 |
50| `m=7680` `k=7680` `n=7680` | 80.6% | 63.0% | 98.4% | 2.4% | 3.1680 |50| `m=7680` `k=7680` `n=7680` | 80.6% | 63.0% | 98.4% | 2.4% | 3.1680 |
51 51 
52-Detailed analysis and tuning notes: `kernels/manual/a2a3/gemm_performance/README.md`.52+Detailed analysis and tuning notes: [High-Performance GEMM Operator Example](kernels/manual/a2a3/gemm_performance/README.md).
53 53 
54![GEMM performance reference (Ascend A3, 24 cores)](docs/figures/performance/gemm_performance_a3.svg)54![GEMM performance reference (Ascend A3, 24 cores)](docs/figures/performance/gemm_performance_a3.svg)
55 55 
@@ -57,7 +57,7 @@ Detailed analysis and tuning notes: `kernels/manual/a2a3/gemm_performance/README
57 57 
58- Kernel: `kernels/manual/a2a3/flash_atten/`58- Kernel: `kernels/manual/a2a3/flash_atten/`
59 59 
60-Detailed analysis and tuning notes: `kernels/manual/a2a3/flash_atten/README.md`.60+Detailed analysis and tuning notes: [Flash Attention Kernel Implementation](kernels/manual/a2a3/flash_atten/README.md).
61 61 
62![Flash Attention normalized TFLOPS (A2/A3)](docs/figures/performance/fa_normalized_tflops_a2a3.svg)62![Flash Attention normalized TFLOPS (A2/A3)](docs/figures/performance/fa_normalized_tflops_a2a3.svg)
63 63 
@@ -49,7 +49,7 @@ PTO Tile Lib 并不面向入门级用户,主要面向:
49| `m=6144` `k=6144` `n=6144` | 86.7% | 68.1% | 95.2% | 3.1% | 1.5060 |49| `m=6144` `k=6144` `n=6144` | 86.7% | 68.1% | 95.2% | 3.1% | 1.5060 |
50| `m=7680` `k=7680` `n=7680` | 80.6% | 63.0% | 98.4% | 2.4% | 3.1680 |50| `m=7680` `k=7680` `n=7680` | 80.6% | 63.0% | 98.4% | 2.4% | 3.1680 |
51 51 
52-详细分析与调参说明:`kernels/manual/a2a3/gemm_performance/README_zh.md`52+详细分析与调参说明:[高性能 GEMM 算子示例](kernels/manual/a2a3/gemm_performance/README_zh.md)
53 53 
54![GEMM 性能参考(Ascend A3,24 核)](docs/figures/performance/gemm_performance_a3.svg)54![GEMM 性能参考(Ascend A3,24 核)](docs/figures/performance/gemm_performance_a3.svg)
55 55 
@@ -57,7 +57,7 @@ PTO Tile Lib 并不面向入门级用户,主要面向:
57 57 
58- Kernel:`kernels/manual/a2a3/flash_atten/`58- Kernel:`kernels/manual/a2a3/flash_atten/`
59 59 
60-详细分析与调参说明:`kernels/manual/a2a3/flash_atten/README_zh.md`60+详细分析与调参说明:[Flash Attention 算子实现](kernels/manual/a2a3/flash_atten/README_zh.md)
61 61 
62![Flash Attention 归一化 TFLOPS(A2/A3)](docs/figures/performance/fa_normalized_tflops_a2a3.svg)62![Flash Attention 归一化 TFLOPS(A2/A3)](docs/figures/performance/fa_normalized_tflops_a2a3.svg)
63 63 
@@ -103,7 +103,7 @@ PTO ISA 定义了 90+ 条标准操作。本仓库实现了其中不断增长的
103* Ascend A5(Ascend 950)103* Ascend A5(Ascend 950)
104* CPU(x86_64 / AArch64)104* CPU(x86_64 / AArch64)
105 105 
106-更多细节请参考:`include/README_zh.md`106+更多细节请参考:[include/README_zh.md](include/README_zh.md)
107 107 
108## 快速开始108## 快速开始
109 109 
@@ -1,32 +1,32 @@
1# PTO Virtual ISA Manual1# PTO Virtual ISA Manual
2 2 
3This page is the stable entry point for the PTO Virtual Instruction Set Architecture manual.3This page is the stable entry point for the PTO Virtual Instruction Set Architecture manual.
4-The chaptered source of truth is maintained under `docs/mkdocs/src/manual/`.4+The chaptered source of truth is maintained under `manual/`.
5 5 
6## Primary entry6## Primary entry
7 7 
8-- Preface and reading order: `mkdocs/src/manual/index.md`8+- [Preface and reading order](mkdocs/src/manual/index.md)
9-- Manual overview chapter: `mkdocs/src/manual/01-overview.md`9+- [Manual overview chapter](mkdocs/src/manual/01-overview.md)
10-- Virtual ISA and IR contract: `mkdocs/src/manual/09-virtual-isa-and-ir.md`10+- [Virtual ISA and IR contract](mkdocs/src/manual/09-virtual-isa-and-ir.md)
11-- Bytecode and toolchain contract: `mkdocs/src/manual/10-bytecode-and-toolchain.md`11+- [Bytecode and toolchain contract](mkdocs/src/manual/10-bytecode-and-toolchain.md)
12-- Memory ordering and consistency: `mkdocs/src/manual/11-memory-ordering-and-consistency.md`12+- [Memory ordering and consistency](mkdocs/src/manual/11-memory-ordering-and-consistency.md)
13-- Backend profiles and conformance: `mkdocs/src/manual/12-backend-profiles-and-conformance.md`13+- [Backend profiles and conformance](mkdocs/src/manual/12-backend-profiles-and-conformance.md)
14 14 
15## Chapter map15## Chapter map
16 16 
17-1. `mkdocs/src/manual/01-overview.md`17+1. [Overview](mkdocs/src/manual/01-overview.md)
18-2. `mkdocs/src/manual/02-machine-model.md`18+2. [Execution Model](mkdocs/src/manual/02-machine-model.md)
19-3. `mkdocs/src/manual/03-state-and-types.md`19+3. [State and Types](mkdocs/src/manual/03-state-and-types.md)
20-4. `mkdocs/src/manual/04-tiles-and-globaltensor.md`20+4. [Tiles and GlobalTensor](mkdocs/src/manual/04-tiles-and-globaltensor.md)
21-5. `mkdocs/src/manual/05-synchronization.md`21+5. [Synchronization](mkdocs/src/manual/05-synchronization.md)
22-6. `mkdocs/src/manual/06-assembly.md`22+6. [PTO Assembly (PTO-AS)](mkdocs/src/manual/06-assembly.md)
23-7. `mkdocs/src/manual/07-instructions.md`23+7. [Instruction Set (overview)](mkdocs/src/manual/07-instructions.md)
24-8. `mkdocs/src/manual/08-programming.md`24+8. [Programming Guide](mkdocs/src/manual/08-programming.md)
25-9. `mkdocs/src/manual/09-virtual-isa-and-ir.md`25+9. [Virtual ISA and IR](mkdocs/src/manual/09-virtual-isa-and-ir.md)
26-10. `mkdocs/src/manual/10-bytecode-and-toolchain.md`26+10. [Bytecode and Toolchain](mkdocs/src/manual/10-bytecode-and-toolchain.md)
27-11. `mkdocs/src/manual/11-memory-ordering-and-consistency.md`27+11. [Memory Ordering and Consistency](mkdocs/src/manual/11-memory-ordering-and-consistency.md)
28-12. `mkdocs/src/manual/12-backend-profiles-and-conformance.md`28+12. [Backend Profiles and Conformance](mkdocs/src/manual/12-backend-profiles-and-conformance.md)
29-13. `mkdocs/src/manual/appendix-a-glossary.md`29+13. [Appendix A: Glossary](mkdocs/src/manual/appendix-a-glossary.md)
30-14. `mkdocs/src/manual/appendix-b-instruction-contract-template.md`30+14. [Appendix B: Instruction Contract Template](mkdocs/src/manual/appendix-b-instruction-contract-template.md)
31-15. `mkdocs/src/manual/appendix-c-diagnostics-taxonomy.md`31+15. [Appendix C: Diagnostics Taxonomy](mkdocs/src/manual/appendix-c-diagnostics-taxonomy.md)
32-16. `mkdocs/src/manual/appendix-d-instruction-family-matrix.md`32+16. [Appendix D: Instruction Family Matrix](mkdocs/src/manual/appendix-d-instruction-family-matrix.md)
@@ -1,32 +1,32 @@
1# PTO 虚拟 ISA 手册1# PTO 虚拟 ISA 手册
2 2 
3本页是 PTO 虚拟指令集架构手册的稳定入口。3本页是 PTO 虚拟指令集架构手册的稳定入口。
4-章节化手册的权威来源维护在 `docs/mkdocs/src/manual/`。4+章节化手册的权威来源维护在 `manual/`。
5 5 
6## 主入口6## 主入口
7 7 
8-- 前言与阅读顺序:`mkdocs/src/manual/index_zh.md`8+- [前言与阅读顺序](mkdocs/src/manual/index_zh.md)
9-- 手册总览章节:`mkdocs/src/manual/01-overview_zh.md`9+- [手册总览章节](mkdocs/src/manual/01-overview_zh.md)
10-- 虚拟 ISA 与 IR 契约:`mkdocs/src/manual/09-virtual-isa-and-ir_zh.md`10+- [虚拟 ISA 与 IR 契约](mkdocs/src/manual/09-virtual-isa-and-ir_zh.md)
11-- 字节码与工具链契约:`mkdocs/src/manual/10-bytecode-and-toolchain_zh.md`11+- [字节码与工具链契约](mkdocs/src/manual/10-bytecode-and-toolchain_zh.md)
12-- 内存顺序与一致性:`mkdocs/src/manual/11-memory-ordering-and-consistency_zh.md`12+- [内存顺序与一致性](mkdocs/src/manual/11-memory-ordering-and-consistency_zh.md)
13-- 后端画像与一致性:`mkdocs/src/manual/12-backend-profiles-and-conformance_zh.md`13+- [后端画像与一致性](mkdocs/src/manual/12-backend-profiles-and-conformance_zh.md)
14 14 
15## 章节目录15## 章节目录
16 16 
17-1. `mkdocs/src/manual/01-overview_zh.md`17+1. [概述](mkdocs/src/manual/01-overview_zh.md)
18-2. `mkdocs/src/manual/02-machine-model_zh.md`18+2. [执行模型](mkdocs/src/manual/02-machine-model_zh.md)
19-3. `mkdocs/src/manual/03-state-and-types_zh.md`19+3. [状态与类型](mkdocs/src/manual/03-state-and-types_zh.md)
20-4. `mkdocs/src/manual/04-tiles-and-globaltensor_zh.md`20+4. [Tile 与 GlobalTensor](mkdocs/src/manual/04-tiles-and-globaltensor_zh.md)
21-5. `mkdocs/src/manual/05-synchronization_zh.md`21+5. [同步](mkdocs/src/manual/05-synchronization_zh.md)
22-6. `mkdocs/src/manual/06-assembly_zh.md`22+6. [PTO 汇编 (PTO-AS)](mkdocs/src/manual/06-assembly_zh.md)
23-7. `mkdocs/src/manual/07-instructions_zh.md`23+7. [指令集(概述)](mkdocs/src/manual/07-instructions_zh.md)
24-8. `mkdocs/src/manual/08-programming_zh.md`24+8. [编程指南](mkdocs/src/manual/08-programming_zh.md)
25-9. `mkdocs/src/manual/09-virtual-isa-and-ir_zh.md`25+9. [虚拟 ISA 与 IR](mkdocs/src/manual/09-virtual-isa-and-ir_zh.md)
26-10. `mkdocs/src/manual/10-bytecode-and-toolchain_zh.md`26+10. [字节码与工具链](mkdocs/src/manual/10-bytecode-and-toolchain_zh.md)
27-11. `mkdocs/src/manual/11-memory-ordering-and-consistency_zh.md`27+11. [内存顺序与一致性](mkdocs/src/manual/11-memory-ordering-and-consistency_zh.md)
28-12. `mkdocs/src/manual/12-backend-profiles-and-conformance_zh.md`28+12. [后端画像与一致性](mkdocs/src/manual/12-backend-profiles-and-conformance_zh.md)
29-13. `mkdocs/src/manual/appendix-a-glossary_zh.md`29+13. [附录 A:术语表](mkdocs/src/manual/appendix-a-glossary_zh.md)
30-14. `mkdocs/src/manual/appendix-b-instruction-contract-template_zh.md`30+14. [附录 B:指令契约模板](mkdocs/src/manual/appendix-b-instruction-contract-template_zh.md)
31-15. `mkdocs/src/manual/appendix-c-diagnostics-taxonomy_zh.md`31+15. [附录 C:诊断分类](mkdocs/src/manual/appendix-c-diagnostics-taxonomy_zh.md)
32-16. `mkdocs/src/manual/appendix-d-instruction-family-matrix_zh.md`32+16. [附录 D:指令族矩阵](mkdocs/src/manual/appendix-d-instruction-family-matrix_zh.md)
@@ -1,136 +1,136 @@
1-# PTO ISA 概述1+# PTO ISA 概述
2- 2+ 
3-本文档为根据 `docs/isa/manifest.yaml` 自动生成的 ISA 索引。3+本文档为根据 `docs/isa/manifest.yaml` 自动生成的 ISA 索引。
4- 4+ 
5-## 文档目录5+## 文档目录
6- 6+ 
7-| 领域 | 页面 | 描述 |7+| 领域 | 页面 | 描述 |
8-|---|---|---|8+|---|---|---|
9-| 概述 | [`docs/README_zh.md`](README_zh.md) | PTO ISA 指南入口与导航。 |9+| 概述 | [`docs/README_zh.md`](README_zh.md) | PTO ISA 指南入口与导航。 |
10-| 概述 | [`docs/PTOISA_zh.md`](PTOISA_zh.md) | 本页(概述 + 全量指令索引)。 |10+| 概述 | [`docs/PTOISA_zh.md`](PTOISA_zh.md) | 本页(概述 + 全量指令索引)。 |
11-| ISA 参考 | [`docs/isa/README_zh.md`](isa/README_zh.md) | 每条指令参考目录。 |11+| ISA 参考 | [`docs/isa/README_zh.md`](isa/README_zh.md) | 每条指令参考目录。 |
12-| ISA 参考 | [`docs/isa/conventions_zh.md`](isa/conventions_zh.md) | 通用符号、操作数、事件与修饰符。 |12+| ISA 参考 | [`docs/isa/conventions_zh.md`](isa/conventions_zh.md) | 通用符号、操作数、事件与修饰符。 |
13-| 汇编 (PTO-AS) | [`docs/grammar/PTO-AS_zh.md`](grammar/PTO-AS_zh.md) | PTO-AS 语法参考。 |13+| 汇编 (PTO-AS) | [`docs/grammar/PTO-AS_zh.md`](grammar/PTO-AS_zh.md) | PTO-AS 语法参考。 |
14-| 权威源 | [`include/pto/common/pto_instr.hpp`](reference/pto-intrinsics-header_zh.md) | C++ intrinsic API(权威来源)。 |14+| 权威源 | [`include/pto/common/pto_instr.hpp`](reference/pto-intrinsics-header_zh.md) | C++ intrinsic API(权威来源)。 |
15- 15+ 
16-## 指令索引(全部 PTO 指令)16+## 指令索引(全部 PTO 指令)
17- 17+ 
18-| 分类 | 指令 | 描述 |18+| 分类 | 指令 | 描述 |
19-|---|---|---|19+|---|---|---|
20-| 同步 | [`TSYNC`](isa/TSYNC_zh.md) | 同步 PTO 执行(等待事件或插入每操作流水线屏障)。 |20+| 同步 | [`TSYNC`](isa/TSYNC_zh.md) | 同步 PTO 执行(等待事件或插入每操作流水线屏障)。 |
21-| 手动 / 资源绑定 | [`TASSIGN`](isa/TASSIGN_zh.md) | 将 Tile 对象绑定到实现定义的片上地址(手动放置)。 |21+| 手动 / 资源绑定 | [`TASSIGN`](isa/TASSIGN_zh.md) | 将 Tile 对象绑定到实现定义的片上地址(手动放置)。 |
22-| 手动 / 资源绑定 | [`TSETHF32MODE`](isa/TSETHF32MODE_zh.md) | 设置 HF32 变换模式(实现定义)。 |22+| 手动 / 资源绑定 | [`TSETHF32MODE`](isa/TSETHF32MODE_zh.md) | 设置 HF32 变换模式(实现定义)。 |
23-| 手动 / 资源绑定 | [`TSETTF32MODE`](isa/TSETTF32MODE_zh.md) | 设置 TF32 变换模式(实现定义)。 |23+| 手动 / 资源绑定 | [`TSETTF32MODE`](isa/TSETTF32MODE_zh.md) | 设置 TF32 变换模式(实现定义)。 |
24-| 手动 / 资源绑定 | [`TSETFMATRIX`](isa/TSETFMATRIX_zh.md) | 为类 IMG2COL 操作设置 FMATRIX 寄存器。 |24+| 手动 / 资源绑定 | [`TSETFMATRIX`](isa/TSETFMATRIX_zh.md) | 为类 IMG2COL 操作设置 FMATRIX 寄存器。 |
25-| 手动 / 资源绑定 | [`TSET_IMG2COL_RPT`](isa/TSET_IMG2COL_RPT_zh.md) | 从 IMG2COL 配置 Tile 设置 IMG2COL 重复次数元数据。 |25+| 手动 / 资源绑定 | [`TSET_IMG2COL_RPT`](isa/TSET_IMG2COL_RPT_zh.md) | 从 IMG2COL 配置 Tile 设置 IMG2COL 重复次数元数据。 |
26-| 手动 / 资源绑定 | [`TSET_IMG2COL_PADDING`](isa/TSET_IMG2COL_PADDING_zh.md) | 从 IMG2COL 配置 Tile 设置 IMG2COL 填充元数据。 |26+| 手动 / 资源绑定 | [`TSET_IMG2COL_PADDING`](isa/TSET_IMG2COL_PADDING_zh.md) | 从 IMG2COL 配置 Tile 设置 IMG2COL 填充元数据。 |
27-| 逐元素(Tile-Tile) | [`TADD`](isa/TADD_zh.md) | 两个 Tile 的逐元素加法。 |27+| 逐元素(Tile-Tile) | [`TADD`](isa/TADD_zh.md) | 两个 Tile 的逐元素加法。 |
28-| 逐元素(Tile-Tile) | [`TABS`](isa/TABS_zh.md) | Tile 的逐元素绝对值。 |28+| 逐元素(Tile-Tile) | [`TABS`](isa/TABS_zh.md) | Tile 的逐元素绝对值。 |
29-| 逐元素(Tile-Tile) | [`TAND`](isa/TAND_zh.md) | 两个 Tile 的逐元素按位与。 |29+| 逐元素(Tile-Tile) | [`TAND`](isa/TAND_zh.md) | 两个 Tile 的逐元素按位与。 |
30-| 逐元素(Tile-Tile) | [`TOR`](isa/TOR_zh.md) | 两个 Tile 的逐元素按位或。 |30+| 逐元素(Tile-Tile) | [`TOR`](isa/TOR_zh.md) | 两个 Tile 的逐元素按位或。 |
31-| 逐元素(Tile-Tile) | [`TSUB`](isa/TSUB_zh.md) | 两个 Tile 的逐元素减法。 |31+| 逐元素(Tile-Tile) | [`TSUB`](isa/TSUB_zh.md) | 两个 Tile 的逐元素减法。 |
32-| 逐元素(Tile-Tile) | [`TMUL`](isa/TMUL_zh.md) | 两个 Tile 的逐元素乘法。 |32+| 逐元素(Tile-Tile) | [`TMUL`](isa/TMUL_zh.md) | 两个 Tile 的逐元素乘法。 |
33-| 逐元素(Tile-Tile) | [`TMIN`](isa/TMIN_zh.md) | 两个 Tile 的逐元素最小值。 |33+| 逐元素(Tile-Tile) | [`TMIN`](isa/TMIN_zh.md) | 两个 Tile 的逐元素最小值。 |
34-| 逐元素(Tile-Tile) | [`TMAX`](isa/TMAX_zh.md) | 两个 Tile 的逐元素最大值。 |34+| 逐元素(Tile-Tile) | [`TMAX`](isa/TMAX_zh.md) | 两个 Tile 的逐元素最大值。 |
35-| 逐元素(Tile-Tile) | [`TCMP`](isa/TCMP_zh.md) | 比较两个 Tile 并写入一个打包的谓词掩码。 |35+| 逐元素(Tile-Tile) | [`TCMP`](isa/TCMP_zh.md) | 比较两个 Tile 并写入一个打包的谓词掩码。 |
36-| 逐元素(Tile-Tile) | [`TDIV`](isa/TDIV_zh.md) | 两个 Tile 的逐元素除法。 |36+| 逐元素(Tile-Tile) | [`TDIV`](isa/TDIV_zh.md) | 两个 Tile 的逐元素除法。 |
37-| 逐元素(Tile-Tile) | [`TSHL`](isa/TSHL_zh.md) | 两个 Tile 的逐元素左移。 |37+| 逐元素(Tile-Tile) | [`TSHL`](isa/TSHL_zh.md) | 两个 Tile 的逐元素左移。 |
38-| 逐元素(Tile-Tile) | [`TSHR`](isa/TSHR_zh.md) | 两个 Tile 的逐元素右移。 |38+| 逐元素(Tile-Tile) | [`TSHR`](isa/TSHR_zh.md) | 两个 Tile 的逐元素右移。 |
39-| 逐元素(Tile-Tile) | [`TXOR`](isa/TXOR_zh.md) | 两个 Tile 的逐元素按位异或。 |39+| 逐元素(Tile-Tile) | [`TXOR`](isa/TXOR_zh.md) | 两个 Tile 的逐元素按位异或。 |
40-| 逐元素(Tile-Tile) | [`TLOG`](isa/TLOG_zh.md) | Tile 的逐元素自然对数。 |40+| 逐元素(Tile-Tile) | [`TLOG`](isa/TLOG_zh.md) | Tile 的逐元素自然对数。 |
41-| 逐元素(Tile-Tile) | [`TRECIP`](isa/TRECIP_zh.md) | Tile 的逐元素倒数。 |41+| 逐元素(Tile-Tile) | [`TRECIP`](isa/TRECIP_zh.md) | Tile 的逐元素倒数。 |
42-| 逐元素(Tile-Tile) | [`TPRELU`](isa/TPRELU_zh.md) | 带逐元素斜率 Tile 的逐元素参数化 ReLU (PReLU)。 |42+| 逐元素(Tile-Tile) | [`TPRELU`](isa/TPRELU_zh.md) | 带逐元素斜率 Tile 的逐元素参数化 ReLU (PReLU)。 |
43-| 逐元素(Tile-Tile) | [`TADDC`](isa/TADDC_zh.md) | 三元逐元素加法:`src0 + src1 + src2`。 |43+| 逐元素(Tile-Tile) | [`TADDC`](isa/TADDC_zh.md) | 三元逐元素加法:`src0 + src1 + src2`。 |
44-| 逐元素(Tile-Tile) | [`TSUBC`](isa/TSUBC_zh.md) | 三元逐元素运算:`src0 - src1 + src2`。 |44+| 逐元素(Tile-Tile) | [`TSUBC`](isa/TSUBC_zh.md) | 三元逐元素运算:`src0 - src1 + src2`。 |
45-| 逐元素(Tile-Tile) | [`TCVT`](isa/TCVT_zh.md) | 带指定舍入模式的逐元素类型转换。 |45+| 逐元素(Tile-Tile) | [`TCVT`](isa/TCVT_zh.md) | 带指定舍入模式的逐元素类型转换。 |
46-| 逐元素(Tile-Tile) | [`TSEL`](isa/TSEL_zh.md) | 使用掩码 Tile 在两个 Tile 之间进行选择(逐元素选择)。 |46+| 逐元素(Tile-Tile) | [`TSEL`](isa/TSEL_zh.md) | 使用掩码 Tile 在两个 Tile 之间进行选择(逐元素选择)。 |
47-| 逐元素(Tile-Tile) | [`TRSQRT`](isa/TRSQRT_zh.md) | 逐元素倒数平方根。 |47+| 逐元素(Tile-Tile) | [`TRSQRT`](isa/TRSQRT_zh.md) | 逐元素倒数平方根。 |
48-| 逐元素(Tile-Tile) | [`TSQRT`](isa/TSQRT_zh.md) | 逐元素平方根。 |48+| 逐元素(Tile-Tile) | [`TSQRT`](isa/TSQRT_zh.md) | 逐元素平方根。 |
49-| 逐元素(Tile-Tile) | [`TEXP`](isa/TEXP_zh.md) | 逐元素指数运算。 |49+| 逐元素(Tile-Tile) | [`TEXP`](isa/TEXP_zh.md) | 逐元素指数运算。 |
50-| 逐元素(Tile-Tile) | [`TNOT`](isa/TNOT_zh.md) | Tile 的逐元素按位取反。 |50+| 逐元素(Tile-Tile) | [`TNOT`](isa/TNOT_zh.md) | Tile 的逐元素按位取反。 |
51-| 逐元素(Tile-Tile) | [`TRELU`](isa/TRELU_zh.md) | Tile 的逐元素 ReLU。 |51+| 逐元素(Tile-Tile) | [`TRELU`](isa/TRELU_zh.md) | Tile 的逐元素 ReLU。 |
52-| 逐元素(Tile-Tile) | [`TNEG`](isa/TNEG_zh.md) | Tile 的逐元素取负。 |52+| 逐元素(Tile-Tile) | [`TNEG`](isa/TNEG_zh.md) | Tile 的逐元素取负。 |
53-| 逐元素(Tile-Tile) | [`TREM`](isa/TREM_zh.md) | 两个 Tile 的逐元素余数,余数符号与除数相同。 |53+| 逐元素(Tile-Tile) | [`TREM`](isa/TREM_zh.md) | 两个 Tile 的逐元素余数,余数符号与除数相同。 |
54-| 逐元素(Tile-Tile) | [`TFMOD`](isa/TFMOD_zh.md) | 两个 Tile 的逐元素余数,余数符号与被除数相同。 |54+| 逐元素(Tile-Tile) | [`TFMOD`](isa/TFMOD_zh.md) | 两个 Tile 的逐元素余数,余数符号与被除数相同。 |
55-| Tile-标量 / Tile-立即数 | [`TEXPANDS`](isa/TEXPANDS_zh.md) | 将标量广播到目标 Tile 中。 |55+| Tile-标量 / Tile-立即数 | [`TEXPANDS`](isa/TEXPANDS_zh.md) | 将标量广播到目标 Tile 中。 |
56-| Tile-标量 / Tile-立即数 | [`TCMPS`](isa/TCMPS_zh.md) | 将 Tile 与标量比较并写入逐元素比较结果。 |56+| Tile-标量 / Tile-立即数 | [`TCMPS`](isa/TCMPS_zh.md) | 将 Tile 与标量比较并写入逐元素比较结果。 |
57-| Tile-标量 / Tile-立即数 | [`TSELS`](isa/TSELS_zh.md) | 使用掩码Tile在源Tile和标量之间进行选择(源Tile逐元素选择)。 |57+| Tile-标量 / Tile-立即数 | [`TSELS`](isa/TSELS_zh.md) | 使用掩码Tile在源Tile和标量之间进行选择(源Tile逐元素选择)。 |
58-| Tile-标量 / Tile-立即数 | [`TMINS`](isa/TMINS_zh.md) | Tile 与标量的逐元素最小值。 |58+| Tile-标量 / Tile-立即数 | [`TMINS`](isa/TMINS_zh.md) | Tile 与标量的逐元素最小值。 |
59-| Tile-标量 / Tile-立即数 | [`TADDS`](isa/TADDS_zh.md) | Tile 与标量的逐元素加法。 |59+| Tile-标量 / Tile-立即数 | [`TADDS`](isa/TADDS_zh.md) | Tile 与标量的逐元素加法。 |
60-| Tile-标量 / Tile-立即数 | [`TSUBS`](isa/TSUBS_zh.md) | 从 Tile 中逐元素减去一个标量。 |60+| Tile-标量 / Tile-立即数 | [`TSUBS`](isa/TSUBS_zh.md) | 从 Tile 中逐元素减去一个标量。 |
61-| Tile-标量 / Tile-立即数 | [`TDIVS`](isa/TDIVS_zh.md) | 与标量的逐元素除法(Tile/标量 或 标量/Tile)。 |61+| Tile-标量 / Tile-立即数 | [`TDIVS`](isa/TDIVS_zh.md) | 与标量的逐元素除法(Tile/标量 或 标量/Tile)。 |
62-| Tile-标量 / Tile-立即数 | [`TMULS`](isa/TMULS_zh.md) | Tile 与标量的逐元素乘法。 |62+| Tile-标量 / Tile-立即数 | [`TMULS`](isa/TMULS_zh.md) | Tile 与标量的逐元素乘法。 |
63-| Tile-标量 / Tile-立即数 | [`TFMODS`](isa/TFMODS_zh.md) | 与标量的逐元素余数:`fmod(src, scalar)`。 |63+| Tile-标量 / Tile-立即数 | [`TFMODS`](isa/TFMODS_zh.md) | 与标量的逐元素余数:`fmod(src, scalar)`。 |
64-| Tile-标量 / Tile-立即数 | [`TREMS`](isa/TREMS_zh.md) | 与标量的逐元素余数:`remainder(src, scalar)`。 |64+| Tile-标量 / Tile-立即数 | [`TREMS`](isa/TREMS_zh.md) | 与标量的逐元素余数:`remainder(src, scalar)`。 |
65-| Tile-标量 / Tile-立即数 | [`TMAXS`](isa/TMAXS_zh.md) | Tile 与标量的逐元素最大值:`max(src, scalar)`。 |65+| Tile-标量 / Tile-立即数 | [`TMAXS`](isa/TMAXS_zh.md) | Tile 与标量的逐元素最大值:`max(src, scalar)`。 |
66-| Tile-标量 / Tile-立即数 | [`TANDS`](isa/TANDS_zh.md) | Tile 与标量的逐元素按位与。 |66+| Tile-标量 / Tile-立即数 | [`TANDS`](isa/TANDS_zh.md) | Tile 与标量的逐元素按位与。 |
67-| Tile-标量 / Tile-立即数 | [`TORS`](isa/TORS_zh.md) | Tile 与标量的逐元素按位或。 |67+| Tile-标量 / Tile-立即数 | [`TORS`](isa/TORS_zh.md) | Tile 与标量的逐元素按位或。 |
68-| Tile-标量 / Tile-立即数 | [`TSHLS`](isa/TSHLS_zh.md) | Tile 按标量逐元素左移。 |68+| Tile-标量 / Tile-立即数 | [`TSHLS`](isa/TSHLS_zh.md) | Tile 按标量逐元素左移。 |
69-| Tile-标量 / Tile-立即数 | [`TSHRS`](isa/TSHRS_zh.md) | Tile 按标量逐元素右移。 |69+| Tile-标量 / Tile-立即数 | [`TSHRS`](isa/TSHRS_zh.md) | Tile 按标量逐元素右移。 |
70-| Tile-标量 / Tile-立即数 | [`TXORS`](isa/TXORS_zh.md) | Tile 与标量的逐元素按位异或。 |70+| Tile-标量 / Tile-立即数 | [`TXORS`](isa/TXORS_zh.md) | Tile 与标量的逐元素按位异或。 |
71-| Tile-标量 / Tile-立即数 | [`TLRELU`](isa/TLRELU_zh.md) | 带标量斜率的 Leaky ReLU。 |71+| Tile-标量 / Tile-立即数 | [`TLRELU`](isa/TLRELU_zh.md) | 带标量斜率的 Leaky ReLU。 |
72-| Tile-标量 / Tile-立即数 | [`TADDSC`](isa/TADDSC_zh.md) | 与标量和第二个 Tile 的融合逐元素加法:`src0 + scalar + src1`。 |72+| Tile-标量 / Tile-立即数 | [`TADDSC`](isa/TADDSC_zh.md) | 与标量和第二个 Tile 的融合逐元素加法:`src0 + scalar + src1`。 |
73-| Tile-标量 / Tile-立即数 | [`TSUBSC`](isa/TSUBSC_zh.md) | 融合逐元素运算:`src0 - scalar + src1`。 |73+| Tile-标量 / Tile-立即数 | [`TSUBSC`](isa/TSUBSC_zh.md) | 融合逐元素运算:`src0 - scalar + src1`。 |
74-| 轴归约 / 扩展 | [`TROWSUM`](isa/TROWSUM_zh.md) | 通过对列求和来归约每一行。 |74+| 轴归约 / 扩展 | [`TROWSUM`](isa/TROWSUM_zh.md) | 通过对列求和来归约每一行。 |
75-| 轴归约 / 扩展 | [`TROWPROD`](isa/TROWPROD_zh.md) | 通过跨列乘积来归约每一行。 |75+| 轴归约 / 扩展 | [`TROWPROD`](isa/TROWPROD_zh.md) | 通过跨列乘积来归约每一行。 |
76-| 轴归约 / 扩展 | [`TCOLSUM`](isa/TCOLSUM_zh.md) | 通过对行求和来归约每一列。 |76+| 轴归约 / 扩展 | [`TCOLSUM`](isa/TCOLSUM_zh.md) | 通过对行求和来归约每一列。 |
77-| 轴归约 / 扩展 | [`TCOLPROD`](isa/TCOLPROD_zh.md) | 通过跨行乘积来归约每一列。 |77+| 轴归约 / 扩展 | [`TCOLPROD`](isa/TCOLPROD_zh.md) | 通过跨行乘积来归约每一列。 |
78-| 轴归约 / 扩展 | [`TCOLMAX`](isa/TCOLMAX_zh.md) | 通过取行间最大值来归约每一列。 |78+| 轴归约 / 扩展 | [`TCOLMAX`](isa/TCOLMAX_zh.md) | 通过取行间最大值来归约每一列。 |
79-| 轴归约 / 扩展 | [`TROWMAX`](isa/TROWMAX_zh.md) | 通过取列间最大值来归约每一行。 |79+| 轴归约 / 扩展 | [`TROWMAX`](isa/TROWMAX_zh.md) | 通过取列间最大值来归约每一行。 |
80-| 轴归约 / 扩展 | [`TROWMIN`](isa/TROWMIN_zh.md) | 通过取列间最小值来归约每一行。 |80+| 轴归约 / 扩展 | [`TROWMIN`](isa/TROWMIN_zh.md) | 通过取列间最小值来归约每一行。 |
81-| 轴归约 / 扩展 | [`TROWEXPAND`](isa/TROWEXPAND_zh.md) | 将每个源行的第一个元素广播到目标行中。 |81+| 轴归约 / 扩展 | [`TROWEXPAND`](isa/TROWEXPAND_zh.md) | 将每个源行的第一个元素广播到目标行中。 |
82-| 轴归约 / 扩展 | [`TROWEXPANDDIV`](isa/TROWEXPANDDIV_zh.md) | 行广播除法:将 `src0` 的每一行除以一个每行标量向量 `src1`。 |82+| 轴归约 / 扩展 | [`TROWEXPANDDIV`](isa/TROWEXPANDDIV_zh.md) | 行广播除法:将 `src0` 的每一行除以一个每行标量向量 `src1`。 |
83-| 轴归约 / 扩展 | [`TROWEXPANDMUL`](isa/TROWEXPANDMUL_zh.md) | 行广播乘法:将 `src0` 的每一行乘以一个每行标量向量 `src1`。 |83+| 轴归约 / 扩展 | [`TROWEXPANDMUL`](isa/TROWEXPANDMUL_zh.md) | 行广播乘法:将 `src0` 的每一行乘以一个每行标量向量 `src1`。 |
84-| 轴归约 / 扩展 | [`TROWEXPANDSUB`](isa/TROWEXPANDSUB_zh.md) | 行广播减法:从 `src0` 的每一行中减去一个每行标量向量 `src1`。 |84+| 轴归约 / 扩展 | [`TROWEXPANDSUB`](isa/TROWEXPANDSUB_zh.md) | 行广播减法:从 `src0` 的每一行中减去一个每行标量向量 `src1`。 |
85-| 轴归约 / 扩展 | [`TROWEXPANDADD`](isa/TROWEXPANDADD_zh.md) | 行广播加法:加上一个每行标量向量。 |85+| 轴归约 / 扩展 | [`TROWEXPANDADD`](isa/TROWEXPANDADD_zh.md) | 行广播加法:加上一个每行标量向量。 |
86-| 轴归约 / 扩展 | [`TROWEXPANDMAX`](isa/TROWEXPANDMAX_zh.md) | 行广播最大值:与每行标量向量取最大值。 |86+| 轴归约 / 扩展 | [`TROWEXPANDMAX`](isa/TROWEXPANDMAX_zh.md) | 行广播最大值:与每行标量向量取最大值。 |
87-| 轴归约 / 扩展 | [`TROWEXPANDMIN`](isa/TROWEXPANDMIN_zh.md) | 行广播最小值:与每行标量向量取最小值。 |87+| 轴归约 / 扩展 | [`TROWEXPANDMIN`](isa/TROWEXPANDMIN_zh.md) | 行广播最小值:与每行标量向量取最小值。 |
88-| 轴归约 / 扩展 | [`TROWEXPANDEXPDIF`](isa/TROWEXPANDEXPDIF_zh.md) | 行指数差运算:计算 exp(src0 - src1),其中 src1 为每行标量。 |88+| 轴归约 / 扩展 | [`TROWEXPANDEXPDIF`](isa/TROWEXPANDEXPDIF_zh.md) | 行指数差运算:计算 exp(src0 - src1),其中 src1 为每行标量。 |
89-| 轴归约 / 扩展 | [`TCOLMIN`](isa/TCOLMIN_zh.md) | 通过取行间最小值来归约每一列。 |89+| 轴归约 / 扩展 | [`TCOLMIN`](isa/TCOLMIN_zh.md) | 通过取行间最小值来归约每一列。 |
90-| 轴归约 / 扩展 | [`TCOLEXPAND`](isa/TCOLEXPAND_zh.md) | 将每个源列的第一个元素广播到目标列中。 |90+| 轴归约 / 扩展 | [`TCOLEXPAND`](isa/TCOLEXPAND_zh.md) | 将每个源列的第一个元素广播到目标列中。 |
91-| 轴归约 / 扩展 | [`TCOLEXPANDDIV`](isa/TCOLEXPANDDIV_zh.md) | 列广播除法:将每一列除以一个每列标量向量。 |91+| 轴归约 / 扩展 | [`TCOLEXPANDDIV`](isa/TCOLEXPANDDIV_zh.md) | 列广播除法:将每一列除以一个每列标量向量。 |
92-| 轴归约 / 扩展 | [`TCOLEXPANDMUL`](isa/TCOLEXPANDMUL_zh.md) | 列广播乘法:将每一列乘以一个每列标量向量。 |92+| 轴归约 / 扩展 | [`TCOLEXPANDMUL`](isa/TCOLEXPANDMUL_zh.md) | 列广播乘法:将每一列乘以一个每列标量向量。 |
93-| 轴归约 / 扩展 | [`TCOLEXPANDADD`](isa/TCOLEXPANDADD_zh.md) | 列广播加法:对每一列加上每列标量向量。 |93+| 轴归约 / 扩展 | [`TCOLEXPANDADD`](isa/TCOLEXPANDADD_zh.md) | 列广播加法:对每一列加上每列标量向量。 |
94-| 轴归约 / 扩展 | [`TCOLEXPANDMAX`](isa/TCOLEXPANDMAX_zh.md) | 列广播最大值:与每列标量向量取最大值。 |94+| 轴归约 / 扩展 | [`TCOLEXPANDMAX`](isa/TCOLEXPANDMAX_zh.md) | 列广播最大值:与每列标量向量取最大值。 |
95-| 轴归约 / 扩展 | [`TCOLEXPANDMIN`](isa/TCOLEXPANDMIN_zh.md) | 列广播最小值:与每列标量向量取最小值。 |95+| 轴归约 / 扩展 | [`TCOLEXPANDMIN`](isa/TCOLEXPANDMIN_zh.md) | 列广播最小值:与每列标量向量取最小值。 |
96-| 轴归约 / 扩展 | [`TCOLEXPANDSUB`](isa/TCOLEXPANDSUB_zh.md) | 列广播减法:从每一列中减去一个每列标量向量。 |96+| 轴归约 / 扩展 | [`TCOLEXPANDSUB`](isa/TCOLEXPANDSUB_zh.md) | 列广播减法:从每一列中减去一个每列标量向量。 |
97-| 轴归约 / 扩展 | [`TCOLEXPANDEXPDIF`](isa/TCOLEXPANDEXPDIF_zh.md) | 列指数差运算:计算 exp(src0 - src1),其中 src1 为每列标量。 |97+| 轴归约 / 扩展 | [`TCOLEXPANDEXPDIF`](isa/TCOLEXPANDEXPDIF_zh.md) | 列指数差运算:计算 exp(src0 - src1),其中 src1 为每列标量。 |
98-| 内存(GM <-> Tile) | [`TLOAD`](isa/TLOAD_zh.md) | 从 GlobalTensor (GM) 加载数据到 Tile。 |98+| 内存(GM <-> Tile) | [`TLOAD`](isa/TLOAD_zh.md) | 从 GlobalTensor (GM) 加载数据到 Tile。 |
99-| 内存(GM <-> Tile) | [`TPREFETCH`](isa/TPREFETCH_zh.md) | 将数据从全局内存预取到 Tile 本地缓存/缓冲区(提示)。 |99+| 内存(GM <-> Tile) | [`TPREFETCH`](isa/TPREFETCH_zh.md) | 将数据从全局内存预取到 Tile 本地缓存/缓冲区(提示)。 |
100-| 内存(GM <-> Tile) | [`TSTORE`](isa/TSTORE_zh.md) | 将 Tile 中的数据存储到 GlobalTensor (GM),可选使用原子写入或量化参数。 |100+| 内存(GM <-> Tile) | [`TSTORE`](isa/TSTORE_zh.md) | 将 Tile 中的数据存储到 GlobalTensor (GM),可选使用原子写入或量化参数。 |
101-| 内存(GM <-> Tile) | [`TSTORE_FP`](isa/TSTORE_FP_zh.md) | 使用缩放 (`fp`) Tile 作为向量量化参数,将累加器 Tile 存储到全局内存。 |101+| 内存(GM <-> Tile) | [`TSTORE_FP`](isa/TSTORE_FP_zh.md) | 使用缩放 (`fp`) Tile 作为向量量化参数,将累加器 Tile 存储到全局内存。 |
102-| 内存(GM <-> Tile) | [`MGATHER`](isa/MGATHER_zh.md) | 使用逐元素索引从全局内存收集加载元素到 Tile 中。 |102+| 内存(GM <-> Tile) | [`MGATHER`](isa/MGATHER_zh.md) | 使用逐元素索引从全局内存收集加载元素到 Tile 中。 |
103-| 内存(GM <-> Tile) | [`MSCATTER`](isa/MSCATTER_zh.md) | 使用逐元素索引将 Tile 中的元素散播存储到全局内存。 |103+| 内存(GM <-> Tile) | [`MSCATTER`](isa/MSCATTER_zh.md) | 使用逐元素索引将 Tile 中的元素散播存储到全局内存。 |
104-| 矩阵乘 | [`TGEMV_MX`](isa/TGEMV_MX_zh.md) | 带缩放 Tile 的 GEMV 变体,支持混合精度/量化矩阵向量计算。 |104+| 矩阵乘 | [`TGEMV_MX`](isa/TGEMV_MX_zh.md) | 带缩放 Tile 的 GEMV 变体,支持混合精度/量化矩阵向量计算。 |
105-| 矩阵乘 | [`TMATMUL_MX`](isa/TMATMUL_MX_zh.md) | 带额外缩放 Tile 的矩阵乘法 (GEMM),用于支持目标上的混合精度/量化矩阵乘法。 |105+| 矩阵乘 | [`TMATMUL_MX`](isa/TMATMUL_MX_zh.md) | 带额外缩放 Tile 的矩阵乘法 (GEMM),用于支持目标上的混合精度/量化矩阵乘法。 |
106-| 矩阵乘 | [`TMATMUL`](isa/TMATMUL_zh.md) | 矩阵乘法 (GEMM),生成累加器/输出 Tile。 |106+| 矩阵乘 | [`TMATMUL`](isa/TMATMUL_zh.md) | 矩阵乘法 (GEMM),生成累加器/输出 Tile。 |
107-| 矩阵乘 | [`TMATMUL_ACC`](isa/TMATMUL_ACC_zh.md) | 带累加器输入的矩阵乘法(融合累加)。 |107+| 矩阵乘 | [`TMATMUL_ACC`](isa/TMATMUL_ACC_zh.md) | 带累加器输入的矩阵乘法(融合累加)。 |
108-| 矩阵乘 | [`TMATMUL_BIAS`](isa/TMATMUL_BIAS_zh.md) | 带偏置加法的矩阵乘法。 |108+| 矩阵乘 | [`TMATMUL_BIAS`](isa/TMATMUL_BIAS_zh.md) | 带偏置加法的矩阵乘法。 |
109-| 矩阵乘 | [`TGEMV`](isa/TGEMV_zh.md) | 通用矩阵-向量乘法,生成累加器/输出 Tile。 |109+| 矩阵乘 | [`TGEMV`](isa/TGEMV_zh.md) | 通用矩阵-向量乘法,生成累加器/输出 Tile。 |
110-| 矩阵乘 | [`TGEMV_ACC`](isa/TGEMV_ACC_zh.md) | 带显式累加器输入/输出 Tile 的 GEMV。 |110+| 矩阵乘 | [`TGEMV_ACC`](isa/TGEMV_ACC_zh.md) | 带显式累加器输入/输出 Tile 的 GEMV。 |
111-| 矩阵乘 | [`TGEMV_BIAS`](isa/TGEMV_BIAS_zh.md) | 带偏置加法的 GEMV。 |111+| 矩阵乘 | [`TGEMV_BIAS`](isa/TGEMV_BIAS_zh.md) | 带偏置加法的 GEMV。 |
112-| 数据搬运 / 布局 | [`TEXTRACT`](isa/TEXTRACT_zh.md) | 从源 Tile 中提取子 Tile。 |112+| 数据搬运 / 布局 | [`TEXTRACT`](isa/TEXTRACT_zh.md) | 从源 Tile 中提取子 Tile。 |
113-| 数据搬运 / 布局 | [`TEXTRACT_FP`](isa/TEXTRACT_FP_zh.md) | 带 fp/缩放 Tile 的提取(向量量化参数)。 |113+| 数据搬运 / 布局 | [`TEXTRACT_FP`](isa/TEXTRACT_FP_zh.md) | 带 fp/缩放 Tile 的提取(向量量化参数)。 |
114-| 数据搬运 / 布局 | [`TIMG2COL`](isa/TIMG2COL_zh.md) | 用于类卷积工作负载的图像到列变换。 |114+| 数据搬运 / 布局 | [`TIMG2COL`](isa/TIMG2COL_zh.md) | 用于类卷积工作负载的图像到列变换。 |
115-| 数据搬运 / 布局 | [`TINSERT`](isa/TINSERT_zh.md) | 在 (indexRow, indexCol) 偏移处将子 Tile 插入到目标 Tile 中。 |115+| 数据搬运 / 布局 | [`TINSERT`](isa/TINSERT_zh.md) | 在 (indexRow, indexCol) 偏移处将子 Tile 插入到目标 Tile 中。 |
116-| 数据搬运 / 布局 | [`TINSERT_FP`](isa/TINSERT_FP_zh.md) | 带 fp/缩放 Tile 的插入(向量量化参数)。 |116+| 数据搬运 / 布局 | [`TINSERT_FP`](isa/TINSERT_FP_zh.md) | 带 fp/缩放 Tile 的插入(向量量化参数)。 |
117-| 数据搬运 / 布局 | [`TFILLPAD`](isa/TFILLPAD_zh.md) | 复制 Tile 并在有效区域外使用编译时填充值进行填充。 |117+| 数据搬运 / 布局 | [`TFILLPAD`](isa/TFILLPAD_zh.md) | 复制 Tile 并在有效区域外使用编译时填充值进行填充。 |
118-| 数据搬运 / 布局 | [`TFILLPAD_INPLACE`](isa/TFILLPAD_INPLACE_zh.md) | 原地填充/填充变体。 |118+| 数据搬运 / 布局 | [`TFILLPAD_INPLACE`](isa/TFILLPAD_INPLACE_zh.md) | 原地填充/填充变体。 |
119-| 数据搬运 / 布局 | [`TFILLPAD_EXPAND`](isa/TFILLPAD_EXPAND_zh.md) | 填充/填充时允许目标大于源。 |119+| 数据搬运 / 布局 | [`TFILLPAD_EXPAND`](isa/TFILLPAD_EXPAND_zh.md) | 填充/填充时允许目标大于源。 |
120-| 数据搬运 / 布局 | [`TMOV`](isa/TMOV_zh.md) | 在 Tile 之间移动/复制,可选应用实现定义的转换模式。 |120+| 数据搬运 / 布局 | [`TMOV`](isa/TMOV_zh.md) | 在 Tile 之间移动/复制,可选应用实现定义的转换模式。 |
121-| 数据搬运 / 布局 | [`TMOV_FP`](isa/TMOV_FP_zh.md) | 使用缩放 (`fp`) Tile 作为向量量化参数,将累加器 Tile 移动/转换到目标 Tile。 |121+| 数据搬运 / 布局 | [`TMOV_FP`](isa/TMOV_FP_zh.md) | 使用缩放 (`fp`) Tile 作为向量量化参数,将累加器 Tile 移动/转换到目标 Tile。 |
122-| 数据搬运 / 布局 | [`TRESHAPE`](isa/TRESHAPE_zh.md) | 将 Tile 重新解释为另一种 Tile 类型/形状,同时保留底层字节。 |122+| 数据搬运 / 布局 | [`TRESHAPE`](isa/TRESHAPE_zh.md) | 将 Tile 重新解释为另一种 Tile 类型/形状,同时保留底层字节。 |
123-| 数据搬运 / 布局 | [`TTRANS`](isa/TTRANS_zh.md) | 使用实现定义的临时 Tile 进行转置。 |123+| 数据搬运 / 布局 | [`TTRANS`](isa/TTRANS_zh.md) | 使用实现定义的临时 Tile 进行转置。 |
124-| 复杂指令 | [`TPRINT`](isa/TPRINT_zh.md) | 调试/打印 Tile 中的元素(实现定义)。 |124+| 复杂指令 | [`TPRINT`](isa/TPRINT_zh.md) | 调试/打印 Tile 中的元素(实现定义)。 |
125-| 复杂指令 | [`TMRGSORT`](isa/TMRGSORT_zh.md) | 用于多个已排序列表的归并排序(实现定义的元素格式和布局)。 |125+| 复杂指令 | [`TMRGSORT`](isa/TMRGSORT_zh.md) | 用于多个已排序列表的归并排序(实现定义的元素格式和布局)。 |
126-| 复杂指令 | [`TSORT32`](isa/TSORT32_zh.md) | 对固定大小的 32 元素块进行排序并生成索引映射。 |126+| 复杂指令 | [`TSORT32`](isa/TSORT32_zh.md) | 对固定大小的 32 元素块进行排序并生成索引映射。 |
127-| 复杂指令 | [`TGATHER`](isa/TGATHER_zh.md) | 使用索引 Tile 或编译时掩码模式来收集/选择元素。 |127+| 复杂指令 | [`TGATHER`](isa/TGATHER_zh.md) | 使用索引 Tile 或编译时掩码模式来收集/选择元素。 |
128-| 复杂指令 | [`TCI`](isa/TCI_zh.md) | 生成连续整数序列到目标 Tile 中。 |128+| 复杂指令 | [`TCI`](isa/TCI_zh.md) | 生成连续整数序列到目标 Tile 中。 |
129-| 复杂指令 | [`TTRI`](isa/TTRI_zh.md) | 生成三角(下/上)掩码 Tile。 |129+| 复杂指令 | [`TTRI`](isa/TTRI_zh.md) | 生成三角(下/上)掩码 Tile。 |
130-| 复杂指令 | [`TPARTADD`](isa/TPARTADD_zh.md) | 部分逐元素加法,对不匹配的有效区域具有实现定义的处理方式。 |130+| 复杂指令 | [`TPARTADD`](isa/TPARTADD_zh.md) | 部分逐元素加法,对不匹配的有效区域具有实现定义的处理方式。 |
131-| 复杂指令 | [`TPARTMUL`](isa/TPARTMUL_zh.md) | 部分逐元素乘法,对有效区域不一致的处理为实现定义。 |131+| 复杂指令 | [`TPARTMUL`](isa/TPARTMUL_zh.md) | 部分逐元素乘法,对有效区域不一致的处理为实现定义。 |
132-| 复杂指令 | [`TPARTMAX`](isa/TPARTMAX_zh.md) | 部分逐元素最大值,对不匹配的有效区域具有实现定义的处理方式。 |132+| 复杂指令 | [`TPARTMAX`](isa/TPARTMAX_zh.md) | 部分逐元素最大值,对不匹配的有效区域具有实现定义的处理方式。 |
133-| 复杂指令 | [`TPARTMIN`](isa/TPARTMIN_zh.md) | 部分逐元素最小值,对不匹配的有效区域具有实现定义的处理方式。 |133+| 复杂指令 | [`TPARTMIN`](isa/TPARTMIN_zh.md) | 部分逐元素最小值,对不匹配的有效区域具有实现定义的处理方式。 |
134-| 复杂指令 | [`TGATHERB`](isa/TGATHERB_zh.md) | 使用字节偏移量收集元素。 |134+| 复杂指令 | [`TGATHERB`](isa/TGATHERB_zh.md) | 使用字节偏移量收集元素。 |
135-| 复杂指令 | [`TSCATTER`](isa/TSCATTER_zh.md) | 使用逐元素行索引将源 Tile 的行散播到目标 Tile 中。 |135+| 复杂指令 | [`TSCATTER`](isa/TSCATTER_zh.md) | 使用逐元素行索引将源 Tile 的行散播到目标 Tile 中。 |
136-| 复杂指令 | [`TQUANT`](isa/TQUANT_zh.md) | 量化 Tile(例如 FP32 到 FP8),生成指数/缩放/最大值输出。 |136+| 复杂指令 | [`TQUANT`](isa/TQUANT_zh.md) | 量化 Tile(例如 FP32 到 FP8),生成指数/缩放/最大值输出。 |
@@ -1,5 +1,5 @@
1<p align="center">1<p align="center">
2- <img src="figures/pto_logo.svg" alt="PTO Tile Lib" width="200" />2+ <img src="../figures/pto_logo.svg" alt="PTO Tile Lib" width="200" />
3</p>3</p>
4 4 
5# PTO ISA Guide5# PTO ISA Guide
@@ -15,24 +15,23 @@ This directory documents the PTO ISA (Instruction Set Architecture) used by PTO
15 15 
16## Where to Start16## Where to Start
17 17 
18-- Virtual ISA manual entry: `docs/PTO-Virtual-ISA-Manual.md`18+- [Virtual ISA manual entry](PTO-Virtual-ISA-Manual.md)
19-- ISA overview: `docs/PTOISA.md`19+- [ISA overview](PTOISA.md)
20-- Instruction index: `docs/isa/README.md`20+- [Instruction index](isa/README.md)
21-- PTO IR non-ISA ops index: `docs/ir/README.md`21+- [PTO IR index](ir/README.md)
22-- PTO IR non-ISA ops reference (L1/L2): `docs/ir/PTO-IR-ops.md`22+- [Common conventions](isa/conventions.md)
23-- Common conventions: `docs/isa/conventions.md`23+- [PTO assembly syntax reference (PTO-AS)](grammar/PTO-AS.md)
24-- PTO assembly syntax reference (PTO-AS): `docs/grammar/PTO-AS.md`24+- [Virtual ISA / IR guide](../manual/09-virtual-isa-and-ir.md)
25-- Virtual ISA / IR guide: `docs/mkdocs/src/manual/09-virtual-isa-and-ir.md`25+- [Bytecode / toolchain guide](../manual/10-bytecode-and-toolchain.md)
26-- Bytecode / toolchain guide: `docs/mkdocs/src/manual/10-bytecode-and-toolchain.md`26+- [Memory ordering / consistency guide](../manual/11-memory-ordering-and-consistency.md)
27-- Memory ordering / consistency guide: `docs/mkdocs/src/manual/11-memory-ordering-and-consistency.md`27+- [Backend profiles / conformance guide](../manual/12-backend-profiles-and-conformance.md)
28-- Backend profiles / conformance guide: `docs/mkdocs/src/manual/12-backend-profiles-and-conformance.md`28+- [Programming model (Tiles/GlobalTensor/Events/Scalars)](coding/ProgrammingModel.md)
29-- Programming model (Tiles/GlobalTensor/Events/Scalars): `docs/coding/ProgrammingModel.md`29+- [PTO ISA programming tutorial (C++ intrinsics)](coding/tutorial.md)
30-- PTO ISA programming tutorial (C++ intrinsics): `docs/coding/tutorial.md`30+- [Abstract machine model (core/device/host)](machine/abstract-machine.md)
31-- Abstract machine model (core/device/host): `docs/machine/abstract-machine.md`31+- [Getting started (recommended: run on CPU first)](getting-started.md)
32-- Getting started (recommended: run on CPU first): `docs/getting-started.md`32+- [Doc tooling (manifest/index/svg/consistency)](tools/)
33-- Doc tooling (manifest/index/svg/consistency): `docs/tools/`33+- [Implementation and extension notes](coding/README.md)
34-- Implementation and extension notes: `docs/coding/README.md`34+- [Kernel examples (NPU-focused)](../kernels/README.md)
35-- Kernel examples (NPU-focused): `kernels/README.md`
36 35 
37## Documentation Layout36## Documentation Layout
38 37 
@@ -1,5 +1,5 @@
1<p align="center">1<p align="center">
2- <img src="figures/pto_logo.svg" alt="PTO Tile Lib" width="200" />2+ <img src="../figures/pto_logo.svg" alt="PTO Tile Lib" width="200" />
3</p>3</p>
4 4 
5# PTO ISA 指南5# PTO ISA 指南
@@ -15,21 +15,20 @@
15 15 
16## 从哪里开始16## 从哪里开始
17 17 
18-- 虚拟 ISA 手册入口:`docs/PTO-Virtual-ISA-Manual_zh.md`18+- [虚拟 ISA 手册入口](PTO-Virtual-ISA-Manual_zh.md)
19-- ISA 总览:`docs/PTOISA_zh.md`19+- [ISA 总览](PTOISA_zh.md)
20-- 指令索引:`docs/isa/README_zh.md`20+- [指令索引](isa/README_zh.md)
21-- PTO IR 非 ISA 运算索引:`docs/ir/README_zh.md`21+- [PTO IR 索引](ir/README_zh.md)
22-- PTO IR 非 ISA 运算参考(L1/L2):`docs/ir/PTO-IR-ops_zh.md`22+- [通用约定](isa/conventions_zh.md)
23-- 通用约定:`docs/isa/conventions_zh.md`23+- [PTO 汇编语法(PTO-AS)](grammar/PTO-AS_zh.md)
24-- PTO 汇编语法(PTO-AS):`docs/grammar/PTO-AS_zh.md`24+- [虚拟 ISA / IR 指南](../manual/09-virtual-isa-and-ir_zh.md)
25-- 虚拟 ISA / IR 指南:`docs/mkdocs/src/manual/09-virtual-isa-and-ir_zh.md`25+- [字节码 / 工具链指南](../manual/10-bytecode-and-toolchain_zh.md)
26-- 字节码 / 工具链指南:`docs/mkdocs/src/manual/10-bytecode-and-toolchain_zh.md`26+- [内存顺序 / 一致性指南](../manual/11-memory-ordering-and-consistency_zh.md)
27-- 内存顺序 / 一致性指南:`docs/mkdocs/src/manual/11-memory-ordering-and-consistency_zh.md`27+- [后端画像 / 一致性指南](../manual/12-backend-profiles-and-conformance_zh.md)
28-- 后端画像 / 一致性指南:`docs/mkdocs/src/manual/12-backend-profiles-and-conformance_zh.md`28+- [入门指南(建议先跑 CPU 仿真)](getting-started_zh.md)
29-- 入门指南(建议先跑 CPU 仿真):`docs/getting-started_zh.md`29+- [实现与扩展说明](coding/README_zh.md)
30-- 实现与扩展说明:`docs/coding/README_zh.md`30+- [Kernel 示例(偏 NPU)](../kernels/README_zh.md)
31-- Kernel 示例偏 NPU:`kernels/README_zh.md`31+- [文档工具manifest/index/svg/一致性检查](tools/)
32-- 文档工具(manifest/index/svg/一致性检查):`docs/tools/`
33 32 
34## 文档组织33## 文档组织
35 34 
@@ -2,19 +2,19 @@
2 2 
3This directory describes the **PTO Tile Lib programming model as seen from C++** (Tiles, GlobalTensor, events, scalar parameters) and provides guidance for extending the library.3This directory describes the **PTO Tile Lib programming model as seen from C++** (Tiles, GlobalTensor, events, scalar parameters) and provides guidance for extending the library.
4 4 
5-If you are looking for the *ISA reference*, start from `docs/isa/README.md`.5+If you are looking for the *ISA reference*, start from [docs/isa/README.md](../isa/README.md).
6 6 
7## Documents7## Documents
8 8 
9-- High-level model and PTO-Auto/PTO-Manual: `docs/coding/ProgrammingModel.md`9+- [High-level model and PTO-Auto/PTO-Manual](ProgrammingModel.md)
10-- Hands-on tutorial (write your first kernels): `docs/coding/tutorial.md`10+- [Hands-on tutorial (write your first kernels)](tutorial.md)
11-- More tutorial examples: `docs/coding/tutorials/README.md`11+- [More tutorial examples](tutorials/README.md)
12-- Debugging and assertion lookup: `docs/coding/debug.md`12+- [Debugging and assertion lookup](debug.md)
13-- Tile abstraction and layout/valid-region rules: `docs/coding/Tile.md`13+- [Tile abstraction and layout/valid-region rules](Tile.md)
14-- Global memory tensors (shape/stride/layout): `docs/coding/GlobalTensor.md`14+- [Global memory tensors (shape/stride/layout)](GlobalTensor.md)
15-- Events and synchronization model: `docs/coding/Event.md`15+- [Events and synchronization model](Event.md)
16-- Scalar values, type mnemonics, and enums: `docs/coding/Scalar.md`16+- [Scalar values, type mnemonics, and enums](Scalar.md)
17 17 
18## Related18## Related
19 19 
20-- PTO abstract machine model: `docs/machine/README.md`20+- [PTO abstract machine model](../machine/README.md)
@@ -1,14 +1,20 @@
1# docs/coding/1# docs/coding/
2 2 
3-面向开发者:如何扩展 PTO Tile Lib(Tile 抽象建模、指令实现方式代码组织等)。3+本目录描述 **从 C++ 角度看到的 PTO Tile Lib 编程型**(TilesGlobalTensor事件、标量参数,并提供扩展库的指导
4+ 
5+如果你在寻找 *ISA 参考*,请从 [docs/isa/README_zh.md](../isa/README_zh.md) 开始。
4 6 
5## 文档列表7## 文档列表
6 8 
7-- 高层模型与 PTO-Auto / PTO-Manual:[`docs/coding/ProgrammingModel_zh.md`](ProgrammingModel_zh.md)9+- [高层模型与 PTO-Auto / PTO-Manual](ProgrammingModel_zh.md)
8-- 上手教程(编写第一个 kernel):[`docs/coding/tutorial_zh.md`](tutorial_zh.md)10+- [上手教程(编写第一个 kernel)](tutorial_zh.md)
9-- 更多教程示例:[`docs/coding/tutorials/README_zh.md`](tutorials/README_zh.md)11+- [更多教程示例](tutorials/README_zh.md)
10-- 多核执行模型(SPMD / MPMD):[`docs/machine/abstract-machine_zh.md`](../machine/abstract-machine_zh.md)12+- [调试与断言查找](debug_zh.md)
11-- Tile 抽象与编程模型:[`docs/coding/Tile_zh.md`](Tile_zh.md)13+- [Tile 抽象与布局/有效区域规则](Tile_zh.md)
12-- 全局内存张量(shape/stride/layout):[`docs/coding/GlobalTensor_zh.md`](GlobalTensor_zh.md)14+- [全局内存张量(shape/stride/layout)](GlobalTensor_zh.md)
13-- 事件与同步模型:[`docs/coding/Event_zh.md`](Event_zh.md)15+- [事件与同步模型](Event_zh.md)
14-- 标量参数与枚举:[`docs/coding/Scalar_zh.md`](Scalar_zh.md)16+- [标量值、类型助记符与枚举](Scalar_zh.md)
17+ 
18+## 相关文档
19+ 
20+- [PTO 抽象机器模型](../machine/README_zh.md)
@@ -1,5 +1,5 @@
1# PTO-AS Grammar1# PTO-AS Grammar
2 2 
3-- PTO-AS language overview: `docs/grammar/PTO-AS.md`3+- [PTO-AS language overview](PTO-AS.md)
4-- BNF grammar: `docs/grammar/PTO-AS.bnf`4+- [BNF grammar](PTO-AS.bnf)
5 5 
@@ -1,4 +1,4 @@
1# PTO-AS 语法1# PTO-AS 语法
2 2 
3-- PTO-AS 语言概览:[`docs/grammar/PTO-AS_zh.md`](PTO-AS_zh.md)3+- [PTO-AS 语言概览](PTO-AS_zh.md)
4-- BNF 语法:[`docs/grammar/PTO-AS.bnf`](PTO-AS.bnf)4+- [BNF 语法](PTO-AS.bnf)
@@ -1,420 +1,420 @@
1-# Axis Reduce / Expand1+# Axis Reduce / Expand
2- 2+ 
3-This document describes row/column reduction and broadcast operations.3+This document describes row/column reduction and broadcast operations.
4- 4+ 
5-**Total Operations:** 255+**Total Operations:** 25
6- 6+ 
7----7+---
8- 8+ 
9-## Operations9+## Operations
10- 10+ 
11-### TROWSUM11+### TROWSUM
12- 12+ 
13-For detailed instruction documentation, see [isa/TROWSUM](../isa/TROWSUM.md)13+For detailed instruction documentation, see [isa/TROWSUM](../isa/TROWSUM.md)
14- 14+ 
15- 15+ 
16-**IR Level 1 (SSA):**16+**IR Level 1 (SSA):**
17-```text17+```text
18-%dst = pto.trowsum %src, %tmp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>18+%dst = pto.trowsum %src, %tmp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
19-```19+```
20- 20+ 
21-**IR Level 2 (DPS):**21+**IR Level 2 (DPS):**
22-```text22+```text
23-pto.trowsum ins(%src, %tmp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)23+pto.trowsum ins(%src, %tmp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
24-```24+```
25- 25+ 
26----26+---
27- 27+ 
28-### TCOLSUM28+### TCOLSUM
29- 29+ 
30-For detailed instruction documentation, see [isa/TCOLSUM](../isa/TCOLSUM.md)30+For detailed instruction documentation, see [isa/TCOLSUM](../isa/TCOLSUM.md)
31- 31+ 
32- 32+ 
33-**IR Level 1 (SSA):**33+**IR Level 1 (SSA):**
34-```text34+```text
35-%dst = pto.tcolsum %src : !pto.tile<...> -> !pto.tile<...>35+%dst = pto.tcolsum %src : !pto.tile<...> -> !pto.tile<...>
36-%dst = pto.tcolsum %src, %tmp {isBinary = false} : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>36+%dst = pto.tcolsum %src, %tmp {isBinary = false} : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
37-```37+```
38- 38+ 
39-**IR Level 2 (DPS):**39+**IR Level 2 (DPS):**
40-```text40+```text
41-pto.tcolsum ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)41+pto.tcolsum ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
42-pto.tcolsum ins(%src, %tmp {isBinary = false} : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)42+pto.tcolsum ins(%src, %tmp {isBinary = false} : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
43-```43+```
44- 44+ 
45----45+---
46- 46+ 
47-### TCOLPROD47+### TCOLPROD
48- 48+ 
49-For detailed instruction documentation, see [isa/TCOLPROD](../isa/TCOLPROD.md)49+For detailed instruction documentation, see [isa/TCOLPROD](../isa/TCOLPROD.md)
50- 50+ 
51- 51+ 
52-**IR Level 1 (SSA):**52+**IR Level 1 (SSA):**
53-```text53+```text
54-%dst = pto.tcolprod %src : !pto.tile<...> -> !pto.tile<...>54+%dst = pto.tcolprod %src : !pto.tile<...> -> !pto.tile<...>
55-```55+```
56- 56+ 
57-**IR Level 2 (DPS):**57+**IR Level 2 (DPS):**
58-```text58+```text
59-pto.tcolprod ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)59+pto.tcolprod ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
60-```60+```
61- 61+ 
62----62+---
63- 63+ 
64-### TCOLMAX64+### TCOLMAX
65- 65+ 
66-For detailed instruction documentation, see [isa/TCOLMAX](../isa/TCOLMAX.md)66+For detailed instruction documentation, see [isa/TCOLMAX](../isa/TCOLMAX.md)
67- 67+ 
68- 68+ 
69-**IR Level 1 (SSA):**69+**IR Level 1 (SSA):**
70-```text70+```text
71-%dst = pto.tcolmax %src : !pto.tile<...> -> !pto.tile<...>71+%dst = pto.tcolmax %src : !pto.tile<...> -> !pto.tile<...>
72-```72+```
73- 73+ 
74-**IR Level 2 (DPS):**74+**IR Level 2 (DPS):**
75-```text75+```text
76-pto.tcolmax ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)76+pto.tcolmax ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
77-```77+```
78- 78+ 
79----79+---
80- 80+ 
81-### TROWMAX81+### TROWMAX
82- 82+ 
83-For detailed instruction documentation, see [isa/TROWMAX](../isa/TROWMAX.md)83+For detailed instruction documentation, see [isa/TROWMAX](../isa/TROWMAX.md)
84- 84+ 
85- 85+ 
86-**IR Level 1 (SSA):**86+**IR Level 1 (SSA):**
87-```text87+```text
88-%dst = pto.trowmax %src, %tmp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>88+%dst = pto.trowmax %src, %tmp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
89-```89+```
90- 90+ 
91-**IR Level 2 (DPS):**91+**IR Level 2 (DPS):**
92-```text92+```text
93-pto.trowmax ins(%src, %tmp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)93+pto.trowmax ins(%src, %tmp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
94-```94+```
95- 95+ 
96----96+---
97- 97+ 
98-### TROWMIN98+### TROWMIN
99- 99+ 
100-For detailed instruction documentation, see [isa/TROWMIN](../isa/TROWMIN.md)100+For detailed instruction documentation, see [isa/TROWMIN](../isa/TROWMIN.md)
101- 101+ 
102- 102+ 
103-**IR Level 1 (SSA):**103+**IR Level 1 (SSA):**
104-```text104+```text
105-%dst = pto.trowmin %src, %tmp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>105+%dst = pto.trowmin %src, %tmp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
106-```106+```
107- 107+ 
108-**IR Level 2 (DPS):**108+**IR Level 2 (DPS):**
109-```text109+```text
110-pto.trowmin ins(%src, %tmp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)110+pto.trowmin ins(%src, %tmp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
111-```111+```
112- 112+ 
113----113+---
114- 114+ 
115-### TROWEXPAND115+### TROWEXPAND
116- 116+ 
117-For detailed instruction documentation, see [isa/TROWEXPAND](../isa/TROWEXPAND.md)117+For detailed instruction documentation, see [isa/TROWEXPAND](../isa/TROWEXPAND.md)
118- 118+ 
119- 119+ 
120-**IR Level 1 (SSA):**120+**IR Level 1 (SSA):**
121-```text121+```text
122-%dst = pto.trowexpand %src : !pto.tile<...> -> !pto.tile<...>122+%dst = pto.trowexpand %src : !pto.tile<...> -> !pto.tile<...>
123-```123+```
124- 124+ 
125-**IR Level 2 (DPS):**125+**IR Level 2 (DPS):**
126-```text126+```text
127-pto.trowexpand ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)127+pto.trowexpand ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
128-```128+```
129- 129+ 
130----130+---
131- 131+ 
132-### TROWEXPANDDIV132+### TROWEXPANDDIV
133- 133+ 
134-For detailed instruction documentation, see [isa/TROWEXPANDDIV](../isa/TROWEXPANDDIV.md)134+For detailed instruction documentation, see [isa/TROWEXPANDDIV](../isa/TROWEXPANDDIV.md)
135- 135+ 
136- 136+ 
137-**IR Level 1 (SSA):**137+**IR Level 1 (SSA):**
138-```text138+```text
139-%dst = pto.tcolexpanddiv %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>139+%dst = pto.tcolexpanddiv %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
140-```140+```
141- 141+ 
142-**IR Level 2 (DPS):**142+**IR Level 2 (DPS):**
143-```text143+```text
144-pto.tcolexpanddiv ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)144+pto.tcolexpanddiv ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
145-```145+```
146- 146+ 
147----147+---
148- 148+ 
149-### TROWEXPANDMUL149+### TROWEXPANDMUL
150- 150+ 
151-For detailed instruction documentation, see [isa/TROWEXPANDMUL](../isa/TROWEXPANDMUL.md)151+For detailed instruction documentation, see [isa/TROWEXPANDMUL](../isa/TROWEXPANDMUL.md)
152- 152+ 
153- 153+ 
154-**IR Level 1 (SSA):**154+**IR Level 1 (SSA):**
155-```text155+```text
156-%dst = pto.tcolexpandmul %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>156+%dst = pto.tcolexpandmul %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
157-```157+```
158- 158+ 
159-**IR Level 2 (DPS):**159+**IR Level 2 (DPS):**
160-```text160+```text
161-pto.tcolexpandmul ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)161+pto.tcolexpandmul ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
162-```162+```
163- 163+ 
164----164+---
165- 165+ 
166-### TROWEXPANDSUB166+### TROWEXPANDSUB
167- 167+ 
168-For detailed instruction documentation, see [isa/TROWEXPANDSUB](../isa/TROWEXPANDSUB.md)168+For detailed instruction documentation, see [isa/TROWEXPANDSUB](../isa/TROWEXPANDSUB.md)
169- 169+ 
170- 170+ 
171-**IR Level 1 (SSA):**171+**IR Level 1 (SSA):**
172-```text172+```text
173-%dst = pto.tcolexpandsub %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>173+%dst = pto.tcolexpandsub %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
174-```174+```
175- 175+ 
176-**IR Level 2 (DPS):**176+**IR Level 2 (DPS):**
177-```text177+```text
178-pto.tcolexpandsub ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)178+pto.tcolexpandsub ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
179-```179+```
180- 180+ 
181----181+---
182- 182+ 
183-### TROWEXPANDADD183+### TROWEXPANDADD
184- 184+ 
185-For detailed instruction documentation, see [isa/TROWEXPANDADD](../isa/TROWEXPANDADD.md)185+For detailed instruction documentation, see [isa/TROWEXPANDADD](../isa/TROWEXPANDADD.md)
186- 186+ 
187- 187+ 
188-**IR Level 1 (SSA):**188+**IR Level 1 (SSA):**
189-```text189+```text
190-%dst = pto.trowexpandadd %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>190+%dst = pto.trowexpandadd %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
191-```191+```
192- 192+ 
193-**IR Level 2 (DPS):**193+**IR Level 2 (DPS):**
194-```text194+```text
195-pto.trowexpandadd ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)195+pto.trowexpandadd ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
196-```196+```
197- 197+ 
198----198+---
199- 199+ 
200-### TROWEXPANDMAX200+### TROWEXPANDMAX
201- 201+ 
202-For detailed instruction documentation, see [isa/TROWEXPANDMAX](../isa/TROWEXPANDMAX.md)202+For detailed instruction documentation, see [isa/TROWEXPANDMAX](../isa/TROWEXPANDMAX.md)
203- 203+ 
204- 204+ 
205-**IR Level 1 (SSA):**205+**IR Level 1 (SSA):**
206-```text206+```text
207-%dst = pto.trowexpandmax %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>207+%dst = pto.trowexpandmax %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
208-```208+```
209- 209+ 
210-**IR Level 2 (DPS):**210+**IR Level 2 (DPS):**
211-```text211+```text
212-pto.trowexpandmax ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)212+pto.trowexpandmax ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
213-```213+```
214- 214+ 
215----215+---
216- 216+ 
217-### TROWEXPANDMIN217+### TROWEXPANDMIN
218- 218+ 
219-For detailed instruction documentation, see [isa/TROWEXPANDMIN](../isa/TROWEXPANDMIN.md)219+For detailed instruction documentation, see [isa/TROWEXPANDMIN](../isa/TROWEXPANDMIN.md)
220- 220+ 
221- 221+ 
222-**IR Level 1 (SSA):**222+**IR Level 1 (SSA):**
223-```text223+```text
224-%dst = pto.trowexpandmin %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>224+%dst = pto.trowexpandmin %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
225-```225+```
226- 226+ 
227-**IR Level 2 (DPS):**227+**IR Level 2 (DPS):**
228-```text228+```text
229-pto.trowexpandmin ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)229+pto.trowexpandmin ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
230-```230+```
231- 231+ 
232----232+---
233- 233+ 
234-### TROWEXPANDEXPDIF234+### TROWEXPANDEXPDIF
235- 235+ 
236-For detailed instruction documentation, see [isa/TROWEXPANDEXPDIF](../isa/TROWEXPANDEXPDIF.md)236+For detailed instruction documentation, see [isa/TROWEXPANDEXPDIF](../isa/TROWEXPANDEXPDIF.md)
237- 237+ 
238- 238+ 
239-**IR Level 1 (SSA):**239+**IR Level 1 (SSA):**
240-```text240+```text
241-%dst = pto.trowexpandexpdif %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>241+%dst = pto.trowexpandexpdif %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
242-```242+```
243- 243+ 
244-**IR Level 2 (DPS):**244+**IR Level 2 (DPS):**
245-```text245+```text
246-pto.trowexpandexpdif ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)246+pto.trowexpandexpdif ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
247-```247+```
248- 248+ 
249----249+---
250- 250+ 
251-### TCOLMIN251+### TCOLMIN
252- 252+ 
253-For detailed instruction documentation, see [isa/TCOLMIN](../isa/TCOLMIN.md)253+For detailed instruction documentation, see [isa/TCOLMIN](../isa/TCOLMIN.md)
254- 254+ 
255- 255+ 
256-**IR Level 1 (SSA):**256+**IR Level 1 (SSA):**
257-```text257+```text
258-%dst = pto.tcolmin %src : !pto.tile<...> -> !pto.tile<...>258+%dst = pto.tcolmin %src : !pto.tile<...> -> !pto.tile<...>
259-```259+```
260- 260+ 
261-**IR Level 2 (DPS):**261+**IR Level 2 (DPS):**
262-```text262+```text
263-pto.tcolmin ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)263+pto.tcolmin ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
264-```264+```
265- 265+ 
266----266+---
267- 267+ 
268-### TCOLEXPAND268+### TCOLEXPAND
269- 269+ 
270-For detailed instruction documentation, see [isa/TCOLEXPAND](../isa/TCOLEXPAND.md)270+For detailed instruction documentation, see [isa/TCOLEXPAND](../isa/TCOLEXPAND.md)
271- 271+ 
272- 272+ 
273-**IR Level 1 (SSA):**273+**IR Level 1 (SSA):**
274-```text274+```text
275-%dst = pto.tcolexpand %src : !pto.tile<...> -> !pto.tile<...>275+%dst = pto.tcolexpand %src : !pto.tile<...> -> !pto.tile<...>
276-```276+```
277- 277+ 
278-**IR Level 2 (DPS):**278+**IR Level 2 (DPS):**
279-```text279+```text
280-pto.tcolexpand ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)280+pto.tcolexpand ins(%src : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
281-```281+```
282- 282+ 
283----283+---
284- 284+ 
285-### TCOLEXPANDDIV285+### TCOLEXPANDDIV
286- 286+ 
287-For detailed instruction documentation, see [isa/TCOLEXPANDDIV](../isa/TCOLEXPANDDIV.md)287+For detailed instruction documentation, see [isa/TCOLEXPANDDIV](../isa/TCOLEXPANDDIV.md)
288- 288+ 
289- 289+ 
290-**IR Level 1 (SSA):**290+**IR Level 1 (SSA):**
291-```text291+```text
292-%dst = pto.tcolexpanddiv %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>292+%dst = pto.tcolexpanddiv %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
293-```293+```
294- 294+ 
295-**IR Level 2 (DPS):**295+**IR Level 2 (DPS):**
296-```text296+```text
297-pto.tcolexpanddiv ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)297+pto.tcolexpanddiv ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
298-```298+```
299- 299+ 
300----300+---
301- 301+ 
302-### TCOLEXPANDMUL302+### TCOLEXPANDMUL
303- 303+ 
304-For detailed instruction documentation, see [isa/TCOLEXPANDMUL](../isa/TCOLEXPANDMUL.md)304+For detailed instruction documentation, see [isa/TCOLEXPANDMUL](../isa/TCOLEXPANDMUL.md)
305- 305+ 
306- 306+ 
307-**IR Level 1 (SSA):**307+**IR Level 1 (SSA):**
308-```text308+```text
309-%dst = pto.tcolexpandmul %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>309+%dst = pto.tcolexpandmul %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
310-```310+```
311- 311+ 
312-**IR Level 2 (DPS):**312+**IR Level 2 (DPS):**
313-```text313+```text
314-pto.tcolexpandmul ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)314+pto.tcolexpandmul ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
315-```315+```
316- 316+ 
317----317+---
318- 318+ 
319-### TCOLEXPANDADD319+### TCOLEXPANDADD
320- 320+ 
321-For detailed instruction documentation, see [isa/TCOLEXPANDADD](../isa/TCOLEXPANDADD.md)321+For detailed instruction documentation, see [isa/TCOLEXPANDADD](../isa/TCOLEXPANDADD.md)
322- 322+ 
323- 323+ 
324-**IR Level 1 (SSA):**324+**IR Level 1 (SSA):**
325-```text325+```text
326-%dst = pto.tcolexpandadd %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>326+%dst = pto.tcolexpandadd %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
327-```327+```
328- 328+ 
329-**IR Level 2 (DPS):**329+**IR Level 2 (DPS):**
330-```text330+```text
331-pto.tcolexpandadd ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)331+pto.tcolexpandadd ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
332-```332+```
333- 333+ 
334----334+---
335- 335+ 
336-### TCOLEXPANDMAX336+### TCOLEXPANDMAX
337- 337+ 
338-For detailed instruction documentation, see [isa/TCOLEXPANDMAX](../isa/TCOLEXPANDMAX.md)338+For detailed instruction documentation, see [isa/TCOLEXPANDMAX](../isa/TCOLEXPANDMAX.md)
339- 339+ 
340- 340+ 
341-**IR Level 1 (SSA):**341+**IR Level 1 (SSA):**
342-```text342+```text
343-%dst = pto.tcolexpandmax %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>343+%dst = pto.tcolexpandmax %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
344-```344+```
345- 345+ 
346-**IR Level 2 (DPS):**346+**IR Level 2 (DPS):**
347-```text347+```text
348-pto.tcolexpandmax ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)348+pto.tcolexpandmax ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
349-```349+```
350- 350+ 
351----351+---
352- 352+ 
353-### TCOLEXPANDMIN353+### TCOLEXPANDMIN
354- 354+ 
355-For detailed instruction documentation, see [isa/TCOLEXPANDMIN](../isa/TCOLEXPANDMIN.md)355+For detailed instruction documentation, see [isa/TCOLEXPANDMIN](../isa/TCOLEXPANDMIN.md)
356- 356+ 
357- 357+ 
358-**IR Level 1 (SSA):**358+**IR Level 1 (SSA):**
359-```text359+```text
360-%dst = pto.tcolexpandmin %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>360+%dst = pto.tcolexpandmin %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
361-```361+```
362- 362+ 
363-**IR Level 2 (DPS):**363+**IR Level 2 (DPS):**
364-```text364+```text
365-pto.tcolexpandmin ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)365+pto.tcolexpandmin ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
366-```366+```
367- 367+ 
368----368+---
369- 369+ 
370-### TCOLEXPANDSUB370+### TCOLEXPANDSUB
371- 371+ 
372-For detailed instruction documentation, see [isa/TCOLEXPANDSUB](../isa/TCOLEXPANDSUB.md)372+For detailed instruction documentation, see [isa/TCOLEXPANDSUB](../isa/TCOLEXPANDSUB.md)
373- 373+ 
374- 374+ 
375-**IR Level 1 (SSA):**375+**IR Level 1 (SSA):**
376-```text376+```text
377-%dst = pto.tcolexpandsub %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>377+%dst = pto.tcolexpandsub %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
378-```378+```
379- 379+ 
380-**IR Level 2 (DPS):**380+**IR Level 2 (DPS):**
381-```text381+```text
382-pto.tcolexpandsub ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)382+pto.tcolexpandsub ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
383-```383+```
384- 384+ 
385----385+---
386- 386+ 
387-### TCOLEXPANDEXPDIF387+### TCOLEXPANDEXPDIF
388- 388+ 
389-For detailed instruction documentation, see [isa/TCOLEXPANDEXPDIF](../isa/TCOLEXPANDEXPDIF.md)389+For detailed instruction documentation, see [isa/TCOLEXPANDEXPDIF](../isa/TCOLEXPANDEXPDIF.md)
390- 390+ 
391- 391+ 
392-**IR Level 1 (SSA):**392+**IR Level 1 (SSA):**
393-```text393+```text
394-%dst = pto.tcolexpandexpdif %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>394+%dst = pto.tcolexpandexpdif %src0, %src1 : !pto.tile<...>, !pto.tile<...> -> !pto.tile<...>
395-```395+```
396- 396+ 
397-**IR Level 2 (DPS):**397+**IR Level 2 (DPS):**
398-```text398+```text
399-pto.tcolexpandexpdif ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)399+pto.tcolexpandexpdif ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
400-```400+```
401- 401+ 
402----402+---
403- 403+ 
404-### TROWPROD404+### TROWPROD
405- 405+ 
406-For detailed instruction documentation, see [isa/TROWPROD](../isa/TROWPROD.md)406+For detailed instruction documentation, see [isa/TROWPROD](../isa/TROWPROD.md)
407- 407+ 
408-**IR Level 1 (SSA):**408+**IR Level 1 (SSA):**
409-```text409+```text
410-%dst = pto.trowprod %src, %tmp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>410+%dst = pto.trowprod %src, %tmp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
411-```411+```
412- 412+ 
413-**IR Level 2 (DPS):**413+**IR Level 2 (DPS):**
414-```text414+```text
415-pto.trowprod ins(%src, %tmp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)415+pto.trowprod ins(%src, %tmp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
416-```416+```
417- 417+ 
418----418+---
419- 419+ 
420- 420+ 
@@ -1,4 +1,4 @@
1-# 轴归约/扩展操作1+# 轴归约/扩展操作
2 2 
3本文档描述行/列归约和广播操作。3本文档描述行/列归约和广播操作。
4 4 
@@ -1,235 +1,235 @@
1-# Complex1+# Complex
2- 2+ 
3-This document describes complex operations including sorting, gathering, and quantization.3+This document describes complex operations including sorting, gathering, and quantization.
4- 4+ 
5-**Total Operations:** 155+**Total Operations:** 15
6- 6+ 
7----7+---
8- 8+ 
9-## Operations9+## Operations
10- 10+ 
11-### TPRINT11+### TPRINT
12- 12+ 
13-For detailed instruction documentation, see [isa/TPRINT](../isa/TPRINT.md)13+For detailed instruction documentation, see [isa/TPRINT](../isa/TPRINT.md)
14- 14+ 
15- 15+ 
16-**IR Level 1 (SSA):**16+**IR Level 1 (SSA):**
17-```text17+```text
18-pto.tprint %src : !pto.tile<...> | !pto.partition_tensor_view<MxNxdtype> -> ()18+pto.tprint %src : !pto.tile<...> | !pto.partition_tensor_view<MxNxdtype> -> ()
19-```19+```
20- 20+ 
21-**IR Level 2 (DPS):**21+**IR Level 2 (DPS):**
22-```text22+```text
23-pto.tprint ins(%src : !pto.tile_buf<...> | !pto.partition_tensor_view<MxNxdtype>)23+pto.tprint ins(%src : !pto.tile_buf<...> | !pto.partition_tensor_view<MxNxdtype>)
24-```24+```
25- 25+ 
26----26+---
27- 27+ 
28-### TMRGSORT28+### TMRGSORT
29- 29+ 
30-For detailed instruction documentation, see [isa/TMRGSORT](../isa/TMRGSORT.md)30+For detailed instruction documentation, see [isa/TMRGSORT](../isa/TMRGSORT.md)
31- 31+ 
32- 32+ 
33-**IR Level 1 (SSA):**33+**IR Level 1 (SSA):**
34-```text34+```text
35-%dst = pto.tmrgsort %src, %blockLen : (!pto.tile<...>, dtype) -> !pto.tile<...>35+%dst = pto.tmrgsort %src, %blockLen : (!pto.tile<...>, dtype) -> !pto.tile<...>
36-%dst, %executed = pto.tmrgsort %src0, %src1, %src2, %src3 {exhausted = false}36+%dst, %executed = pto.tmrgsort %src0, %src1, %src2, %src3 {exhausted = false}
37- : (!pto.tile<...>, !pto.tile<...>, !pto.tile<...>, !pto.tile<...>) -> (!pto.tile<...>, vector<4xi16>)37+ : (!pto.tile<...>, !pto.tile<...>, !pto.tile<...>, !pto.tile<...>) -> (!pto.tile<...>, vector<4xi16>)
38-```38+```
39- 39+ 
40-**IR Level 2 (DPS):**40+**IR Level 2 (DPS):**
41-```text41+```text
42-pto.tmrgsort ins(%src, %blockLen : !pto.tile_buf<...>, dtype) outs(%dst : !pto.tile_buf<...>)42+pto.tmrgsort ins(%src, %blockLen : !pto.tile_buf<...>, dtype) outs(%dst : !pto.tile_buf<...>)
43-pto.tmrgsort ins(%src0, %src1, %src2, %src3 {exhausted = false} : !pto.tile_buf<...>, !pto.tile_buf<...>, !pto.tile_buf<...>, !pto.tile_buf<...>)43+pto.tmrgsort ins(%src0, %src1, %src2, %src3 {exhausted = false} : !pto.tile_buf<...>, !pto.tile_buf<...>, !pto.tile_buf<...>, !pto.tile_buf<...>)
44-outs(%dst, %executed : !pto.tile_buf<...>, vector<4xi16>)44+outs(%dst, %executed : !pto.tile_buf<...>, vector<4xi16>)
45-```45+```
46- 46+ 
47----47+---
48- 48+ 
49-### TSORT3249+### TSORT32
50- 50+ 
51-For detailed instruction documentation, see [isa/TSORT32](../isa/TSORT32.md)51+For detailed instruction documentation, see [isa/TSORT32](../isa/TSORT32.md)
52- 52+ 
53-**IR Level 1 (SSA):**53+**IR Level 1 (SSA):**
54-```text54+```text
55-%dst, %idx = pto.tsort32 %src : !pto.tile<...> -> (!pto.tile<...>, !pto.tile<...>)55+%dst, %idx = pto.tsort32 %src : !pto.tile<...> -> (!pto.tile<...>, !pto.tile<...>)
56-```56+```
57- 57+ 
58-**IR Level 2 (DPS):**58+**IR Level 2 (DPS):**
59-```text59+```text
60-pto.tsort32 ins(%src : !pto.tile_buf<...>) outs(%dst, %idx : !pto.tile_buf<...>, !pto.tile_buf<...>)60+pto.tsort32 ins(%src : !pto.tile_buf<...>) outs(%dst, %idx : !pto.tile_buf<...>, !pto.tile_buf<...>)
61-```61+```
62- 62+ 
63----63+---
64- 64+ 
65-### TGATHER65+### TGATHER
66- 66+ 
67-For detailed instruction documentation, see [isa/TGATHER](../isa/TGATHER.md)67+For detailed instruction documentation, see [isa/TGATHER](../isa/TGATHER.md)
68- 68+ 
69- 69+ 
70-**IR Level 1 (SSA):**70+**IR Level 1 (SSA):**
71-```text71+```text
72-%dst = pto.tgather %src, %indices : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>72+%dst = pto.tgather %src, %indices : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
73-%dst = pto.tgather %src {maskPattern = #pto.mask_pattern<P0101>}: !pto.tile<...> -> !pto.tile<...>73+%dst = pto.tgather %src {maskPattern = #pto.mask_pattern<P0101>}: !pto.tile<...> -> !pto.tile<...>
74-```74+```
75- 75+ 
76-**IR Level 2 (DPS):**76+**IR Level 2 (DPS):**
77-```text77+```text
78-pto.tgather ins(%src, %indices : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)78+pto.tgather ins(%src, %indices : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
79-pto.tgather ins(%src, {maskPattern = #pto.mask_pattern<P0101>} : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)79+pto.tgather ins(%src, {maskPattern = #pto.mask_pattern<P0101>} : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
80-```80+```
81- 81+ 
82----82+---
83- 83+ 
84-### TCI84+### TCI
85- 85+ 
86-For detailed instruction documentation, see [isa/TCI](../isa/TCI.md)86+For detailed instruction documentation, see [isa/TCI](../isa/TCI.md)
87- 87+ 
88- 88+ 
89-**IR Level 1 (SSA):**89+**IR Level 1 (SSA):**
90-```text90+```text
91-%dst = pto.tci %scalar {descending = false} : dtype -> !pto.tile<...>91+%dst = pto.tci %scalar {descending = false} : dtype -> !pto.tile<...>
92-```92+```
93- 93+ 
94-**IR Level 2 (DPS):**94+**IR Level 2 (DPS):**
95-```text95+```text
96-pto.tci ins(%scalar {descending = false} : dtype) outs(%dst : !pto.tile_buf<...>)96+pto.tci ins(%scalar {descending = false} : dtype) outs(%dst : !pto.tile_buf<...>)
97-```97+```
98- 98+ 
99----99+---
100- 100+ 
101-### TTRI101+### TTRI
102- 102+ 
103-For detailed instruction documentation, see [isa/TTRI](../isa/TTRI.md)103+For detailed instruction documentation, see [isa/TTRI](../isa/TTRI.md)
104- 104+ 
105- 105+ 
106-**IR Level 1 (SSA):**106+**IR Level 1 (SSA):**
107-```text107+```text
108-%dst = pto.ttri %src0, %src1 : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>108+%dst = pto.ttri %src0, %src1 : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
109-```109+```
110- 110+ 
111-**IR Level 2 (DPS):**111+**IR Level 2 (DPS):**
112-```text112+```text
113-pto.ttri ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)113+pto.ttri ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
114-```114+```
115- 115+ 
116----116+---
117- 117+ 
118-### TPARTADD118+### TPARTADD
119- 119+ 
120-For detailed instruction documentation, see [isa/TPARTADD](../isa/TPARTADD.md)120+For detailed instruction documentation, see [isa/TPARTADD](../isa/TPARTADD.md)
121- 121+ 
122- 122+ 
123-**IR Level 1 (SSA):**123+**IR Level 1 (SSA):**
124-```text124+```text
125-%dst = pto.tpartadd %src0, %src1 : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>125+%dst = pto.tpartadd %src0, %src1 : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
126-```126+```
127- 127+ 
128-**IR Level 2 (DPS):**128+**IR Level 2 (DPS):**
129-```text129+```text
130-pto.tpartadd ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)130+pto.tpartadd ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
131-```131+```
132- 132+ 
133----133+---
134- 134+ 
135-### TPARTMUL135+### TPARTMUL
136- 136+ 
137-For detailed instruction documentation, see [isa/TPARTMUL](../isa/TPARTMUL.md)137+For detailed instruction documentation, see [isa/TPARTMUL](../isa/TPARTMUL.md)
138- 138+ 
139- 139+ 
140-**IR Level 1 (SSA):**140+**IR Level 1 (SSA):**
141-```text141+```text
142-%dst = pto.tpartmul %src0, %src1 : !pto.tile<...> -> !pto.tile<...>142+%dst = pto.tpartmul %src0, %src1 : !pto.tile<...> -> !pto.tile<...>
143-```143+```
144- 144+ 
145-**IR Level 2 (DPS):**145+**IR Level 2 (DPS):**
146-```text146+```text
147-pto.tpartmul ins(%src0, %src1 : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)147+pto.tpartmul ins(%src0, %src1 : !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
148-```148+```
149- 149+ 
150----150+---
151- 151+ 
152-### TPARTMAX152+### TPARTMAX
153- 153+ 
154-For detailed instruction documentation, see [isa/TPARTMAX](../isa/TPARTMAX.md)154+For detailed instruction documentation, see [isa/TPARTMAX](../isa/TPARTMAX.md)
155- 155+ 
156- 156+ 
157-**IR Level 1 (SSA):**157+**IR Level 1 (SSA):**
158-```text158+```text
159-%dst = pto.tpartmax %src0, %src1 : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>159+%dst = pto.tpartmax %src0, %src1 : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
160-```160+```
161- 161+ 
162-**IR Level 2 (DPS):**162+**IR Level 2 (DPS):**
163-```text163+```text
164-pto.tpartmax ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)164+pto.tpartmax ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
165-```165+```
166- 166+ 
167----167+---
168- 168+ 
169-### TPARTMIN169+### TPARTMIN
170- 170+ 
171-For detailed instruction documentation, see [isa/TPARTMIN](../isa/TPARTMIN.md)171+For detailed instruction documentation, see [isa/TPARTMIN](../isa/TPARTMIN.md)
172- 172+ 
173- 173+ 
174-**IR Level 1 (SSA):**174+**IR Level 1 (SSA):**
175-```text175+```text
176-%dst = pto.tpartmin %src0, %src1 : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>176+%dst = pto.tpartmin %src0, %src1 : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
177-```177+```
178- 178+ 
179-**IR Level 2 (DPS):**179+**IR Level 2 (DPS):**
180-```text180+```text
181-pto.tpartmin ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)181+pto.tpartmin ins(%src0, %src1 : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
182-```182+```
183- 183+ 
184----184+---
185- 185+ 
186-### TGATHERB186+### TGATHERB
187- 187+ 
188-For detailed instruction documentation, see [isa/TGATHERB](../isa/TGATHERB.md)188+For detailed instruction documentation, see [isa/TGATHERB](../isa/TGATHERB.md)
189- 189+ 
190- 190+ 
191-**IR Level 1 (SSA):**191+**IR Level 1 (SSA):**
192-```text192+```text
193-%dst = pto.tgatherb %src, %offsets : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>193+%dst = pto.tgatherb %src, %offsets : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
194-```194+```
195- 195+ 
196-**IR Level 2 (DPS):**196+**IR Level 2 (DPS):**
197-```text197+```text
198-pto.tgatherb ins(%src, %offsets : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)198+pto.tgatherb ins(%src, %offsets : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
199-```199+```
200- 200+ 
201----201+---
202- 202+ 
203-### TSCATTER203+### TSCATTER
204- 204+ 
205-For detailed instruction documentation, see [isa/TSCATTER](../isa/TSCATTER.md)205+For detailed instruction documentation, see [isa/TSCATTER](../isa/TSCATTER.md)
206- 206+ 
207- 207+ 
208-**IR Level 1 (SSA):**208+**IR Level 1 (SSA):**
209-```text209+```text
210-%dst = pto.tscatter %src, %idx : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>210+%dst = pto.tscatter %src, %idx : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
211-```211+```
212- 212+ 
213-**IR Level 2 (DPS):**213+**IR Level 2 (DPS):**
214-```text214+```text
215-pto.tscatter ins(%src, %idx : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)215+pto.tscatter ins(%src, %idx : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
216-```216+```
217- 217+ 
218----218+---
219- 219+ 
220-### TQUANT220+### TQUANT
221- 221+ 
222-For detailed instruction documentation, see [isa/TQUANT](../isa/TQUANT.md)222+For detailed instruction documentation, see [isa/TQUANT](../isa/TQUANT.md)
223- 223+ 
224- 224+ 
225-**IR Level 1 (SSA):**225+**IR Level 1 (SSA):**
226-```text226+```text
227-%dst = pto.tquant %src, %qp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>227+%dst = pto.tquant %src, %qp : (!pto.tile<...>, !pto.tile<...>) -> !pto.tile<...>
228-```228+```
229- 229+ 
230-**IR Level 2 (DPS):**230+**IR Level 2 (DPS):**
231-```text231+```text
232-pto.tquant ins(%src, %qp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)232+pto.tquant ins(%src, %qp : !pto.tile_buf<...>, !pto.tile_buf<...>) outs(%dst : !pto.tile_buf<...>)
233-```233+```
234- 234+ 
235----235+---
@@ -1,4 +1,4 @@
1-# 复杂操作1+# 复杂操作
2 2 
3本文档描述复杂操作,包括排序、聚集和量化。3本文档描述复杂操作,包括排序、聚集和量化。
4 4 
@@ -1,393 +1,393 @@
1-# Control Flow Operations1+# Control Flow Operations
2- 2+ 
3-This document describes structured control flow operations from the MLIR `scf` (Structured Control Flow) dialect.3+This document describes structured control flow operations from the MLIR `scf` (Structured Control Flow) dialect.
4- 4+ 
5-**Total Operations:** 95+**Total Operations:** 9
6- 6+ 
7----7+---
8- 8+ 
9-## Loop Operations9+## Loop Operations
10- 10+ 
11-### scf.for - For Loop11+### scf.for - For Loop
12- 12+ 
13-**Description:** For loop with lower bound, upper bound, and step. Supports loop-carried variables and signed/unsigned comparison.13+**Description:** For loop with lower bound, upper bound, and step. Supports loop-carried variables and signed/unsigned comparison.
14- 14+ 
15-**Syntax:**15+**Syntax:**
16-```mlir16+```mlir
17-scf.for %iv = %lb to %ub step %step {17+scf.for %iv = %lb to %ub step %step {
18- // loop body18+ // loop body
19-}19+}
20- 20+ 
21-scf.for %iv = %lb to %ub step %step 21+scf.for %iv = %lb to %ub step %step
22- iter_args(%arg = %init) -> (type) {22+ iter_args(%arg = %init) -> (type) {
23- // loop body with loop-carried variable23+ // loop body with loop-carried variable
24- scf.yield %new_value : type24+ scf.yield %new_value : type
25-}25+}
26- 26+ 
27-scf.for unsigned %iv = %lb to %ub step %step : i32 {27+scf.for unsigned %iv = %lb to %ub step %step : i32 {
28- // unsigned comparison28+ // unsigned comparison
29-}29+}
30-```30+```
31- 31+ 
32-**Operands:**32+**Operands:**
33-- `lb`: Lower bound (index or integer)33+- `lb`: Lower bound (index or integer)
34-- `ub`: Upper bound (exclusive)34+- `ub`: Upper bound (exclusive)
35-- `step`: Step value (must be positive)35+- `step`: Step value (must be positive)
36-- `iter_args`: Initial values for loop-carried variables (optional)36+- `iter_args`: Initial values for loop-carried variables (optional)
37- 37+ 
38-**Results:**38+**Results:**
39-- Final values of loop-carried variables (if any)39+- Final values of loop-carried variables (if any)
40- 40+ 
41-**Example:**41+**Example:**
42-```mlir42+```mlir
43-// Simple loop43+// Simple loop
44-scf.for %i = %c0 to %c100 step %c1 {44+scf.for %i = %c0 to %c100 step %c1 {
45- // loop body45+ // loop body
46-}46+}
47- 47+ 
48-// Loop with accumulator48+// Loop with accumulator
49-%sum = scf.for %i = %c0 to %c100 step %c1 49+%sum = scf.for %i = %c0 to %c100 step %c1
50- iter_args(%acc = %c0_i32) -> (i32) {50+ iter_args(%acc = %c0_i32) -> (i32) {
51- %val = memref.load %array[%i] : memref<?xi32>51+ %val = memref.load %array[%i] : memref<?xi32>
52- %new_acc = arith.addi %acc, %val : i3252+ %new_acc = arith.addi %acc, %val : i32
53- scf.yield %new_acc : i3253+ scf.yield %new_acc : i32
54-}54+}
55- 55+ 
56-// Unsigned comparison56+// Unsigned comparison
57-scf.for unsigned %i = %lb to %ub step %step : i32 {57+scf.for unsigned %i = %lb to %ub step %step : i32 {
58- // loop body58+ // loop body
59-}59+}
60-```60+```
61- 61+ 
62----62+---
63- 63+ 
64-### scf.while - While Loop64+### scf.while - While Loop
65- 65+ 
66-**Description:** While loop with condition check in "before" region and loop body in "after" region.66+**Description:** While loop with condition check in "before" region and loop body in "after" region.
67- 67+ 
68-**Syntax:**68+**Syntax:**
69-```mlir69+```mlir
70-%result = scf.while (%arg = %init) : (type) -> type {70+%result = scf.while (%arg = %init) : (type) -> type {
71- // before region: condition check71+ // before region: condition check
72- %condition = ...72+ %condition = ...
73- scf.condition(%condition) %arg : type73+ scf.condition(%condition) %arg : type
74-} do {74+} do {
75-^bb0(%arg: type):75+^bb0(%arg: type):
76- // after region: loop body76+ // after region: loop body
77- %next = ...77+ %next = ...
78- scf.yield %next : type78+ scf.yield %next : type
79-}79+}
80-```80+```
81- 81+ 
82-**Regions:**82+**Regions:**
83-- `before`: Condition check region (terminates with `scf.condition`)83+- `before`: Condition check region (terminates with `scf.condition`)
84-- `after`: Loop body region (terminates with `scf.yield`)84+- `after`: Loop body region (terminates with `scf.yield`)
85- 85+ 
86-**Example:**86+**Example:**
87-```mlir87+```mlir
88-%result = scf.while (%arg = %init) : (i32) -> i32 {88+%result = scf.while (%arg = %init) : (i32) -> i32 {
89- %condition = arith.cmpi slt, %arg, %limit : i3289+ %condition = arith.cmpi slt, %arg, %limit : i32
90- scf.condition(%condition) %arg : i3290+ scf.condition(%condition) %arg : i32
91-} do {91+} do {
92-^bb0(%arg: i32):92+^bb0(%arg: i32):
93- %next = arith.addi %arg, %c1 : i3293+ %next = arith.addi %arg, %c1 : i32
94- scf.yield %next : i3294+ scf.yield %next : i32
95-}95+}
96-```96+```
97- 97+ 
98----98+---
99- 99+ 
100-## Conditional Operations100+## Conditional Operations
101- 101+ 
102-### scf.if - If-Then-Else102+### scf.if - If-Then-Else
103- 103+ 
104-**Description:** Conditional branch with optional else block and optional results.104+**Description:** Conditional branch with optional else block and optional results.
105- 105+ 
106-**Syntax:**106+**Syntax:**
107-```mlir107+```mlir
108-scf.if %condition {108+scf.if %condition {
109- // then block109+ // then block
110-}110+}
111- 111+ 
112-scf.if %condition {112+scf.if %condition {
113- // then block113+ // then block
114-} else {114+} else {
115- // else block115+ // else block
116-}116+}
117- 117+ 
118-%result = scf.if %condition -> type {118+%result = scf.if %condition -> type {
119- // then block119+ // then block
120- scf.yield %value : type120+ scf.yield %value : type
121-} else {121+} else {
122- // else block122+ // else block
123- scf.yield %other : type123+ scf.yield %other : type
124-}124+}
125-```125+```
126- 126+ 
127-**Operands:**127+**Operands:**
128-- `condition`: Boolean condition (i1)128+- `condition`: Boolean condition (i1)
129- 129+ 
130-**Results:**130+**Results:**
131-- Values yielded from branches (if any)131+- Values yielded from branches (if any)
132- 132+ 
133-**Example:**133+**Example:**
134-```mlir134+```mlir
135-// Simple if135+// Simple if
136-scf.if %condition {136+scf.if %condition {
137- // then block137+ // then block
138-}138+}
139- 139+ 
140-// If-else140+// If-else
141-scf.if %condition {141+scf.if %condition {
142- // then block142+ // then block
143-} else {143+} else {
144- // else block144+ // else block
145-}145+}
146- 146+ 
147-// If with results147+// If with results
148-%result = scf.if %condition -> i32 {148+%result = scf.if %condition -> i32 {
149- %value = arith.constant 1 : i32149+ %value = arith.constant 1 : i32
150- scf.yield %value : i32150+ scf.yield %value : i32
151-} else {151+} else {
152- %value = arith.constant 0 : i32152+ %value = arith.constant 0 : i32
153- scf.yield %value : i32153+ scf.yield %value : i32
154-}154+}
155-```155+```
156- 156+ 
157----157+---
158- 158+ 
159-### scf.index_switch - Index Switch159+### scf.index_switch - Index Switch
160- 160+ 
161-**Description:** Switch statement based on an index value with multiple cases and a default case.161+**Description:** Switch statement based on an index value with multiple cases and a default case.
162- 162+ 
163-**Syntax:**163+**Syntax:**
164-```mlir164+```mlir
165-%result = scf.index_switch %arg -> type165+%result = scf.index_switch %arg -> type
166- case 0 {166+ case 0 {
167- // case 0 block167+ // case 0 block
168- scf.yield %value0 : type168+ scf.yield %value0 : type
169- }169+ }
170- case 1 {170+ case 1 {
171- // case 1 block171+ // case 1 block
172- scf.yield %value1 : type172+ scf.yield %value1 : type
173- }173+ }
174- default {174+ default {
175- // default block175+ // default block
176- scf.yield %default_value : type176+ scf.yield %default_value : type
177- }177+ }
178-```178+```
179- 179+ 
180-**Operands:**180+**Operands:**
181-- `arg`: Index value to switch on181+- `arg`: Index value to switch on
182- 182+ 
183-**Attributes:**183+**Attributes:**
184-- `cases`: Array of case values184+- `cases`: Array of case values
185- 185+ 
186-**Example:**186+**Example:**
187-```mlir187+```mlir
188-%result = scf.index_switch %idx -> i32188+%result = scf.index_switch %idx -> i32
189- case 0 {189+ case 0 {
190- %c0 = arith.constant 10 : i32190+ %c0 = arith.constant 10 : i32
191- scf.yield %c0 : i32191+ scf.yield %c0 : i32
192- }192+ }
193- case 1 {193+ case 1 {
194- %c1 = arith.constant 20 : i32194+ %c1 = arith.constant 20 : i32
195- scf.yield %c1 : i32195+ scf.yield %c1 : i32
196- }196+ }
197- case 2 {197+ case 2 {
198- %c2 = arith.constant 30 : i32198+ %c2 = arith.constant 30 : i32
199- scf.yield %c2 : i32199+ scf.yield %c2 : i32
200- }200+ }
201- default {201+ default {
202- %cd = arith.constant 0 : i32202+ %cd = arith.constant 0 : i32
203- scf.yield %cd : i32203+ scf.yield %cd : i32
204- }204+ }
205-```205+```
206- 206+ 
207----207+---
208- 208+ 
209-## Region Operations209+## Region Operations
210- 210+ 
211-### scf.execute_region - Execute Region211+### scf.execute_region - Execute Region
212- 212+ 
213-**Description:** Execute a region exactly once. Allows multiple blocks within single-block contexts.213+**Description:** Execute a region exactly once. Allows multiple blocks within single-block contexts.
214- 214+ 
215-**Syntax:**215+**Syntax:**
216-```mlir216+```mlir
217-%result = scf.execute_region -> type {217+%result = scf.execute_region -> type {
218- // region body (can have multiple blocks)218+ // region body (can have multiple blocks)
219- scf.yield %value : type219+ scf.yield %value : type
220-}220+}
221- 221+ 
222-%result = scf.execute_region -> type no_inline {222+%result = scf.execute_region -> type no_inline {
223- // region body with no_inline attribute223+ // region body with no_inline attribute
224- scf.yield %value : type224+ scf.yield %value : type
225-}225+}
226-```226+```
227- 227+ 
228-**Attributes:**228+**Attributes:**
229-- `no_inline`: Optional flag to prevent inlining229+- `no_inline`: Optional flag to prevent inlining
230- 230+ 
231-**Semantics:**231+**Semantics:**
232-Executes the region exactly once. Useful for creating multi-block regions within operations that normally allow only single blocks.232+Executes the region exactly once. Useful for creating multi-block regions within operations that normally allow only single blocks.
233- 233+ 
234-**Example:**234+**Example:**
235-```mlir235+```mlir
236-// Simple execute region236+// Simple execute region
237-%result = scf.execute_region -> i32 {237+%result = scf.execute_region -> i32 {
238- %x = arith.constant 42 : i32238+ %x = arith.constant 42 : i32
239- scf.yield %x : i32239+ scf.yield %x : i32
240-}240+}
241- 241+ 
242-// With multiple blocks242+// With multiple blocks
243-%result = scf.execute_region -> i32 {243+%result = scf.execute_region -> i32 {
244- cf.cond_br %cond, ^bb1, ^bb2244+ cf.cond_br %cond, ^bb1, ^bb2
245-^bb1:245+^bb1:
246- %c1 = arith.constant 1 : i32246+ %c1 = arith.constant 1 : i32
247- cf.br ^bb3(%c1 : i32)247+ cf.br ^bb3(%c1 : i32)
248-^bb2:248+^bb2:
249- %c2 = arith.constant 2 : i32249+ %c2 = arith.constant 2 : i32
250- cf.br ^bb3(%c2 : i32)250+ cf.br ^bb3(%c2 : i32)
251-^bb3(%arg: i32):251+^bb3(%arg: i32):
252- scf.yield %arg : i32252+ scf.yield %arg : i32
253-}253+}
254- 254+ 
255-// With no_inline attribute255+// With no_inline attribute
256-%result = scf.execute_region -> i32 no_inline {256+%result = scf.execute_region -> i32 no_inline {
257- %x = arith.constant 42 : i32257+ %x = arith.constant 42 : i32
258- scf.yield %x : i32258+ scf.yield %x : i32
259-}259+}
260-```260+```
261- 261+ 
262----262+---
263- 263+ 
264-## Terminator Operations264+## Terminator Operations
265- 265+ 
266-### scf.yield - Yield Values266+### scf.yield - Yield Values
267- 267+ 
268-**Description:** Terminates regions within SCF operations and yields values to parent operation.268+**Description:** Terminates regions within SCF operations and yields values to parent operation.
269- 269+ 
270-**Syntax:**270+**Syntax:**
271-```mlir271+```mlir
272-scf.yield272+scf.yield
273-scf.yield %value : type273+scf.yield %value : type
274-scf.yield %value1, %value2 : type1, type2274+scf.yield %value1, %value2 : type1, type2
275-```275+```
276- 276+ 
277-**Semantics:**277+**Semantics:**
278-Used to terminate:278+Used to terminate:
279- 279+ 
280-- Loop bodies (`scf.for`, `scf.while` after region)280+- Loop bodies (`scf.for`, `scf.while` after region)
281- 281+ 
282-- Conditional branches (`scf.if`)282+- Conditional branches (`scf.if`)
283- 283+ 
284-- Execute regions (`scf.execute_region`)284+- Execute regions (`scf.execute_region`)
285- 285+ 
286-- Switch cases (`scf.index_switch`)286+- Switch cases (`scf.index_switch`)
287- 287+ 
288-**Example:**288+**Example:**
289-```mlir289+```mlir
290-// Yield single value290+// Yield single value
291-scf.yield %value : i32291+scf.yield %value : i32
292- 292+ 
293-// Yield multiple values293+// Yield multiple values
294-scf.yield %a, %b : i32, f32294+scf.yield %a, %b : i32, f32
295- 295+ 
296-// Yield no values296+// Yield no values
297-scf.yield297+scf.yield
298-```298+```
299- 299+ 
300----300+---
301- 301+ 
302-### scf.condition - Loop Continuation Condition302+### scf.condition - Loop Continuation Condition
303- 303+ 
304-**Description:** Terminates the "before" region of `scf.while`. If condition is true, continues to "after" region; otherwise exits loop.304+**Description:** Terminates the "before" region of `scf.while`. If condition is true, continues to "after" region; otherwise exits loop.
305- 305+ 
306-**Syntax:**306+**Syntax:**
307-```mlir307+```mlir
308-scf.condition(%condition) %args... : types...308+scf.condition(%condition) %args... : types...
309-```309+```
310- 310+ 
311-**Operands:**311+**Operands:**
312-- `condition`: Boolean condition (i1)312+- `condition`: Boolean condition (i1)
313-- `args`: Values to pass to "after" region or return from loop313+- `args`: Values to pass to "after" region or return from loop
314- 314+ 
315-**Semantics:**315+**Semantics:**
316-- If `condition` is true: execute "after" region with `args`316+- If `condition` is true: execute "after" region with `args`
317-- If `condition` is false: exit loop and return `args`317+- If `condition` is false: exit loop and return `args`
318- 318+ 
319-**Example:**319+**Example:**
320-```mlir320+```mlir
321-// In scf.while before region321+// In scf.while before region
322-%keep_going = arith.cmpi slt, %i, %limit : i32322+%keep_going = arith.cmpi slt, %i, %limit : i32
323-scf.condition(%keep_going) %i : i32323+scf.condition(%keep_going) %i : i32
324- 324+ 
325-// With multiple values325+// With multiple values
326-%cond = arith.cmpi slt, %i, %limit : i32326+%cond = arith.cmpi slt, %i, %limit : i32
327-scf.condition(%cond) %i, %sum : i32, i32327+scf.condition(%cond) %i, %sum : i32, i32
328-```328+```
329- 329+ 
330----330+---
331- 331+ 
332-## Common Patterns332+## Common Patterns
333- 333+ 
334-### Pattern 1: Simple Loop334+### Pattern 1: Simple Loop
335-```mlir335+```mlir
336-scf.for %i = %c0 to %c100 step %c1 {336+scf.for %i = %c0 to %c100 step %c1 {
337- // loop body337+ // loop body
338-}338+}
339-```339+```
340- 340+ 
341-### Pattern 2: Loop with Accumulator341+### Pattern 2: Loop with Accumulator
342-```mlir342+```mlir
343-%sum = scf.for %i = %c0 to %c100 step %c1 343+%sum = scf.for %i = %c0 to %c100 step %c1
344- iter_args(%acc = %c0) -> (i32) {344+ iter_args(%acc = %c0) -> (i32) {
345- %val = memref.load %array[%i] : memref<?xi32>345+ %val = memref.load %array[%i] : memref<?xi32>
346- %new_acc = arith.addi %acc, %val : i32346+ %new_acc = arith.addi %acc, %val : i32
347- scf.yield %new_acc : i32347+ scf.yield %new_acc : i32
348-}348+}
349-```349+```
350- 350+ 
351-### Pattern 3: Conditional with Results351+### Pattern 3: Conditional with Results
352-```mlir352+```mlir
353-%result = scf.if %cond -> i32 {353+%result = scf.if %cond -> i32 {
354- scf.yield %true_val : i32354+ scf.yield %true_val : i32
355-} else {355+} else {
356- scf.yield %false_val : i32356+ scf.yield %false_val : i32
357-}357+}
358-```358+```
359- 359+ 
360-### Pattern 4: While Loop360+### Pattern 4: While Loop
361-```mlir361+```mlir
362-%final = scf.while (%arg = %init) : (i32) -> i32 {362+%final = scf.while (%arg = %init) : (i32) -> i32 {
363- %keep_going = arith.cmpi slt, %arg, %limit : i32363+ %keep_going = arith.cmpi slt, %arg, %limit : i32
364- scf.condition(%keep_going) %arg : i32364+ scf.condition(%keep_going) %arg : i32
365-} do {365+} do {
366-^bb0(%arg: i32):366+^bb0(%arg: i32):
367- %next = arith.addi %arg, %c1 : i32367+ %next = arith.addi %arg, %c1 : i32
368- scf.yield %next : i32368+ scf.yield %next : i32
369-}369+}
370-```370+```
371- 371+ 
372-### Pattern 5: Nested Loops372+### Pattern 5: Nested Loops
373-```mlir373+```mlir
374-scf.for %i = %c0 to %M step %c1 {374+scf.for %i = %c0 to %M step %c1 {
375- scf.for %j = %c0 to %N step %c1 {375+ scf.for %j = %c0 to %N step %c1 {
376- // nested loop body376+ // nested loop body
377- }377+ }
378-}378+}
379-```379+```
380- 380+ 
381-### Pattern 6: Loop with Multiple Accumulators381+### Pattern 6: Loop with Multiple Accumulators
382-```mlir382+```mlir
383-%sum, %prod = scf.for %i = %c0 to %c100 step %c1 383+%sum, %prod = scf.for %i = %c0 to %c100 step %c1
384- iter_args(%acc_sum = %c0, %acc_prod = %c1) -> (i32, i32) {384+ iter_args(%acc_sum = %c0, %acc_prod = %c1) -> (i32, i32) {
385- %val = memref.load %array[%i] : memref<?xi32>385+ %val = memref.load %array[%i] : memref<?xi32>
386- %new_sum = arith.addi %acc_sum, %val : i32386+ %new_sum = arith.addi %acc_sum, %val : i32
387- %new_prod = arith.muli %acc_prod, %val : i32387+ %new_prod = arith.muli %acc_prod, %val : i32
388- scf.yield %new_sum, %new_prod : i32, i32388+ scf.yield %new_sum, %new_prod : i32, i32
389-}389+}
390-```390+```
391- 391+ 
392----392+---
393- 393+ 
@@ -1,4 +1,4 @@
1-# 控制流操作1+# 控制流操作
2 2 
3本文档描述来自 MLIR `scf`(结构化控制流)方言的结构化控制流操作。3本文档描述来自 MLIR `scf`(结构化控制流)方言的结构化控制流操作。
4 4