hppa: Implement TARGET_ATOMIC_ASSIGN_EXPAND_FENV
commit1c3cfb5a95dcc7f797ec2815690a6291878580c4
authorJohn David Anglin <danglin@gcc.gnu.org>
Fri, 2 Feb 2024 18:05:06 +0000 (2 18:05 +0000)
committerJohn David Anglin <danglin@gcc.gnu.org>
Fri, 2 Feb 2024 18:05:06 +0000 (2 18:05 +0000)
treeafc5506eac14ad14f5682dc312e19772b7b16aac
parent922e4599e6261644d336b009b6901cd221ec95fd
hppa: Implement TARGET_ATOMIC_ASSIGN_EXPAND_FENV

This change implements __builtin_get_fpsr() and __builtin_set_fpsr(x)
to get and set the floating-point status register.  They are used to
implement pa_atomic_assign_expand_fenv().

2024-02-02  John David Anglin  <danglin@gcc.gnu.org>

gcc/ChangeLog:

PR target/59778
* config/pa/pa.cc (enum pa_builtins): Add PA_BUILTIN_GET_FPSR
and PA_BUILTIN_SET_FPSR builtins.
* (pa_builtins_icode): Declare.
* (def_builtin, pa_fpu_init_builtins): New.
* (pa_init_builtins): Initialize FPU builtins.
* (pa_builtin_decl, pa_expand_builtin_1): New.
* (pa_expand_builtin): Handle PA_BUILTIN_GET_FPSR and
PA_BUILTIN_SET_FPSR builtins.
* (pa_atomic_assign_expand_fenv): New.
* config/pa/pa.md (UNSPECV_GET_FPSR, UNSPECV_SET_FPSR): New
UNSPECV constants.
(get_fpsr, put_fpsr): New expanders.
(get_fpsr_32, get_fpsr_64, set_fpsr_32, set_fpsr_64): New
insn patterns.
gcc/config/pa/pa.cc
gcc/config/pa/pa.md