blob: fcf45df13447e627bee7596ac388514cf3772e56 [file]
<!-- Copyright (c) 2010-2025 Arm Limited or its affiliates. All rights reserved. -->
<!-- This document is Non-confidential and licensed under the BSD 3-clause license. -->
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<!--FAVICON.ico-->
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-TileImage" content="../img/mstile-144x144.png">
<link rel="icon" href="../img/favicon.ico">
<title>Instruction.Operation - ARM Machine Readable Schema - 2.6.3</title>
<!--CSS-->
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="../css/schema.css">
<link rel="stylesheet" type="text/css" href="../css/hljs-github.css">
</head>
<body>
<div class="container">
<div class="row heading">
<div class="col-md-6 pull-left"><a href="../index.html"><img src="../img/arm.svg" class="logo" /></a></div>
<div class="col-md-6 pull-left"><h1>AARCHMRS Schema <small>2.6.3</small></h1></div>
<!--Show the home button-->
<a href="../index.html"><div class="back-to-home">&nlarr; Home</div></a>
</div>
</div>
<div class="container">
<div class="row">
<h2>
<span class="title-namespace">Instruction.</span><span class=" title-type">Operation</span>
<!-- if oneOf is set, then type is ignored -->
<span class="type">object</span>
</h2>
<div class="static-markdown"><p>An instance of <a class="schema_link" href="../Instruction/Operation_schema.html" title="Instruction.Operation">Operation</a> defines an operation in the instruction set and
includes operation ASL pseudocode that is used by one or more instructions.</p>
<p>If an <a class="schema_link" href="../Instruction/Operation_schema.html" title="Instruction.Operation">Operation</a> is referred to by more than one instruction, it may contain
decode ASL pseudocode, which defines the shared decode for all of those instructions.</p></div>
</div>
<div class="row">
<div>
<!-- A simple object -->
<h3 class="type">object</h3>
<table class="table table-hover properties">
<thead>
<tr>
<th class="col-md-4">Properties</th>
<th class="col-md-4">Type</th>
<th class="col-md-4">Description</th>
</tr>
</thead>
<tbody>
<!-- properties -->
<tr id="/properties/_meta" class="property">
<th class="col-md-4">
<a href="#/properties/_meta">_meta</a>
</th>
<td class="col-md-4">
<a href="../Meta_schema.html" class="schema_link">Meta</a>
</td>
<td class="col-md-4">
<div><p>Metadata</p></div>
<div>
See
<a href="../Meta_schema.html" class="schema_link">Meta</a>
for more information.
</div>
</td>
</tr>
<tr id="/properties/_type" class="property">
<th class="col-md-4">
<a href="#/properties/_type">_type</a>
</th>
<td class="col-md-4">
</td>
<td class="col-md-4">
<dl>
<dt>Enum</dt>
<dd>
<code>Instruction.Operation</code>
</dd>
</dl>
</td>
</tr>
<tr id="/properties/brief" class="property">
<th class="col-md-4">
<a href="#/properties/brief">brief<sup>&loz;</sup></a>
</th>
<td class="col-md-4">
<a href="OperationAbstract_schema.html#/definitions/brief" class="schema_link">OperationAbstract</a>
</td>
<td class="col-md-4">
<div>
See
<a href="OperationAbstract_schema.html#/definitions/brief" class="schema_link">definitions.brief</a> in
<a href="OperationAbstract_schema.html#/definitions/brief" class="schema_link">OperationAbstract</a>
for more information.
</div>
</td>
</tr>
<tr id="/properties/decode" class="property">
<th class="col-md-4">
<a href="#/properties/decode">decode</a>
</th>
<td class="col-md-4">
<a href="../Text_schema.html" class="schema_link">Text</a>
</td>
<td class="col-md-4">
<div><p>Shared decode. null when no shared decode applies.</p></div>
<div>
See
<a href="../Text_schema.html" class="schema_link">Text</a>
for more information.
</div>
</td>
</tr>
<tr id="/properties/description" class="property">
<th class="col-md-4">
<a href="#/properties/description">description<sup>&loz;</sup></a>
</th>
<td class="col-md-4">
<a href="OperationAbstract_schema.html#/definitions/description" class="schema_link">OperationAbstract</a>
</td>
<td class="col-md-4">
<div>
See
<a href="OperationAbstract_schema.html#/definitions/description" class="schema_link">definitions.description</a> in
<a href="OperationAbstract_schema.html#/definitions/description" class="schema_link">OperationAbstract</a>
for more information.
</div>
</td>
</tr>
<tr id="/properties/operation" class="property">
<th class="col-md-4">
<a href="#/properties/operation">operation<sup>&loz;</sup></a>
</th>
<td class="col-md-4">
<a href="../Text_schema.html" class="schema_link">Text</a>
</td>
<td class="col-md-4">
<div><p>ASL code describing the operation of one or more instructions.</p></div>
<div>
See
<a href="../Text_schema.html" class="schema_link">Text</a>
for more information.
</div>
</td>
</tr>
<tr id="/properties/title" class="property">
<th class="col-md-4">
<a href="#/properties/title">title<sup>&loz;</sup></a>
</th>
<td class="col-md-4">
<a href="OperationAbstract_schema.html#/definitions/title" class="schema_link">OperationAbstract</a>
</td>
<td class="col-md-4">
<div>
See
<a href="OperationAbstract_schema.html#/definitions/title" class="schema_link">definitions.title</a> in
<a href="OperationAbstract_schema.html#/definitions/title" class="schema_link">OperationAbstract</a>
for more information.
</div>
</td>
</tr>
<!-- patternProperties -->
<!-- object property attributes -->
<tr>
<td colspan="3">
<dl>
<dt>Additional Properties</dt>
<dd>Not Allowed</dd>
</dl>
</td>
</tr>
<tr>
<td colspan="3">
<dl>
<dt>&loz; Required</dt>
<dd>Properties marked with &loz; are required properties.</dd>
</dl>
</td>
</tr>
</tbody>
</table>
<!-- array, and it has described items -->
</div>
<h5>Examples</h5>
<div>
<pre class="schema-json"><code class="language-json">{
&#34;_type&#34;: &#34;Instruction.Operation&#34;,
&#34;operation&#34;: [
[
&#34;bits(datasize) result;&#34;,
&#34;bits(datasize) operand1 = X[n, datasize];&#34;,
&#34;bits(datasize) operand2 = X[m, datasize];&#34;,
&#34;bits(4) nzcv;&#34;,
&#34;if sub_op then&#34;,
&#34; operand2 = NOT(operand2);&#34;,
&#34;(result, nzcv) = AddWithCarry(operand1, operand2, PSTATE.C);&#34;,
&#34;if setflags then&#34;,
&#34; PSTATE.&lt;N,Z,C,V&gt; = nzcv;&#34;,
&#34;X[d, datasize] = result;&#34;
]
],
&#34;decode&#34;: [
[
&#34;integer d = UInt(Rd);&#34;,
&#34;integer n = UInt(Rn);&#34;,
&#34;integer m = UInt(Rm);&#34;,
&#34;integer datasize = if sf == &#39;1&#39; then 64 else 32;&#34;,
&#34;boolean sub_op = (op == &#39;1&#39;);&#34;,
&#34;boolean setflags = (S == &#39;1&#39;);&#34;
]
],
&#34;description&#34;: &#34;Subtract with Carry subtracts a register value and the value of NOT (Carry flag) from a register value, and writes the result to the destination register.&#34;,
&#34;brief&#34;: &#34;SBC&#34;,
&#34;title&#34;: &#34;SBC&#34;
}</code></pre>
</div>
</div>
<div class="row schema">
<h3>Schema <small><a href="http://json-schema.org/draft-04/schema#">http://json-schema.org/draft-04/schema#</a></small></h3>
<pre class="schema-json"><code class="language-json">{
"type": "object",
"info": [
[
"An instance of $(~Instruction.Operation) defines an operation in the instruction set and",
"includes operation ASL pseudocode that is used by one or more instructions."
],
[
"If an $(~Instruction.Operation) is referred to by more than one instruction, it may contain",
"decode ASL pseudocode, which defines the shared decode for all of those instructions."
]
],
"properties": {
"_meta": {
"$ref": "../Meta.json",
"info": [
"Metadata"
]
},
"_type": {
"enum": [
"Instruction.Operation"
]
},
"operation": {
"info": [
"ASL code describing the operation of one or more instructions."
],
"$ref": "../Text.json"
},
"decode": {
"info": [
"Shared decode. null when no shared decode applies."
],
"$ref": "../Text.json"
},
"description": {
"$ref": "OperationAbstract.json#/definitions/description"
},
"brief": {
"$ref": "OperationAbstract.json#/definitions/brief"
},
"title": {
"$ref": "OperationAbstract.json#/definitions/title"
}
},
"required": [
"operation",
"brief",
"title",
"description"
],
"additionalProperties": false,
"examples": [
{
"_type": "Instruction.Operation",
"operation": [
[
"bits(datasize) result;",
"bits(datasize) operand1 = X[n, datasize];",
"bits(datasize) operand2 = X[m, datasize];",
"bits(4) nzcv;",
"if sub_op then",
" operand2 = NOT(operand2);",
"(result, nzcv) = AddWithCarry(operand1, operand2, PSTATE.C);",
"if setflags then",
" PSTATE.<N,Z,C,V> = nzcv;",
"X[d, datasize] = result;"
]
],
"decode": [
[
"integer d = UInt(Rd);",
"integer n = UInt(Rn);",
"integer m = UInt(Rm);",
"integer datasize = if sf == '1' then 64 else 32;",
"boolean sub_op = (op == '1');",
"boolean setflags = (S == '1');"
]
],
"description": "Subtract with Carry subtracts a register value and the value of NOT (Carry flag) from a register value, and writes the result to the destination register.",
"brief": "SBC",
"title": "SBC"
}
],
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Instruction.Operation"
}</code></pre>
</div>
</div>
<div class="container">
<div class="footer text-right">
Copyright &copy; 2025 ARM Limited or its affiliates. All rights reserved.
</div>
</div>
<script src="../js/highlight/highlight.js"></script>
<script src="../js/highlight/languages/json.min.js"></script>
<script src="../js/highlight/languages/django.min.js"></script> <!-- JINJA2 -->
<script src="../js/highlight/languages/yaml.min.js"></script>
<script src="../js/highlight/languages/isa.js"></script>
<script type="text/javascript">
window.onload = function() {
hljs.configure({
cssSelector: ".schema-json code, .includes code, pre code",
noHighlightRe: /^(no-?highlight|nohl)$/i,
});
hljs.highlightAll()
};
</script>
</body>
</html>