Mercurial > hg > CbC > CbC_gcc
comparison gcc/config/riscv/sync.md @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children | 1830386684a0 |
comparison
equal
deleted
inserted
replaced
111:04ced10e8804 | 131:84e7813d76e9 |
---|---|
1 ;; Machine description for RISC-V atomic operations. | 1 ;; Machine description for RISC-V atomic operations. |
2 ;; Copyright (C) 2011-2017 Free Software Foundation, Inc. | 2 ;; Copyright (C) 2011-2018 Free Software Foundation, Inc. |
3 ;; Contributed by Andrew Waterman (andrew@sifive.com). | 3 ;; Contributed by Andrew Waterman (andrew@sifive.com). |
4 ;; Based on MIPS target for GNU compiler. | 4 ;; Based on MIPS target for GNU compiler. |
5 | 5 |
6 ;; This file is part of GCC. | 6 ;; This file is part of GCC. |
7 | 7 |
180 | 180 |
181 rtx shmt = gen_reg_rtx (SImode); | 181 rtx shmt = gen_reg_rtx (SImode); |
182 emit_move_insn (shmt, gen_rtx_ASHIFT (SImode, offset, GEN_INT (3))); | 182 emit_move_insn (shmt, gen_rtx_ASHIFT (SImode, offset, GEN_INT (3))); |
183 | 183 |
184 rtx word = gen_reg_rtx (SImode); | 184 rtx word = gen_reg_rtx (SImode); |
185 emit_move_insn (word, gen_rtx_ASHIFT (SImode, tmp, shmt)); | 185 emit_move_insn (word, gen_rtx_ASHIFT (SImode, tmp, |
186 gen_lowpart (QImode, shmt))); | |
186 | 187 |
187 tmp = gen_reg_rtx (SImode); | 188 tmp = gen_reg_rtx (SImode); |
188 emit_insn (gen_atomic_fetch_orsi (tmp, aligned_mem, word, model)); | 189 emit_insn (gen_atomic_fetch_orsi (tmp, aligned_mem, word, model)); |
189 | 190 |
190 emit_move_insn (gen_lowpart (SImode, result), | 191 emit_move_insn (gen_lowpart (SImode, result), |
191 gen_rtx_LSHIFTRT (SImode, tmp, | 192 gen_rtx_LSHIFTRT (SImode, tmp, |
192 gen_lowpart (SImode, shmt))); | 193 gen_lowpart (QImode, shmt))); |
193 DONE; | 194 DONE; |
194 }) | 195 }) |