VAX: Remove `c' operand format specifier overload

The `c' operand format specifier is handled directly by the middle end
in `output_asm_insn':

   %cN means require operand N to be a constant
      and print the constant expression with no punctuation.

however it resorts to the target for constants that are not valid
addresses:

	    else if (letter == 'c')
	      {
		if (CONSTANT_ADDRESS_P (operands[opnum]))
		  output_addr_const (asm_out_file, operands[opnum]);
		else
		  output_operand (operands[opnum], 'c');
	      }

The VAX backend expects the fallback never to happen and overloads `c'
with the branch condition code.  This is confusing however and it is not
like we are short of letters, so instead make the branch condition code
use `k', and then for consistency make `K' the reverse branch condition
code format specifier.  This is safe to do as we provide no means to use
a computed branch condition code in user `asm'.

	gcc/
	* config/vax/vax.c (print_operand): Replace `c' and `C' with
	`k' and `K' respectively.
	* config/vax/vax.md (*branch, *branch_reversed): Update
	accordingly.
This commit is contained in:
Maciej W. Rozycki 2020-12-05 18:26:24 +00:00
parent a27d5f9a73
commit 91ae8fbc5a
2 changed files with 4 additions and 4 deletions

View File

@ -509,9 +509,9 @@ print_operand (FILE *file, rtx x, int code)
fputc (ASM_DOUBLE_CHAR, file);
else if (code == '|')
fputs (REGISTER_PREFIX, file);
else if (code == 'c')
else if (code == 'k')
fputs (cond_name (x), file);
else if (code == 'C')
else if (code == 'K')
fputs (rev_cond_name (x), file);
else if (code == 'D' && CONST_INT_P (x) && INTVAL (x) < 0)
fprintf (file, "$" NEG_HWI_PRINT_HEX16, INTVAL (x));

View File

@ -1111,7 +1111,7 @@
(label_ref (match_operand 1 "" ""))
(pc)))]
""
"j%c0 %l1")
"j%k0 %l1")
;; Recognize reversed jumps.
(define_insn "*branch_reversed"
@ -1122,7 +1122,7 @@
(pc)
(label_ref (match_operand 1 "" ""))))]
""
"j%C0 %l1") ; %C0 negates condition
"j%K0 %l1") ; %K0 negates condition
;; Recognize jbs, jlbs, jbc and jlbc instructions. Note that the operand
;; of jlbs and jlbc insns are SImode in the hardware. However, if it is