]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
amdgcn: Add builtins for vector floor/floorf
authorKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 1 Nov 2022 22:56:54 +0000 (22:56 +0000)
committerKwok Cheung Yeung <kcy@codesourcery.com>
Tue, 1 Nov 2022 23:10:29 +0000 (23:10 +0000)
2022-11-01  Kwok Cheung Yeung  <kcy@codesourcery.com>

gcc/
* config/gcn/gcn-builtins.def (FLOORVF): New builtin.
(FLOORV): New builtin.
* config/gcn/gcn.cc (gcn_expand_builtin_1): Expand GCN_BUILTIN_FLOORVF
and GCN_BUILTIN_FLOORV.

gcc/ChangeLog.omp
gcc/config/gcn/gcn-builtins.def
gcc/config/gcn/gcn.cc

index 467a2497fb23f5c2649b6f9f569dec62f7da5347..e9ee9d732df59a9bd32b6ed9cf070606b4320cda 100644 (file)
@@ -1,3 +1,10 @@
+2022-11-01  Kwok Cheung Yeung  <kcy@codesourcery.com>
+
+       * config/gcn/gcn-builtins.def (FLOORVF): New builtin.
+       (FLOORV): New builtin.
+       * config/gcn/gcn.cc (gcn_expand_builtin_1): Expand GCN_BUILTIN_FLOORVF
+       and GCN_BUILTIN_FLOORV.
+
 2022-11-01  Kwok Cheung Yeung  <kcy@codesourcery.com>
 
        * config/gcn/gcn.cc (gcn_expand_builtin_1): Fix expansion of
index 21e3f0131e4fc5b408b36d3e5695b33753465296..c50777bd3b02df9ed093e2ad291e738dc188d613 100644 (file)
@@ -69,6 +69,16 @@ DEF_BUILTIN (FABSV, 3 /*CODE_FOR_fabsv */,
             _A2 (GCN_BTI_V64DF, GCN_BTI_V64DF),
             gcn_expand_builtin_1)
 
+DEF_BUILTIN (FLOORVF, 3 /*CODE_FOR_floorvf */,
+            "floorvf", B_INSN,
+            _A2 (GCN_BTI_V64SF, GCN_BTI_V64SF),
+            gcn_expand_builtin_1)
+
+DEF_BUILTIN (FLOORV, 3 /*CODE_FOR_floorv */,
+            "floorv", B_INSN,
+            _A2 (GCN_BTI_V64DF, GCN_BTI_V64DF),
+            gcn_expand_builtin_1)
+
 DEF_BUILTIN (LDEXPVF, 3 /*CODE_FOR_ldexpvf */,
             "ldexpvf", B_INSN,
             _A3 (GCN_BTI_V64SF, GCN_BTI_V64SF, GCN_BTI_V64SI),
index 08dd3d618c6e401e2a02ec7b4a3286d0abfffa9d..bfc91e04f81eb5915fc56041ec39378194bfd83a 100644 (file)
@@ -4372,6 +4372,28 @@ gcn_expand_builtin_1 (tree exp, rtx target, rtx /*subtarget */ ,
        emit_insn (gen_absv64df2 (target, arg));
        return target;
       }
+    case GCN_BUILTIN_FLOORVF:
+      {
+       if (ignore)
+         return target;
+       rtx arg = force_reg (V64SFmode,
+                            expand_expr (CALL_EXPR_ARG (exp, 0), NULL_RTX,
+                                         V64SFmode,
+                                         EXPAND_NORMAL));
+       emit_insn (gen_floorv64sf2 (target, arg));
+       return target;
+      }
+    case GCN_BUILTIN_FLOORV:
+      {
+       if (ignore)
+         return target;
+       rtx arg = force_reg (V64DFmode,
+                            expand_expr (CALL_EXPR_ARG (exp, 0), NULL_RTX,
+                                         V64DFmode,
+                                         EXPAND_NORMAL));
+       emit_insn (gen_floorv64df2 (target, arg));
+       return target;
+      }
     case GCN_BUILTIN_LDEXPVF:
       {
        if (ignore)