aarch64: Add support for FEAT_CMH

This patch adds the new instructions from FEAT_CMH
These new instructions are hints, STCPH and SHUH.
SHUH can have an operand PH or no operand.
This commit is contained in:
Richard Ball
2026-01-16 12:35:29 +00:00
parent 542ed77ff7
commit 19ffb6d2d7
14 changed files with 64 additions and 5 deletions

View File

@@ -4619,7 +4619,9 @@ parse_hint_opt (const char *name, char **str,
&& (o->value != HINT_OPD_C && o->value != HINT_OPD_J
&& o->value != HINT_OPD_JC && o->value != HINT_OPD_R))
|| ((strcmp ("stshh", name) == 0)
&& (o->value != HINT_OPD_KEEP && o->value != HINT_OPD_STRM)))
&& (o->value != HINT_OPD_KEEP && o->value != HINT_OPD_STRM))
|| ((strcmp ("shuh", name) == 0)
&& (o->value != HINT_OPD_PHINT)))
return false;
*str = q;
@@ -6436,6 +6438,7 @@ process_omitted_operand (enum aarch64_opnd type, const aarch64_opcode *opcode,
break;
case AARCH64_OPND_BTI_TARGET:
case AARCH64_OPND_SHUH_PHINT:
operand->hint_option = aarch64_hint_options + default_value;
break;
@@ -8314,6 +8317,7 @@ parse_operands (char *str, const aarch64_opcode *opcode)
break;
case AARCH64_OPND_BTI_TARGET:
case AARCH64_OPND_SHUH_PHINT:
if (!parse_hint_opt (opcode->name, &str, &(info->hint_option)))
goto failure;
break;

View File

@@ -0,0 +1,4 @@
#name: Negative test of CMH instructions.
#as: -march=armv8-a
#source: cmh-bad.s
#error_output: cmh-bad.l

View File

@@ -0,0 +1,3 @@
[^ :]+: Assembler messages:
[^ :]+:[0-9]+: Error: operand 1 must be an optional priority hint \(ph\) -- `shuh p'
[^ :]+:[0-9]+: Error: unexpected characters following instruction -- `stcph ph'

View File

@@ -0,0 +1,3 @@
a:
shuh p
stcph ph

View File

@@ -0,0 +1,11 @@
#as: -march=armv8-a
#objdump: -dr
.*: file format .*
Disassembly of section \.text:
0+ <.*>:
.*: d503265f shuh
.*: d503267f shuh ph
.*: d503269f stcph

View File

@@ -0,0 +1,4 @@
a:
shuh
shuh ph
stcph

View File

@@ -68,9 +68,9 @@ Disassembly of section \.text:
.*: d50325ff hint #0x2f
.*: d503261f (hint #0x30|stshh keep)
.*: d503263f (hint #0x31|stshh strm)
.*: d503265f hint #0x32
.*: d503267f hint #0x33
.*: d503269f hint #0x34
.*: d503265f (hint #0x32|shuh)
.*: d503267f (hint #0x33|shuh ph)
.*: d503269f (hint #0x34|stcph)
.*: d50326bf hint #0x35
.*: d50326df hint #0x36
.*: d50326ff hint #0x37