This is the mail archive of the
mailing list for the GCC project.
Re: (R5900) Implementing Vector Support
- From: Woon yung Liu <ysai187 at yahoo dot com>
- To: Richard Henderson <rth at redhat dot com>, Gcc Mailing List <gcc at gcc dot gnu dot org>
- Date: Sat, 4 Jun 2016 02:46:41 +0000 (UTC)
- Subject: Re: (R5900) Implementing Vector Support
- Authentication-results: sourceware.org; auth=none
- References: <23a57920-3e9e-05f9-e428-a7e5e89d4de9 at redhat dot com> <133091800 dot 362759 dot 1462978450117 dot JavaMail dot yahoo at mail dot yahoo dot com> <93d40024-8baf-f571-765e-3f3ae59961df at redhat dot com> <687383190 dot 1940916 dot 1463221310394 dot JavaMail dot yahoo at mail dot yahoo dot com> <850bcd56-a219-a153-b467-8414fa19c207 at redhat dot com> <300510214 dot 326837 dot 1463573792037 dot JavaMail dot yahoo at mail dot yahoo dot com> <e7ccb4e0-6b37-ea2c-01bb-4fff2742ca32 at redhat dot com> <1735082185 dot 4758122 dot 1463655944237 dot JavaMail dot yahoo at mail dot yahoo dot com> <1809107277 dot 905923 dot 1464508754638 dot JavaMail dot yahoo at mail dot yahoo dot com> <1ad4a4a6-72ee-3048-0b9d-53ed16c5a4c8 at redhat dot com> <904764586 dot 674015 dot 1464958440737 dot JavaMail dot yahoo at mail dot yahoo dot com> <e00e41c7-d467-ad91-585e-36dcfa3ae716 at redhat dot com>
- Reply-to: Woon yung Liu <ysai187 at yahoo dot com>
I wasn't sure if I was allowed to ask for help like that, hence why I never posted much code.
It is also likely possible that I was confused by the number of weird errors that I've been getting.
I got the fault in gen_lowpart earlier on because I was assigning mask = GEN_INT (0xffff) at some point, which doesn't work (as you've described). The changes were made because I was trying to get rid of this odd segmentation fault.
The version of GCC that I am currently working on, is v5.3.0.
Anyway, here is the pattern for vec_set, which suddenly started to cause segmentation faults within mips.c after converting the define_insn_and_split in various parts to define_expand:
[(set (match_operand:MMI_VWHB 0 "register_operand" "+d")
(zero_extend:MMI_VWHB (match_operand:<MMI_VWHB_SCAL> 1 "register_operand" "d")))
(match_operand 2 "const_int_operand" "")]
machine_mode mode = GET_MODE (operands), imode = GET_MODE_INNER (mode);
rtx rotated, mask;
mask = gen_reg_rtx (imode);
mips_emit_move (mask, GEN_INT (0xff));
mips_emit_move (mask, GEN_INT (0xffff));
mips_emit_move (mask, GEN_INT (0xffffffff)); <- 5900.md:723 is here, but it the execution flow actually runs 3 lines above.
mask = gen_lowpart (mode, mask);
// mask = gen_rtx_REG (mode, REGNO (mask));
emit_insn (gen_one_cmpl<mode>2 (mask, mask));
rotated = gen_lowpart (mode, operands);
// rotated = gen_rtx_REG (mode, REGNO (operands));
if (INTVAL(operands) > 0)
emit_insn (gen_rotl<mode>3 (rotated, rotated, operands));
emit_insn (gen_rotl<mode>3 (mask, mask, operands));
emit_insn (gen_and<mode>3 (operands, operands, mask));
emit_insn (gen_ior<mode>3 (operands, operands, rotated));
The segmentation fault:
testv.c: In function 'testv8set':
testv.c:55:9: internal compiler error: Segmentation fault
vec = one;
0xb505b5 mips_legitimize_move(machine_mode, rtx_def*, rtx_def*)
0xb8ffd8 gen_movhi(rtx_def*, rtx_def*)
0x6abffa insn_gen_fn::operator()(rtx_def*, rtx_def*) const
0x6abffa emit_move_insn_1(rtx_def*, rtx_def*)
0x6ac3e0 emit_move_insn(rtx_def*, rtx_def*)
0xb87916 gen_vec_setv8hi(rtx_def*, rtx_def*, rtx_def*)
0x839498 maybe_expand_insn(insn_code, unsigned int, expand_operand*)
0x69d00e store_bit_field(rtx_def*, unsigned long, unsigned long, unsigned long, unsigned long, machine_mode, rtx_def*)
0x6b3837 expand_assignment(tree_node*, tree_node*, bool)
The part within mips_legitimize_const_move of mips.c that is faulting:
/* When using explicit relocs, constant pool references are sometimes
not legitimate addresses. */
mips_split_symbol (dest, XEXP (src, 0), mode, &XEXP (src, 0));
mips_emit_move (dest, src);
__v8hi testv8set(__v8hi vec, short int one, short int two, short int three, short int four)
vec = one;
vec = two;
vec = three;
// vec = four;
Thank you for your time, and have a nice day.
On Saturday, June 4, 2016 12:35 AM, Richard Henderson <email@example.com> wrote:
> I would suggest that you post actual code to the list so that people can help
> you. Simply answering questions in the abstract, as I have been doing, can
> only go so far.