@@ -2160,6 +2160,18 @@
rscratch1, stlrb);
%}
+ // Special case of storing 0 to volatile for storing into card table
+ enc_class aarch64_enc_stlrb0(memory mem) %{
+ Label skip;
+ {
+ MacroAssembler _masm(&cbuf);
+ __ ldrb(rscratch1, as_Register($mem$$base));
+ __ cbz(rscratch1, skip);
+ }
+ MOV_VOLATILE(zr, $mem$$base, $mem$$index, $mem$$scale, $mem$$disp, rscratch1, stlrb);
+ __ bind(skip);
+ %}
+
enc_class aarch64_enc_stlrh(iRegI src, memory mem) %{
MOV_VOLATILE(as_Register($src$$reg), $mem$$base, $mem$$index, $mem$$scale, $mem$$disp,
rscratch1, stlrh);
@@ -5909,6 +5921,19 @@
ins_pipe(pipe_class_memory);
%}
+// Special rule for store of 0 byte to volatile for card table
+instruct storeB_volatile_imm0(immI0 zero, /* sync_memory*/indirect mem)
+%{
+ match(Set mem (StoreB mem zero));
+
+ ins_cost(VOLATILE_REF_COST);
+ format %{ "stlrb zr, $mem\t# byte" %}
+
+ ins_encode(aarch64_enc_stlrb0(mem));
+
+ ins_pipe(pipe_class_memory);
+%}
+
// Store Char/Short
instruct storeC_volatile(iRegI src, /* sync_memory*/indirect mem)
%{
@@ -1081,7 +1081,7 @@
Register Rn, enum operand_size sz, int op, int o0) {
starti;
f(sz, 31, 30), f(0b001000, 29, 24), f(op, 23, 21);
- rf(Rs, 16), f(o0, 15), rf(Rt2, 10), rf(Rn, 5), rf(Rt1, 0);
+ rf(Rs, 16), f(o0, 15), rf(Rt2, 10), rf(Rn, 5), zrf(Rt1, 0);
}
#define INSN4(NAME, sz, op, o0) /* Four registers */ \