aboutsummaryrefslogtreecommitdiff
path: root/gcc/c
diff options
context:
space:
mode:
authorStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2023-09-11 18:11:31 +0200
committerStefan Schulze Frielinghaus <stefansf@linux.ibm.com>2023-09-11 18:11:31 +0200
commit248df13b966f46649e16dc3c8c92b263790ef503 (patch)
tree3e80d6a1b1251e0fe94490d5d6c6c8f925929697 /gcc/c
parent4a2766ed00a47904dc8b85bf0538aa116d8e658b (diff)
downloadgcc-248df13b966f46649e16dc3c8c92b263790ef503.zip
gcc-248df13b966f46649e16dc3c8c92b263790ef503.tar.gz
gcc-248df13b966f46649e16dc3c8c92b263790ef503.tar.bz2
s390: Fix builtins vec_rli and verll
The second argument of these builtins is an unsigned immediate. For vec_rli the API allows immediates up to 64 bits whereas the instruction verll only allows immediates up to 32 bits. Since the shift count equals the immediate modulo vector element size, truncating those immediates is fine. Passing a non-immediate argument to vec_rli already results in an error message without this patch: t.c: In function ‘foo’: t.c:7:10: error: invalid argument 2 for builtin ‘__builtin_s390_verllf’ 7 | return __builtin_s390_vec_rli (v, x); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Whereas with this patch t.c: In function 'foo': t.c:7:10: error: constant value required for builtin '__builtin_s390_verllf' argument 2 7 | return __builtin_s390_vec_rli (v, x); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ the error message, generated by s390_const_operand_ok, clearly speaks about a constant argument value. gcc/ChangeLog: * config/s390/s390-builtins.def (O_U64): New. (O1_U64): Ditto. (O2_U64): Ditto. (O3_U64): Ditto. (O4_U64): Ditto. (O_M12): Change bit position. (O_S2): Ditto. (O_S3): Ditto. (O_S4): Ditto. (O_S5): Ditto. (O_S8): Ditto. (O_S12): Ditto. (O_S16): Ditto. (O_S32): Ditto. (O_ELEM): Ditto. (O_LIT): Ditto. (OB_DEF_VAR): Add operand constraints. (B_DEF): Ditto. * config/s390/s390.cc (s390_const_operand_ok): Honour 64 bit operands.
Diffstat (limited to 'gcc/c')
0 files changed, 0 insertions, 0 deletions