[v5,01/11] RISC-V: Eliminate SYNC memory models
Checks
Commit Message
Remove references to MEMMODEL_SYNC_* models by converting via
memmodel_base().
2023-04-27 Patrick O'Neill <patrick@rivosinc.com>
gcc/ChangeLog:
* config/riscv/riscv.cc: Remove MEMMODEL_SYNC_* cases and
sanitize memmodel input with memmodel_base.
Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
---
gcc/config/riscv/riscv.cc | 11 +++--------
1 file changed, 3 insertions(+), 8 deletions(-)
Comments
On 4/27/23 10:22, Patrick O'Neill wrote:
> Remove references to MEMMODEL_SYNC_* models by converting via
> memmodel_base().
>
> 2023-04-27 Patrick O'Neill <patrick@rivosinc.com>
>
> gcc/ChangeLog:
>
> * config/riscv/riscv.cc: Remove MEMMODEL_SYNC_* cases and
> sanitize memmodel input with memmodel_base.
OK. Not sure if you want to commit it now or wait for the full set to
get ACK'd (since there are some questions on the trailing sync approach).
Jeff
On 4/28/23 09:23, Jeff Law wrote:
> On 4/27/23 10:22, Patrick O'Neill wrote:
>> Remove references to MEMMODEL_SYNC_* models by converting via
>> memmodel_base().
>>
>> 2023-04-27 Patrick O'Neill <patrick@rivosinc.com>
>>
>> gcc/ChangeLog:
>>
>> * config/riscv/riscv.cc: Remove MEMMODEL_SYNC_* cases and
>> sanitize memmodel input with memmodel_base.
> OK. Not sure if you want to commit it now or wait for the full set to
> get ACK'd (since there are some questions on the trailing sync approach).
>
> Jeff
Committed.
Patrick
@@ -4299,14 +4299,11 @@ riscv_memmodel_needs_amo_acquire (enum memmodel model)
{
case MEMMODEL_ACQ_REL:
case MEMMODEL_SEQ_CST:
- case MEMMODEL_SYNC_SEQ_CST:
case MEMMODEL_ACQUIRE:
case MEMMODEL_CONSUME:
- case MEMMODEL_SYNC_ACQUIRE:
return true;
case MEMMODEL_RELEASE:
- case MEMMODEL_SYNC_RELEASE:
case MEMMODEL_RELAXED:
return false;
@@ -4325,14 +4322,11 @@ riscv_memmodel_needs_release_fence (enum memmodel model)
{
case MEMMODEL_ACQ_REL:
case MEMMODEL_SEQ_CST:
- case MEMMODEL_SYNC_SEQ_CST:
case MEMMODEL_RELEASE:
- case MEMMODEL_SYNC_RELEASE:
return true;
case MEMMODEL_ACQUIRE:
case MEMMODEL_CONSUME:
- case MEMMODEL_SYNC_ACQUIRE:
case MEMMODEL_RELAXED:
return false;
@@ -4371,6 +4365,7 @@ riscv_print_operand (FILE *file, rtx op, int letter)
}
machine_mode mode = GET_MODE (op);
enum rtx_code code = GET_CODE (op);
+ const enum memmodel model = memmodel_base (INTVAL (op));
switch (letter)
{
@@ -4508,12 +4503,12 @@ riscv_print_operand (FILE *file, rtx op, int letter)
break;
case 'A':
- if (riscv_memmodel_needs_amo_acquire ((enum memmodel) INTVAL (op)))
+ if (riscv_memmodel_needs_amo_acquire (model))
fputs (".aq", file);
break;
case 'F':
- if (riscv_memmodel_needs_release_fence ((enum memmodel) INTVAL (op)))
+ if (riscv_memmodel_needs_release_fence (model))
fputs ("fence iorw,ow; ", file);
break;