fputs (GET_RTX_NAME (reverse_condition (code)), file);
break;
- case 'A': {
- const enum memmodel model = memmodel_base (INTVAL (op));
- if (riscv_memmodel_needs_amo_acquire (model)
- && riscv_memmodel_needs_amo_release (model))
- fputs (".aqrl", file);
- else if (riscv_memmodel_needs_amo_acquire (model))
- fputs (".aq", file);
- else if (riscv_memmodel_needs_amo_release (model))
- fputs (".rl", file);
+ case 'A':
+ if (!CONST_INT_P (op))
+ output_operand_lossage ("invalid operand for '%%%c'", letter);
+ else
+ {
+ const enum memmodel model = memmodel_base (INTVAL (op));
+ if (riscv_memmodel_needs_amo_acquire (model)
+ && riscv_memmodel_needs_amo_release (model))
+ fputs (".aqrl", file);
+ else if (riscv_memmodel_needs_amo_acquire (model))
+ fputs (".aq", file);
+ else if (riscv_memmodel_needs_amo_release (model))
+ fputs (".rl", file);
+ }
break;
- }
- case 'I': {
- const enum memmodel model = memmodel_base (INTVAL (op));
- if (TARGET_ZTSO && model != MEMMODEL_SEQ_CST)
- /* LR ops only have an annotation for SEQ_CST in the Ztso mapping. */
- break;
- else if (model == MEMMODEL_SEQ_CST)
- fputs (".aqrl", file);
- else if (riscv_memmodel_needs_amo_acquire (model))
- fputs (".aq", file);
+ case 'I':
+ if (!CONST_INT_P (op))
+ output_operand_lossage ("invalid operand for '%%%c'", letter);
+ else
+ {
+ const enum memmodel model = memmodel_base (INTVAL (op));
+ if (TARGET_ZTSO && model != MEMMODEL_SEQ_CST)
+ /* LR ops only have an annotation for SEQ_CST in the Ztso mapping. */
+ break;
+ else if (model == MEMMODEL_SEQ_CST)
+ fputs (".aqrl", file);
+ else if (riscv_memmodel_needs_amo_acquire (model))
+ fputs (".aq", file);
+ }
break;
- }
- case 'J': {
- const enum memmodel model = memmodel_base (INTVAL (op));
- if (TARGET_ZTSO && model == MEMMODEL_SEQ_CST)
- /* SC ops only have an annotation for SEQ_CST in the Ztso mapping. */
- fputs (".rl", file);
- else if (TARGET_ZTSO)
- break;
- else if (riscv_memmodel_needs_amo_release (model))
- fputs (".rl", file);
+ case 'J':
+ if (!CONST_INT_P (op))
+ output_operand_lossage ("invalid operand for '%%%c'", letter);
+ else
+ {
+ const enum memmodel model = memmodel_base (INTVAL (op));
+ if (TARGET_ZTSO && model == MEMMODEL_SEQ_CST)
+ /* SC ops only have an annotation for SEQ_CST in the Ztso mapping. */
+ fputs (".rl", file);
+ else if (TARGET_ZTSO)
+ break;
+ else if (riscv_memmodel_needs_amo_release (model))
+ fputs (".rl", file);
+ }
break;
- }
case 'L':
- {
- const char *ntl_hint = NULL;
- switch (INTVAL (op))
- {
- case 0:
- ntl_hint = "ntl.all";
- break;
- case 1:
- ntl_hint = "ntl.pall";
- break;
- case 2:
- ntl_hint = "ntl.p1";
- break;
- }
+ if (!CONST_INT_P (op))
+ output_operand_lossage ("invalid operand for '%%%c'", letter);
+ else
+ {
+ const char *ntl_hint = NULL;
+ switch (INTVAL (op))
+ {
+ case 0:
+ ntl_hint = "ntl.all";
+ break;
+ case 1:
+ ntl_hint = "ntl.pall";
+ break;
+ case 2:
+ ntl_hint = "ntl.p1";
+ break;
+ }
- if (ntl_hint)
- asm_fprintf (file, "%s\n\t", ntl_hint);
+ if (ntl_hint)
+ asm_fprintf (file, "%s\n\t", ntl_hint);
+ }
break;
- }
case 'i':
if (code != REG)
break;
case 'S':
- {
- rtx newop = GEN_INT (ctz_hwi (INTVAL (op)));
- output_addr_const (file, newop);
- break;
- }
+ if (!CONST_INT_P (op))
+ output_operand_lossage ("invalid operand for '%%%c'", letter);
+ else
+ {
+ rtx newop = GEN_INT (ctz_hwi (INTVAL (op)));
+ output_addr_const (file, newop);
+ }
+ break;
case 'T':
- {
- rtx newop = GEN_INT (ctz_hwi (~INTVAL (op)));
- output_addr_const (file, newop);
- break;
- }
+ if (!CONST_INT_P (op))
+ output_operand_lossage ("invalid operand for '%%%c'", letter);
+ else
+ {
+ rtx newop = GEN_INT (ctz_hwi (~INTVAL (op)));
+ output_addr_const (file, newop);
+ }
+ break;
case 'X':
- {
- int ival = INTVAL (op) + 1;
- rtx newop = GEN_INT (ctz_hwi (ival) + 1);
- output_addr_const (file, newop);
- break;
- }
+ if (!CONST_INT_P (op))
+ output_operand_lossage ("invalid operand for '%%%c'", letter);
+ else
+ {
+ int ival = INTVAL (op) + 1;
+ rtx newop = GEN_INT (ctz_hwi (ival) + 1);
+ output_addr_const (file, newop);
+ }
+ break;
case 'Y':
- {
- unsigned int imm = (UINTVAL (op) & 63);
- gcc_assert (imm <= 63);
- rtx newop = GEN_INT (imm);
- output_addr_const (file, newop);
- break;
- }
+ if (!CONST_INT_P (op))
+ output_operand_lossage ("invalid operand for '%%%c'", letter);
+ else
+ {
+ unsigned int imm = (UINTVAL (op) & 63);
+ gcc_assert (imm <= 63);
+ rtx newop = GEN_INT (imm);
+ output_addr_const (file, newop);
+ }
+ break;
case 'N':
{
if (!REG_P(op))
else if (IN_RANGE (regno, V_REG_FIRST, V_REG_LAST))
offset = V_REG_FIRST;
else
- output_operand_lossage ("invalid register number for 'N' modifie");
+ output_operand_lossage ("invalid register number for 'N' modifier");
asm_fprintf (file, "%u", (regno - offset));
break;