MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / getConditionalOpcode

Function getConditionalOpcode

lib/asm-docs/arm.ts:59–74  ·  view source on GitHub ↗

Add additional notes for conditional instructions

(instruction: string)

Source from the content-addressed store, hash-verified

57
58 /** Add additional notes for conditional instructions */
59 private getConditionalOpcode(instruction: string): AssemblyInstructionInfo | null {
60 // If the instruction is a conditional instruction
61 const isConditionalOpcode = instruction.match(ArmBaseDocumentationProvider.CONDITIONAL_INSTRUCTION_REGEXP);
62 if (!isConditionalOpcode) {
63 return null;
64 }
65 const information = this.getAsmOpcode(isConditionalOpcode[1]);
66 if (!information) return null;
67 const maybeCondition = ArmBaseDocumentationProvider.CONDITIONAL_OPCODE_TAGS[isConditionalOpcode[2]];
68 const text = maybeCondition ? `If ${maybeCondition}: ` : '';
69 return {
70 ...information,
71 tooltip: text + information.tooltip,
72 html: text + information.html,
73 };
74 }
75}
76
77export class Arm32DocumentationProvider extends ArmBaseDocumentationProvider {

Callers

nothing calls this directly

Calls 2

matchMethod · 0.80
getAsmOpcodeMethod · 0.45

Tested by

no test coverage detected