return Image(*v)
if k == 'Str' and f == 'latex':
# link page
- if v.startswith("[[") and v.endswith("]]"):
- link = v[2:-2]
- out.write(" link %s\n" % link)
- lookups = {'sv': 'Scalable Vectors for Power ISA',
- 'SV|sv': 'Scalable Vectors for Power ISA',
- 'sv/overview': 'Overview Chapter',
- 'sv/compliancy_levels': 'Compliancy Levels',
- 'sv/svp64': 'SVP64 Chapter',
- 'sv/sprs': 'SPRs',
- 'sv/normal': 'Arithmetic Mode',
- 'sv/ldst': 'Load/Store Mode',
- 'sv/cr_ops': 'Condition Register Fields Mode',
- 'sv/branches': 'Branch Mode',
- 'sv/setvl': 'setvl instruction',
- 'sv/svstep': 'svstep instruction',
- 'sv/remap': 'REMAP subsystem',
- 'sv/mv.swizzle': 'Swizzle Move',
- 'sv/mv.vec': 'Pack / Unpack',
- 'svp64/appendix': 'SVP64 Appendix',
- 'sv/svp64_quirks': 'SVP64 Quirks',
- 'openpower/isa/simplev': 'Simple-V pseudocode',
- 'sv/opcode_regs_deduped': 'SVP64 Augmentation Table',
- }
- if link in lookups:
- out.write(" found %s\n" % lookups[link])
- return Link(['', [], []],
- [Str(lookups[link])],
- ['#%s' % link, ''])
- if '|' in link:
- link, ref = link.split("|")
- return Link(['', [], []],
- [Str(link)],
- [ref, ''])
+ if not v.startswith("[["):
+ return
+ find_brack = v.find(']]')
+ if find_brack == -1:
+ return
+ link = v[2:find_brack-2]
+ out.write(" link %s\n" % link)
+ lookups = {'sv': 'Scalable Vectors for Power ISA',
+ 'SV|sv': 'Scalable Vectors for Power ISA',
+ 'sv/overview': 'Overview Chapter',
+ 'sv/compliancy_levels': 'Compliancy Levels',
+ 'sv/svp64': 'SVP64 Chapter',
+ 'sv/sprs': 'SPRs',
+ 'sv/normal': 'Arithmetic Mode',
+ 'sv/ldst': 'Load/Store Mode',
+ 'sv/cr_ops': 'Condition Register Fields Mode',
+ 'sv/branches': 'Branch Mode',
+ 'sv/setvl': 'setvl instruction',
+ 'sv/svstep': 'svstep instruction',
+ 'sv/remap': 'REMAP subsystem',
+ 'sv/mv.swizzle': 'Swizzle Move',
+ 'sv/mv.vec': 'Pack / Unpack',
+ 'svp64/appendix': 'SVP64 Appendix',
+ 'sv/svp64_quirks': 'SVP64 Quirks',
+ 'openpower/isa/simplev': 'Simple-V pseudocode',
+ 'sv/opcode_regs_deduped': 'SVP64 Augmentation Table',
+ }
+ if link in lookups:
+ out.write(" found %s\n" % lookups[link])
+ return [Link(['', [], []],
+ [Str(lookups[link])],
+ ['#%s' % link, '']), Str(v[find_brack:])]
+ if '|' in link:
+ link, ref = link.split("|")
+ return [Link(['', [], []],
+ [Str(link)],
+ [ref, '']), Str(v[find_brack:])]
if k == 'Link':
out.write(" link type %s\n" % \
(type(v[1][0])))