This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug target/43883] missed optimization of constant __int128_t modulus



------- Comment #2 from ubizjak at gmail dot com  2010-04-30 09:12 -------
(In reply to comment #1)
> There isn't any pattern for the TImode variant.

Huh? Expansion uses TImode where appropriate:

(insn 10 9 11 ttt.c:3 (parallel [
            (set (reg:DI 66)
                (ashiftrt:DI (subreg:DI (reg/v:TI 60 [ x ]) 8)
                    (const_int 63 [0x3f])))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil))

(insn 11 10 12 ttt.c:3 (set (subreg:DI (reg:TI 65) 0)
        (reg:DI 66)) -1 (nil))

(insn 12 11 13 ttt.c:3 (parallel [
            (set (reg:DI 67)
                (ashiftrt:DI (reg:DI 66)
                    (const_int 63 [0x3f])))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil))

(insn 13 12 14 ttt.c:3 (set (subreg:DI (reg:TI 65) 8)
        (reg:DI 67)) -1 (nil))

(insn 14 13 15 ttt.c:3 (parallel [
            (set (reg:TI 68)
                (lshiftrt:TI (reg:TI 65)
                    (const_int 127 [0x7f])))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil))

(insn 15 14 16 ttt.c:3 (parallel [
            (set (reg:TI 69)
                (plus:TI (reg/v:TI 60 [ x ])
                    (reg:TI 68)))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil))

(insn 16 15 17 ttt.c:3 (parallel [
            (set (subreg:DI (reg:TI 70) 0)
                (and:DI (subreg:DI (reg:TI 69) 0)
                    (const_int 1 [0x1])))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil))

(insn 17 16 18 ttt.c:3 (parallel [
            (set (subreg:DI (reg:TI 70) 8)
                (and:DI (subreg:DI (reg:TI 69) 8)
                    (const_int 0 [0x0])))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil))

(insn 18 17 19 ttt.c:3 (parallel [
            (set (reg:TI 71)
                (minus:TI (reg:TI 70)
                    (reg:TI 68)))
            (clobber (reg:CC 17 flags))
        ]) -1 (nil))

(insn 19 18 20 ttt.c:2 (set (reg:TI 59 [ <retval> ])
        (reg:TI 71)) -1 (nil))

Are you sure that proposed solution will cover all corner cases?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43883


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]