return "";
}
-/* Print register name according to assembly dialect.
- In normal syntax registers are printed like %rN where N is the
- register number.
+/* Print register name according to assembly dialect. In normal
+ syntax registers are printed like %rN where N is the register
+ number.
+
In pseudoc syntax, the register names do not feature a '%' prefix.
- Additionally, the code 'w' denotes that the register should be printed
- as wN instead of rN, where N is the register number, but only when the
- value stored in the operand OP is 32-bit wide. */
+ Additionally, the code 'w' denotes that the register should be
+ printed as wN instead of rN, where N is the register number, but
+ only when the value stored in the operand OP is 32-bit wide.
+ Finally, the code 'W' denotes that the register should be printed
+ as wN instead of rN, in all cases, regardless of the mode of the
+ value stored in the operand. */
static void
bpf_print_register (FILE *file, rtx op, int code)
fprintf (file, "%s", reg_names[REGNO (op)]);
else
{
- if (code == 'w' && GET_MODE_SIZE (GET_MODE (op)) <= 4)
+ if (code == 'W' || (code == 'w' && GET_MODE_SIZE (GET_MODE (op)) <= 4))
{
if (REGNO (op) == BPF_FP)
fprintf (file, "w10");
(mult:SI (match_operand:SI 1 "register_operand" "0,0")
(match_operand:SI 2 "reg_or_imm_operand" "r,I"))))]
""
- "{mul32\t%0,%2|%w0 *= %w2}"
+ "{mul32\t%0,%2|%W0 *= %W2}"
[(set_attr "type" "alu32")])
;;; Division
--- /dev/null
+/* Make sure that we are emitting `wN *= wM' and not `rN *= wM' for a mul32 in
+ pseudo-C assembly syntax when emitting assembly for a recognized
+ *mulsidi3_zeroextend pattern. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -masm=pseudoc" } */
+
+unsigned long foo (unsigned snd_cwnd, unsigned mss_cache)
+{
+ return snd_cwnd * mss_cache;
+}
+
+/* { dg-final { scan-assembler-not {\tr. \*= w.\n} } } */
+/* { dg-final { scan-assembler {\tw. \*= w.\n} } } */