* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
@ 2012-09-30 17:01 ` olegendo at gcc dot gnu.org
2012-10-06 11:20 ` olegendo at gcc dot gnu.org
` (13 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-09-30 17:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-09-30
Ever Confirmed|0 |1
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
2012-09-30 17:01 ` [Bug target/54760] " olegendo at gcc dot gnu.org
@ 2012-10-06 11:20 ` olegendo at gcc dot gnu.org
2012-10-08 2:01 ` olegendo at gcc dot gnu.org
` (12 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-06 11:20 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #1 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-06 11:20:18 UTC ---
Author: olegendo
Date: Sat Oct 6 11:20:11 2012
New Revision: 192155
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192155
Log:
PR target/54760
* config/sh/sh.md (define_constants): Add UNSPECV_GBR.
(get_thread_pointer, set_thread_pointer): New expanders.
(load_gbr): Rename to store_gbr. Remove GBR_REG use.
(store_gbr): New insn.
* config/sh/sh.c (prepare_move_operands): Use gen_store_gbr instead of
gen_load_gbr in TLS_MODEL_LOCAL_EXEC case.
(sh1_builtin_p): New function.
(signature_args): Add SH_BLTIN_VP.
(bdesc): Add __builtin_thread_pointer and __builtin_set_thread_pointer.
PR target/54760
* gcc.target/sh/pr54760-1.c: New.
Added:
trunk/gcc/testsuite/gcc.target/sh/pr54760-1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/sh.c
trunk/gcc/config/sh/sh.md
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
2012-09-30 17:01 ` [Bug target/54760] " olegendo at gcc dot gnu.org
2012-10-06 11:20 ` olegendo at gcc dot gnu.org
@ 2012-10-08 2:01 ` olegendo at gcc dot gnu.org
2012-10-09 18:59 ` olegendo at gcc dot gnu.org
` (11 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-08 2:01 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #2 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-08 02:00:57 UTC ---
Author: olegendo
Date: Mon Oct 8 02:00:46 2012
New Revision: 192193
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192193
Log:
PR target/54760
* config/sh/sh.md (*mov<mode>_gbr_load, *mov<mode>_gbr_store): New
insns and accompanying unnamed splits.
* config/sh/predicates.md (general_movsrc_operand,
general_movdst_operand): Reject GBR addresses.
* config/sh/sh-protos.h (sh_find_equiv_gbr_addr): New declaration.
* config/sh/sh.c (sh_address_cost, sh_legitimate_address_p,
sh_secondary_reload): Handle GBR addresses.
(base_reg_disp): New class.
(sh_find_base_reg_disp, sh_find_equiv_gbr_addr): New functions.
PR target/54760
* gcc.target/sh/pr54760-2.c: New.
* gcc.target/sh/pr54760-3.c: New.
Added:
trunk/gcc/testsuite/gcc.target/sh/pr54760-2.c
trunk/gcc/testsuite/gcc.target/sh/pr54760-3.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/predicates.md
trunk/gcc/config/sh/sh-protos.h
trunk/gcc/config/sh/sh.c
trunk/gcc/config/sh/sh.md
trunk/gcc/testsuite/ChangeLog
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (2 preceding siblings ...)
2012-10-08 2:01 ` olegendo at gcc dot gnu.org
@ 2012-10-09 18:59 ` olegendo at gcc dot gnu.org
2012-10-09 19:42 ` olegendo at gcc dot gnu.org
` (10 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-09 18:59 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #3 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-09 18:59:19 UTC ---
Author: olegendo
Date: Tue Oct 9 18:59:11 2012
New Revision: 192269
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192269
Log:
PR target/54760
* doc/extend.texi (Target Builtins): Add SH built-in section.
Document __builtin_thread_pointer and __builtin_set_thread_pointer.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/doc/extend.texi
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (3 preceding siblings ...)
2012-10-09 18:59 ` olegendo at gcc dot gnu.org
@ 2012-10-09 19:42 ` olegendo at gcc dot gnu.org
2012-10-11 20:29 ` olegendo at gcc dot gnu.org
` (9 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-09 19:42 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #4 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-09 19:42:33 UTC ---
Done in 4.8.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (4 preceding siblings ...)
2012-10-09 19:42 ` olegendo at gcc dot gnu.org
@ 2012-10-11 20:29 ` olegendo at gcc dot gnu.org
2012-10-12 0:14 ` kkojima at gcc dot gnu.org
` (8 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-11 20:29 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |REOPENED
CC| |kkojima at gcc dot gnu.org
Resolution|FIXED |
--- Comment #5 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-11 20:29:12 UTC ---
It seems that the proposed target independent thread pointer stuff made it into
mainline. I guess the SH specific built-ins can be removed now. I will check
it out.
Another thing that I'm not sure about is whether 'ldc rn,gbr' and 'stc
gbr,rn' instructions can go in the delay slot, or whether they will cause a
slot illegal exception. Currently this
void* test (void)
{
return __builtin_thread_pointer ();
}
will result in
rts
stc gbr,r0
I've looked in the source of the GDB sim and it seems that the sim will not
detect this as a slot illegal instruction. However, the sim will also not
detect 'stc sgr,rn' as a slot illegal instruction, but in my older
interrupt/exception code I was doing:
stc sgr,r15
rte
nop
because otherwise it would cause trouble.
The HW manuals unfortunately don't mention any details. Basically all of them
say: stc, stc.l, ldc, ldc.l instructions might cause a slot illegal exception.
But it doesn't say which register combinations are slot illegal and which are
legal.
Kaz, do you happen to know something regarding this matter?
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (5 preceding siblings ...)
2012-10-11 20:29 ` olegendo at gcc dot gnu.org
@ 2012-10-12 0:14 ` kkojima at gcc dot gnu.org
2012-10-12 0:27 ` olegendo at gcc dot gnu.org
` (7 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: kkojima at gcc dot gnu.org @ 2012-10-12 0:14 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #6 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-10-12 00:13:51 UTC ---
(In reply to comment #5)
> Kaz, do you happen to know something regarding this matter?
My SH4 software manual says for STC that all stc/stc.l instructions
except stc gbr,rn/stc gbr,@-rn are privileged instructions which
might cause an illegal exception in user mode. LDC has a similar
remark.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (6 preceding siblings ...)
2012-10-12 0:14 ` kkojima at gcc dot gnu.org
@ 2012-10-12 0:27 ` olegendo at gcc dot gnu.org
2012-10-12 0:43 ` kkojima at gcc dot gnu.org
` (6 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-12 0:27 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #7 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-12 00:26:42 UTC ---
(In reply to comment #6)
> (In reply to comment #5)
> > Kaz, do you happen to know something regarding this matter?
>
> My SH4 software manual says for STC that all stc/stc.l instructions
> except stc gbr,rn/stc gbr,@-rn are privileged instructions which
> might cause an illegal exception in user mode. LDC has a similar
> remark.
Yes, but e.g. in the manual rej09b0003_sh4a.pdf, pdf page 346 (STC insn), in
addition to the gbr user/privileged mode note:
Possible Exceptions:
* Data TLB multiple-hit exception
* General illegal instruction exception
* Slot illegal instruction exception <<< but which insns?!?!
* Data TLB miss exception
* Data TLB protection violation exception
* Initial page write exception
* Data address error
I'd like to leave this open until this has been clarified/confirmed.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (7 preceding siblings ...)
2012-10-12 0:27 ` olegendo at gcc dot gnu.org
@ 2012-10-12 0:43 ` kkojima at gcc dot gnu.org
2012-10-12 0:46 ` olegendo at gcc dot gnu.org
` (5 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: kkojima at gcc dot gnu.org @ 2012-10-12 0:43 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #8 from Kazumoto Kojima <kkojima at gcc dot gnu.org> 2012-10-12 00:43:09 UTC ---
(In reply to comment #7)
> * Slot illegal instruction exception <<< but which insns?!?!
Ah, you could see a list in that manual rej09b0003_sh4a.pdf,
pdf page 108, Slot Illegal Instruction Exception:
... Previleged instructions:LDC,STC,RTE,LDTLB,SLEEP,but
excluding LDC/STC instructions that access GBR ...
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (8 preceding siblings ...)
2012-10-12 0:43 ` kkojima at gcc dot gnu.org
@ 2012-10-12 0:46 ` olegendo at gcc dot gnu.org
2012-10-12 0:51 ` olegendo at gcc dot gnu.org
` (4 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-12 0:46 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #9 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-12 00:45:45 UTC ---
Author: olegendo
Date: Fri Oct 12 00:45:36 2012
New Revision: 192388
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192388
Log:
PR target/54760
* config/sh/sh.c (bdesc): Remove thread pointer built-ins.
* config/sh/sh.md (get_thread_pointer, set_thread_pointer): Append mode
name 'si'.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/sh.c
trunk/gcc/config/sh/sh.md
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (9 preceding siblings ...)
2012-10-12 0:46 ` olegendo at gcc dot gnu.org
@ 2012-10-12 0:51 ` olegendo at gcc dot gnu.org
2012-10-15 22:05 ` olegendo at gcc dot gnu.org
` (3 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-12 0:51 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #10 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-12 00:50:44 UTC ---
(In reply to comment #8)
> (In reply to comment #7)
> > * Slot illegal instruction exception <<< but which insns?!?!
>
> Ah, you could see a list in that manual rej09b0003_sh4a.pdf,
> pdf page 108, Slot Illegal Instruction Exception:
>
> ... Previleged instructions:LDC,STC,RTE,LDTLB,SLEEP,but
> excluding LDC/STC instructions that access GBR ...
Ouch, right. Thanks. Should be good then as it is I guess (except for the new
target independent built-in expansion failure ...)
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (10 preceding siblings ...)
2012-10-12 0:51 ` olegendo at gcc dot gnu.org
@ 2012-10-15 22:05 ` olegendo at gcc dot gnu.org
2012-10-23 19:25 ` amylaar at gcc dot gnu.org
` (2 subsequent siblings)
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-15 22:05 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #11 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-15 22:04:42 UTC ---
Author: olegendo
Date: Mon Oct 15 22:04:37 2012
New Revision: 192480
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=192480
Log:
PR target/54760
* config/sh/sh.c (sh_find_base_reg_disp): Stop searching insns when
hitting a call insn if GBR is marked as call used.
* config/sh/iterators.md (QIHISIDI): New mode iterator.
* config/sh/predicates.md (gbr_address_mem): New predicate.
* config/sh/sh.md (*movdi_gbr_load, *movdi_gbr_store): New
insn_and_split.
Use QIHISIDI instead of QIHISI in unnamed GBR addressing splits.
PR target/54760
* gcc.target/sh/pr54760-2.c: Add long long and unsigned long long test
functions.
* gcc.target/sh/pr54760-4.c: New.
Added:
trunk/gcc/testsuite/gcc.target/sh/pr54760-4.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/sh/iterators.md
trunk/gcc/config/sh/predicates.md
trunk/gcc/config/sh/sh.c
trunk/gcc/config/sh/sh.md
trunk/gcc/testsuite/ChangeLog
trunk/gcc/testsuite/gcc.target/sh/pr54760-2.c
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (11 preceding siblings ...)
2012-10-15 22:05 ` olegendo at gcc dot gnu.org
@ 2012-10-23 19:25 ` amylaar at gcc dot gnu.org
2012-10-27 13:41 ` olegendo at gcc dot gnu.org
2013-03-09 12:36 ` olegendo at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: amylaar at gcc dot gnu.org @ 2012-10-23 19:25 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |amylaar at gcc dot gnu.org
--- Comment #12 from Jorn Wolfgang Rennecke <amylaar at gcc dot gnu.org> 2012-10-23 19:25:02 UTC ---
(In reply to comment #9)
> Log:
> PR target/54760
> * config/sh/sh.c (bdesc): Remove thread pointer built-ins.
You left sh1_builtin_p behind.
This caused PR55042.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (12 preceding siblings ...)
2012-10-23 19:25 ` amylaar at gcc dot gnu.org
@ 2012-10-27 13:41 ` olegendo at gcc dot gnu.org
2013-03-09 12:36 ` olegendo at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2012-10-27 13:41 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
--- Comment #13 from Oleg Endo <olegendo at gcc dot gnu.org> 2012-10-27 13:41:25 UTC ---
(In reply to comment #12)
> (In reply to comment #9)
>
> > Log:
> > PR target/54760
> > * config/sh/sh.c (bdesc): Remove thread pointer built-ins.
>
> You left sh1_builtin_p behind.
>
> This caused PR55042.
Fixed in rev 192877.
^ permalink raw reply [flat|nested] 16+ messages in thread
* [Bug target/54760] [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer
2012-09-30 17:00 [Bug target/54760] New: [SH] Add __builtin_thread_pointer, __builtin_set_thread_pointer olegendo at gcc dot gnu.org
` (13 preceding siblings ...)
2012-10-27 13:41 ` olegendo at gcc dot gnu.org
@ 2013-03-09 12:36 ` olegendo at gcc dot gnu.org
14 siblings, 0 replies; 16+ messages in thread
From: olegendo at gcc dot gnu.org @ 2013-03-09 12:36 UTC (permalink / raw)
To: gcc-bugs
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54760
Oleg Endo <olegendo at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|REOPENED |RESOLVED
Resolution| |FIXED
--- Comment #14 from Oleg Endo <olegendo at gcc dot gnu.org> 2013-03-09 12:35:56 UTC ---
As far as I can tell, this is one is done.
^ permalink raw reply [flat|nested] 16+ messages in thread