[x86] Fix typo in floorv2sf2, should be register_operand for op1, not vector_operand.

Message ID 20220922011554.796669-1-hongtao.liu@intel.com
State New, archived
Headers
Series [x86] Fix typo in floorv2sf2, should be register_operand for op1, not vector_operand. |

Commit Message

liuhongt Sept. 22, 2022, 1:15 a.m. UTC
  Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
Verify 526.blend_r can be rebuilt with the fix.

Ok for trunk?

gcc/ChangeLog:

	PR target/106994
	* config/i386/mmx.md (floorv2sf2): Fix typo, use
	register_operand instead of vector_operand for operands[1].

gcc/testsuite/ChangeLog:

	* gcc.target/i386/pr106994.c: New test.
---
 gcc/config/i386/mmx.md                   |  2 +-
 gcc/testsuite/gcc.target/i386/pr106994.c | 24 ++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr106994.c
  

Comments

Hongtao Liu Sept. 22, 2022, 1:22 a.m. UTC | #1
On Thu, Sep 22, 2022 at 9:17 AM liuhongt <hongtao.liu@intel.com> wrote:
>
> Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
> Verify 526.blend_r can be rebuilt with the fix.
>
> Ok for trunk?
>
> gcc/ChangeLog:
>
>         PR target/106994
>         * config/i386/mmx.md (floorv2sf2): Fix typo, use
>         register_operand instead of vector_operand for operands[1].
>
> gcc/testsuite/ChangeLog:
>
>         * gcc.target/i386/pr106994.c: New test.
> ---
>  gcc/config/i386/mmx.md                   |  2 +-
>  gcc/testsuite/gcc.target/i386/pr106994.c | 24 ++++++++++++++++++++++++
>  2 files changed, 25 insertions(+), 1 deletion(-)
>  create mode 100644 gcc/testsuite/gcc.target/i386/pr106994.c
>
> diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
> index 222a041de58..c359e2dd6de 100644
> --- a/gcc/config/i386/mmx.md
> +++ b/gcc/config/i386/mmx.md
> @@ -1676,7 +1676,7 @@ (define_expand "lceilv2sfv2si2"
>  (define_expand "floorv2sf2"
>    [(set (match_operand:V2SF 0 "register_operand")
>         (unspec:V2SF
> -         [(match_operand:V2SF 1 "vector_operand")
> +         [(match_operand:V2SF 1 "register_operand")
>            (match_dup 2)]
>           UNSPEC_ROUND))]
>    "TARGET_SSE4_1 && !flag_trapping_math
> diff --git a/gcc/testsuite/gcc.target/i386/pr106994.c b/gcc/testsuite/gcc.target/i386/pr106994.c
> new file mode 100644
> index 00000000000..0803311dc75
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/i386/pr106994.c
> @@ -0,0 +1,24 @@
> +/* { dg-do compile } */
> +/* { dg-options "-march=skylake -Ofast" } */
> +
> +typedef struct {
> +  float ymin, ymax;
> +} rctf;
> +
> +rctf view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked;
> +float view2d_map_cur_using_maskUI_view2d_view_ortho_yofs;
> +
> +void BLI_rctf_translate();
> +void glLoadIdentity();
> +
> +void
> +view2d_map_cur_using_maskUI_view2d_view_ortho() {
> +  BLI_rctf_translate(&view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked);
> +  view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymin =
> +      __builtin_floor(view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymin) -
> +      view2d_map_cur_using_maskUI_view2d_view_ortho_yofs;
> +  view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymax =
> +      __builtin_floor(view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymax) -
> +      view2d_map_cur_using_maskUI_view2d_view_ortho_yofs;
> +  glLoadIdentity();
> +}
> --
> 2.27.0
>
  
Uros Bizjak Sept. 22, 2022, 5:59 a.m. UTC | #2
On Thu, Sep 22, 2022 at 3:18 AM liuhongt via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> Bootstrapped and regtested on x86_64-pc-linux-gnu{-m32,}.
> Verify 526.blend_r can be rebuilt with the fix.
>
> Ok for trunk?

This patch is OK as obvious.

Thanks,
Uros.

> gcc/ChangeLog:
>
>         PR target/106994
>         * config/i386/mmx.md (floorv2sf2): Fix typo, use
>         register_operand instead of vector_operand for operands[1].
>
> gcc/testsuite/ChangeLog:
>
>         * gcc.target/i386/pr106994.c: New test.
> ---
>  gcc/config/i386/mmx.md                   |  2 +-
>  gcc/testsuite/gcc.target/i386/pr106994.c | 24 ++++++++++++++++++++++++
>  2 files changed, 25 insertions(+), 1 deletion(-)
>  create mode 100644 gcc/testsuite/gcc.target/i386/pr106994.c
>
> diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
> index 222a041de58..c359e2dd6de 100644
> --- a/gcc/config/i386/mmx.md
> +++ b/gcc/config/i386/mmx.md
> @@ -1676,7 +1676,7 @@ (define_expand "lceilv2sfv2si2"
>  (define_expand "floorv2sf2"
>    [(set (match_operand:V2SF 0 "register_operand")
>         (unspec:V2SF
> -         [(match_operand:V2SF 1 "vector_operand")
> +         [(match_operand:V2SF 1 "register_operand")
>            (match_dup 2)]
>           UNSPEC_ROUND))]
>    "TARGET_SSE4_1 && !flag_trapping_math
> diff --git a/gcc/testsuite/gcc.target/i386/pr106994.c b/gcc/testsuite/gcc.target/i386/pr106994.c
> new file mode 100644
> index 00000000000..0803311dc75
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/i386/pr106994.c
> @@ -0,0 +1,24 @@
> +/* { dg-do compile } */
> +/* { dg-options "-march=skylake -Ofast" } */
> +
> +typedef struct {
> +  float ymin, ymax;
> +} rctf;
> +
> +rctf view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked;
> +float view2d_map_cur_using_maskUI_view2d_view_ortho_yofs;
> +
> +void BLI_rctf_translate();
> +void glLoadIdentity();
> +
> +void
> +view2d_map_cur_using_maskUI_view2d_view_ortho() {
> +  BLI_rctf_translate(&view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked);
> +  view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymin =
> +      __builtin_floor(view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymin) -
> +      view2d_map_cur_using_maskUI_view2d_view_ortho_yofs;
> +  view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymax =
> +      __builtin_floor(view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymax) -
> +      view2d_map_cur_using_maskUI_view2d_view_ortho_yofs;
> +  glLoadIdentity();
> +}
> --
> 2.27.0
>
  

Patch

diff --git a/gcc/config/i386/mmx.md b/gcc/config/i386/mmx.md
index 222a041de58..c359e2dd6de 100644
--- a/gcc/config/i386/mmx.md
+++ b/gcc/config/i386/mmx.md
@@ -1676,7 +1676,7 @@  (define_expand "lceilv2sfv2si2"
 (define_expand "floorv2sf2"
   [(set (match_operand:V2SF 0 "register_operand")
 	(unspec:V2SF
-	  [(match_operand:V2SF 1 "vector_operand")
+	  [(match_operand:V2SF 1 "register_operand")
 	   (match_dup 2)]
 	  UNSPEC_ROUND))]
   "TARGET_SSE4_1 && !flag_trapping_math
diff --git a/gcc/testsuite/gcc.target/i386/pr106994.c b/gcc/testsuite/gcc.target/i386/pr106994.c
new file mode 100644
index 00000000000..0803311dc75
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr106994.c
@@ -0,0 +1,24 @@ 
+/* { dg-do compile } */
+/* { dg-options "-march=skylake -Ofast" } */
+
+typedef struct {
+  float ymin, ymax;
+} rctf;
+
+rctf view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked;
+float view2d_map_cur_using_maskUI_view2d_view_ortho_yofs;
+
+void BLI_rctf_translate();
+void glLoadIdentity();
+
+void
+view2d_map_cur_using_maskUI_view2d_view_ortho() {
+  BLI_rctf_translate(&view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked);
+  view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymin =
+      __builtin_floor(view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymin) -
+      view2d_map_cur_using_maskUI_view2d_view_ortho_yofs;
+  view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymax =
+      __builtin_floor(view2d_map_cur_using_maskUI_view2d_view_ortho_curmasked.ymax) -
+      view2d_map_cur_using_maskUI_view2d_view_ortho_yofs;
+  glLoadIdentity();
+}