Hi, there.
I met a problem about defining SubReg relationship when defining Registers in td file.
The target has a kind of vector register named VR which is of type v4f32.
2 VR makes 1 DVR. 4 VR makes 1 QVR.
I have some code like this:
------------------------------------------------------------------------------------------------------
def VRPairs : RegisterTuples<[vsub_0, vsub_1],
[(decimate (rotl VRegs, 0), 2),
(decimate (rotl VRegs, 1), 2)],
[]>;
def VRQuads : RegisterTuples<[vsub_0, vsub_1, vsub_2, vsub_3],
[(decimate (rotl VRegs, 0), 4),
(decimate (rotl VRegs, 1), 4),
(decimate (rotl VRegs, 2), 4),
(decimate (rotl VRegs, 3), 4)],
[]>;
def DVRRegs : RegisterClass<"xxx", [v8f32], 256, (add VRPairs)>;
def QVRRegs : RegisterClass<"xxx", [v16f32], 512, (add VRQuads)>;
------------------------------------------------------------------------------------------------------
But also, 2 DVR makes 1 QVR. QVR has two subregs, each of which is 1 DVR.
How can I describe the SubReg relationship between DVR and QVR?
Could anyone help? Thanks in advance!
BR,
Jerry
|
Intelligent Data Processing
From Cloud to Edge |
From: Fraser <llvm...@lists.llvm.org>
To: jackie <jackie...@126.com>
Cc: llvm-dev <llvm...@lists.llvm.org>
Date: Tuesday, 10 August 2021 2:15 PM CEST
Subject: Re: [llvm-dev] How to define subreg relationship in td file?
1 #include "arm_neon.h"
2 void test (float32_t *p1, float32_t *p2, float32_t *p3) {
3 float32x4x2_t a = vld1q_f32_x2(p1);
4 float32x4x2_t b = vld1q_f32_x2(p2);
5 float32x4_t c = vaddq_f32(a.val[0], b.val[1]);
6 vst1q_f32(p3, c);
7 }
157 typedef struct float32x4x2_t {
158 float32x4_t val[2];