Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
688e4919
Commit
688e4919
authored
Sep 02, 2010
by
Michael Meissner
Committed by
Michael Meissner
Sep 02, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize (double)(long) to generate FRIZ if -ffast-math
From-SVN: r163786
parent
398da2ac
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
87 additions
and
2 deletions
+87
-2
gcc/ChangeLog
+13
-0
gcc/config/rs6000/rs6000.md
+12
-0
gcc/config/rs6000/rs6000.opt
+6
-1
gcc/config/rs6000/vsx.md
+19
-0
gcc/doc/invoke.texi
+10
-1
gcc/testsuite/ChangeLog
+6
-0
gcc/testsuite/gcc.target/powerpc/ppc-fpconv-10.c
+11
-0
gcc/testsuite/gcc.target/powerpc/ppc-fpconv-11.c
+10
-0
No files found.
gcc/ChangeLog
View file @
688e4919
2010-09-02 Michael Meissner <meissner@linux.vnet.ibm.com>
* config/rs6000/rs6000.opt (-mfriz): New switch to control whether
to convert (double)(long) into a single FRIZ instruction or not
when -ffast-math is used.
* config/rs6000/vsx.md (VSX_DF): New iterator for DF/V2DF modes.
(vsx_float_fix_<mode>2): Optimize (double)(long) into X{S,V}RDPIZ
or FRIZ instruction if -ffast-math.
* config/rs6000/rs6000.md (friz): Ditto.
* doc/invoke.texi (RS/6000 and PowerPC Options): Document -mfriz.
2010-09-02 Joseph Myers <joseph@codesourcery.com>
2010-09-02 Joseph Myers <joseph@codesourcery.com>
* opth-gen.awk (quote, comma): Remove unused variables.
* opth-gen.awk (quote, comma): Remove unused variables.
...
...
gcc/config/rs6000/rs6000.md
View file @
688e4919
...
@@ -6983,6 +6983,18 @@
...
@@ -6983,6 +6983,18 @@
"fctiwuz %0,%1"
"fctiwuz %0,%1"
[
(set_attr "type" "fp")
]
)
[
(set_attr "type" "fp")
]
)
;; Only optimize (float (fix x)) -> frz if we are in fast-math mode, since
;; since the friz instruction does not truncate the value if the floating
;; point value is
<
LONG
_MIN
or
>
LONG_MAX.
(define_insn "
*
friz"
[
(set (match_operand:DF 0 "gpc_reg_operand" "=d")
(float:DF (fix:DI (match_operand:DF 1 "gpc_reg_operand" "d"))))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT && TARGET_POPCNTB
&& !VECTOR_UNIT_VSX_P (DFmode) && flag_unsafe_math_optimizations
&& !flag_trapping_math && TARGET_FRIZ"
"friz %0,%1"
[
(set_attr "type" "fp")
]
)
;; No VSX equivalent to fctid
;; No VSX equivalent to fctid
(define_insn "lrint
<mode>
di2"
(define_insn "lrint
<mode>
di2"
[
(set (match_operand:DI 0 "gpc_reg_operand" "=d")
[
(set (match_operand:DI 0 "gpc_reg_operand" "=d")
...
...
gcc/config/rs6000/rs6000.opt
View file @
688e4919
; Options for the rs6000 port of the compiler
; Options for the rs6000 port of the compiler
;
;
; Copyright (C) 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Free Software
; Foundation, Inc.
; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
; Contributed by Aldy Hernandez <aldy@quesejoda.com>.
;
;
; This file is part of GCC.
; This file is part of GCC.
...
@@ -115,6 +116,10 @@ mpopcntd
...
@@ -115,6 +116,10 @@ mpopcntd
Target Report Mask(POPCNTD)
Target Report Mask(POPCNTD)
Use PowerPC V2.06 popcntd instruction
Use PowerPC V2.06 popcntd instruction
mfriz
Target Report Var(TARGET_FRIZ) Init(-1)
Under -ffast-math, generate a FRIZ instruction for (double)(long long) conversions
mveclibabi=
mveclibabi=
Target RejectNegative Joined Var(rs6000_veclibabi_name)
Target RejectNegative Joined Var(rs6000_veclibabi_name)
Vector library ABI to use
Vector library ABI to use
...
...
gcc/config/rs6000/vsx.md
View file @
688e4919
...
@@ -28,6 +28,9 @@
...
@@ -28,6 +28,9 @@
;; Iterator for the 2 32-bit vector types
;; Iterator for the 2 32-bit vector types
(define_mode_iterator VSX_W
[
V4SF V4SI
]
)
(define_mode_iterator VSX_W
[
V4SF V4SI
]
)
;; Iterator for the DF types
(define_mode_iterator VSX_DF
[
V2DF DF
]
)
;; Iterator for vector floating point types supported by VSX
;; Iterator for vector floating point types supported by VSX
(define_mode_iterator VSX_F
[
V4SF V2DF
]
)
(define_mode_iterator VSX_F
[
V4SF V2DF
]
)
...
@@ -1053,6 +1056,22 @@
...
@@ -1053,6 +1056,22 @@
"VECTOR_UNIT_VSX_P (V2DFmode)"
"VECTOR_UNIT_VSX_P (V2DFmode)"
"xvcvspuxds %x0,%x1"
"xvcvspuxds %x0,%x1"
[
(set_attr "type" "vecfloat")
]
)
[
(set_attr "type" "vecfloat")
]
)
;; Only optimize (float (fix x)) -> frz if we are in fast-math mode, since
;; since the xsrdpiz instruction does not truncate the value if the floating
;; point value is
<
LONG
_MIN
or
>
LONG_MAX.
(define_insn "
*
vsx_float_fix_
<mode>
2"
[
(set (match_operand:VSX_DF 0 "vsx_register_operand" "=
<VSr>
,?wa")
(float:VSX_DF
(fix:
<VSI>
(match_operand:VSX_DF 1 "vsx_register_operand" "
<VSr>
,?wa"))))]
"TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_DOUBLE_FLOAT
&& VECTOR_UNIT_VSX_P (
<MODE>
mode) && flag_unsafe_math_optimizations
&& !flag_trapping_math && TARGET_FRIZ"
"x
<VSv>
r
<VSs>
iz %x0,%x1"
[
(set_attr "type" "
<VStype
_simple
>
")
(set_attr "fp_type" "
<VSfptype
_simple
>
")])
;; Logical and permute operations
;; Logical and permute operations
(define_insn "
*
vsx_and
<mode>
3"
(define_insn "
*
vsx_and
<mode>
3"
...
...
gcc/doc/invoke.texi
View file @
688e4919
...
@@ -789,7 +789,7 @@ See RS/6000 and PowerPC Options.
...
@@ -789,7 +789,7 @@ See RS/6000 and PowerPC Options.
-
msdata
=@
var
{
opt
}
-
mvxworks
-
G
@
var
{
num
}
-
pthread
@
gol
-
msdata
=@
var
{
opt
}
-
mvxworks
-
G
@
var
{
num
}
-
pthread
@
gol
-
mrecip
-
mrecip
=@
var
{
opt
}
-
mno
-
recip
-
mrecip
-
precision
-
mrecip
-
mrecip
=@
var
{
opt
}
-
mno
-
recip
-
mrecip
-
precision
-
mno
-
recip
-
precision
@
gol
-
mno
-
recip
-
precision
@
gol
-
mveclibabi
=@
var
{
type
}}
-
mveclibabi
=@
var
{
type
}
-
mfriz
-
mno
-
friz
}
@
emph
{
RX
Options
}
@
emph
{
RX
Options
}
@
gccoptlist
{-
m64bit
-
doubles
-
m32bit
-
doubles
-
fpu
-
nofpu
@
gol
@
gccoptlist
{-
m64bit
-
doubles
-
m32bit
-
doubles
-
fpu
-
nofpu
@
gol
...
@@ -15931,6 +15931,15 @@ GCC will currently emit calls to @code{acosd2}, @code{acosf4},
...
@@ -15931,6 +15931,15 @@ GCC will currently emit calls to @code{acosd2}, @code{acosf4},
for
power7
.
Both
@
option
{-
ftree
-
vectorize
}
and
for
power7
.
Both
@
option
{-
ftree
-
vectorize
}
and
@
option
{-
funsafe
-
math
-
optimizations
}
have
to
be
enabled
.
The
MASS
@
option
{-
funsafe
-
math
-
optimizations
}
have
to
be
enabled
.
The
MASS
libraries
will
have
to
be
specified
at
link
time
.
libraries
will
have
to
be
specified
at
link
time
.
@
item
-
mfriz
@
itemx
-
mno
-
friz
@
opindex
mfriz
Generate
(
do
not
generate
)
the
@
code
{
friz
}
instruction
when
the
@
option
{-
funsafe
-
math
-
optimizations
}
option
is
used
to
optimize
rounding
a
floating
point
value
to
64
-
bit
integer
and
back
to
floating
point
.
The
@
code
{
friz
}
instruction
does
not
return
the
same
value
if
the
floating
point
number
is
too
large
to
fit
in
an
integer
.
@
end
table
@
end
table
@
node
RX
Options
@
node
RX
Options
...
...
gcc/testsuite/ChangeLog
View file @
688e4919
2010-09-02 Michael Meissner <meissner@linux.vnet.ibm.com>
* gcc.target/powerpc/ppc-fpconv-10.c: New file to test generating
FRIZ/XSRIZ instruciton for (double)(long long)x.
* gcc.target/powerpc/ppc-fpconv-11.c: Ditto.
2010-09-02 Eric Botcazou <ebotcazou@adacore.com>
2010-09-02 Eric Botcazou <ebotcazou@adacore.com>
* g++.dg/debug/dwarf2/nested-2.C: Allow for ! as comment delimiter.
* g++.dg/debug/dwarf2/nested-2.C: Allow for ! as comment delimiter.
...
...
gcc/testsuite/gcc.target/powerpc/ppc-fpconv-10.c
0 → 100644
View file @
688e4919
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-require-effective-target powerpc_vsx_ok } */
/* { dg-options "-O2 -mcpu=power7 -ffast-math" } */
/* { dg-final { scan-assembler "xsrdpiz" } } */
/* { dg-final { scan-assembler-not "friz" } } */
double
round_double_llong
(
double
a
)
{
return
(
double
)(
long
long
)
a
;
}
gcc/testsuite/gcc.target/powerpc/ppc-fpconv-11.c
0 → 100644
View file @
688e4919
/* { dg-do compile { target { powerpc*-*-* } } } */
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
/* { dg-options "-O2 -mcpu=power5 -ffast-math" } */
/* { dg-final { scan-assembler-not "xsrdpiz" } } */
/* { dg-final { scan-assembler "friz" } } */
double
round_double_llong
(
double
a
)
{
return
(
double
)(
long
long
)
a
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment