Skip to content

Commit 618ba48

Browse files
Handle a syntax corner case where a def does not end with a ;
1 parent f402cfe commit 618ba48

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/intrinsic/archs.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,18 @@ match name {
110110
"llvm.amdgcn.s.dcache.inv.vol" => "__builtin_amdgcn_s_dcache_inv_vol",
111111
"llvm.amdgcn.s.dcache.wb" => "__builtin_amdgcn_s_dcache_wb",
112112
"llvm.amdgcn.s.dcache.wb.vol" => "__builtin_amdgcn_s_dcache_wb_vol",
113+
"llvm.amdgcn.s.decperflevel" => "__builtin_amdgcn_s_decperflevel",
113114
"llvm.amdgcn.s.get.waveid.in.workgroup" => "__builtin_amdgcn_s_get_waveid_in_workgroup",
114115
"llvm.amdgcn.s.getpc" => "__builtin_amdgcn_s_getpc",
115116
"llvm.amdgcn.s.getreg" => "__builtin_amdgcn_s_getreg",
117+
"llvm.amdgcn.s.incperflevel" => "__builtin_amdgcn_s_incperflevel",
116118
"llvm.amdgcn.s.memrealtime" => "__builtin_amdgcn_s_memrealtime",
117119
"llvm.amdgcn.s.memtime" => "__builtin_amdgcn_s_memtime",
118120
"llvm.amdgcn.s.sendmsg" => "__builtin_amdgcn_s_sendmsg",
119121
"llvm.amdgcn.s.sendmsghalt" => "__builtin_amdgcn_s_sendmsghalt",
120122
"llvm.amdgcn.s.setprio" => "__builtin_amdgcn_s_setprio",
121123
"llvm.amdgcn.s.setreg" => "__builtin_amdgcn_s_setreg",
122-
"llvm.amdgcn.s.sleep" => "__builtin_amdgcn_s_decperflevel",
123-
// [DUPLICATE]: "llvm.amdgcn.s.sleep" => "__builtin_amdgcn_s_incperflevel",
124-
// [DUPLICATE]: "llvm.amdgcn.s.sleep" => "__builtin_amdgcn_s_sleep",
124+
"llvm.amdgcn.s.sleep" => "__builtin_amdgcn_s_sleep",
125125
"llvm.amdgcn.s.waitcnt" => "__builtin_amdgcn_s_waitcnt",
126126
"llvm.amdgcn.sad.hi.u8" => "__builtin_amdgcn_sad_hi_u8",
127127
"llvm.amdgcn.sad.u16" => "__builtin_amdgcn_sad_u16",
@@ -2689,6 +2689,10 @@ match name {
26892689
"llvm.ppc.vsx.xvresp" => "__builtin_vsx_xvresp",
26902690
"llvm.ppc.vsx.xvrsqrtedp" => "__builtin_vsx_xvrsqrtedp",
26912691
"llvm.ppc.vsx.xvrsqrtesp" => "__builtin_vsx_xvrsqrtesp",
2692+
"llvm.ppc.vsx.xxblendvb" => "__builtin_vsx_xxblendvb",
2693+
"llvm.ppc.vsx.xxblendvd" => "__builtin_vsx_xxblendvd",
2694+
"llvm.ppc.vsx.xxblendvh" => "__builtin_vsx_xxblendvh",
2695+
"llvm.ppc.vsx.xxblendvw" => "__builtin_vsx_xxblendvw",
26922696
"llvm.ppc.vsx.xxpermx" => "__builtin_vsx_xxpermx",
26932697
// ptx
26942698
"llvm.ptx.bar.sync" => "__builtin_ptx_bar_sync",

tools/generate_intrinsics.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ def extract_instrinsics(intrinsics, file):
6060
current_arch = None
6161
elif line.startswith("def "):
6262
content = ""
63-
while not content.endswith(";") and pos < len(lines):
63+
while not content.endswith(";") and not content.endswith("}") and pos < len(lines):
6464
line = lines[pos].split(" // ")[0].strip()
6565
content += line
6666
pos += 1
6767
entries = re.findall('GCCBuiltin<"(\\w+)">', content)
6868
if len(entries) > 0:
69-
intrinsic = content.split(":")[0].split(" ")[1].strip()
69+
intrinsic = content.split("def ")[1].strip().split(":")[0].strip()
7070
intrinsic = intrinsic.split("_")
7171
if len(intrinsic) < 2 or intrinsic[0] != "int":
7272
continue

0 commit comments

Comments
 (0)