Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve segment load/store interface with tuple types #198

Merged
merged 7 commits into from
Jun 12, 2023

Conversation

eopXD
Copy link
Collaborator

@eopXD eopXD commented Feb 16, 2023

This resolves #139. This change is motivated by constant unpleasant user feedback of the current segment load/store intrinsics and hope to align the interface of segment load/store intrinsics with the non-segment ones.

This PR adds the tuple-type segment load-store intrinsics and removes the existing ones. To company the tuple-types, additional vget and vset intrinsics for them are added.

Take vlseg2e8 for example, these are the intrinsics added:

vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2(const int8_t *base, size_t vl);
vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2_m(vbool64_t mask, const int8_t *base, size_t vl);
vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2_tu(vint8mf8x2_t maskedoff_tuple, const int8_t *base, size_t vl);
vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2_tum(vbool64_t mask, vint8mf8x2_t maskedoff_tuple, const int8_t *base, size_t vl);
vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2_mu(vbool64_t mask, vint8mf8x2_t maskedoff_tuple, const int8_t *base, size_t vl);

void __riscv_vsseg2e8_v_i8mf8x2 (int8_t *base, vint8mf8x2_t v_tuple, size_t vl);
void __riscv_vsseg2e8_v_i8mf8x2_m (vbool64_t mask, int8_t *base, vint8mf8x2_t v_tuple, size_t vl);

vint8mf8_t __riscv_vget_v_i8mf8x2_i8mf8(vint8mf8x2_t src, size_t index);
vint8mf8x2_t __riscv_vset_v_i8mf8_i8mf8x(vint8mf8x2_t dest, size_t index, vint8mf8_t val);

The LLVM implementation has a proof-of-concept available:

@lhtin
Copy link
Contributor

lhtin commented Feb 16, 2023

@eopXD Maybe the return value with tuple type should directly return instead of using an argument to receive. It no need.

void __riscv_vlseg2e8_v_i8mf8(vint8mf8x2_t *v_tuple, const int8_t *base, size_t vl);

change to:

vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8(const int8_t *base, size_t vl);

Copy link
Collaborator

@nick-knight nick-knight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the tuple types defined anywhere, although there are 300k LoC added in this PR and I may have skimmed over them. IIRC, they were removed a while back, perhaps here.

From an API perspective, I agree with other reviewers, suggesting that these loads return the tuple by value, to match other loads. My assumption is that these functions ("intrinsics") can be inlined by the compiler, so the ABI calling convention does not constrain register allocation in any way. (This assumption is supported by my experience with LLVM's implementation of these intrinsics.)

@zhongjuzhe
Copy link

Thanks for the PR that we can have tuple type finally.
Turns out GCC 13 release is comming that we can't have segment loads/stores in GCC 13.
I am gonna support them in GCC 14.
Can you tell me whether the next PR of the document is rounding mode version of fixed-point/floating-point intrinsics?

Thanks.

@eric-xtang1008
Copy link

Should the name of vget/vset intrinsics be changed according to the tuple-type?

vint8mf8_t __riscv_vget_v_u64m8_u64m4(vint8mf8x2_t src, size_t index);

changed like this:

vint8mf8_t __riscv_vget_v_i8mf8x2_i8mf8(vint8mf8x2_t src, size_t index);

@eopXD eopXD changed the title Add tuple-type variant for segment load store Improve segment load/store interface with tuple types Mar 28, 2023
@eopXD eopXD force-pushed the eopc/tuple-type-for-seg-load-store branch from 4e3524d to 7704a5e Compare April 2, 2023 03:13
@eopXD
Copy link
Collaborator Author

eopXD commented Apr 2, 2023

Thanks for all the comment above. The latest force-push includes the following change:

@Incarnation-p-lee
Copy link

Cool, @eopXD, Thanks for making this happen!

Copy link

@Incarnation-p-lee Incarnation-p-lee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @eopXD !

@zhongjuzhe
Copy link

Hi, I found there is an issue with the naming of vset intrinsic:
vint8mf8x2_t _riscv_vset_vi8mf8x2_i8mf8(vint8mf8x2_t dest, size_t index, vint8mf8_t val);

For normal LMUL > 1:
_riscv_vset_vf32m1_f32m2(dest, 0, val);

I think the tuple vset naming should be changed into:
vint8mf8x2_t _riscv_vset_vi8mf8_i8mf8x2(vint8mf8x2_t dest, size_t index, vint8mf8_t val);

@kito-cheng
Copy link
Collaborator

I would like segment load/store have consistent naming rule for the return value part :

vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2(const int8_t *base, size_t vl);
vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2_m(vbool64_t mask, const int8_t *base, size_t vl);
vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2_tu(vint8mf8x2_t maskedoff_tuple, const int8_t *base, size_t vl);
vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2_tum(vbool64_t mask, vint8mf8x2_t maskedoff_tuple, const int8_t *base, size_t vl);
vint8mf8x2_t __riscv_vlseg2e8_v_i8mf8x2_mu(vbool64_t mask, vint8mf8x2_t maskedoff_tuple, const int8_t *base, size_t vl);

void __riscv_vsseg2e8_v_i8mf8x2 (int8_t *base, vint8mf8x2_t v_tuple, size_t vl);
void __riscv_vsseg2e8_v_i8mf8x2_m (vbool64_t mask, int8_t *base, vint8mf8x2_t v_tuple, size_t vl);

@Incarnation-p-lee
Copy link

Incarnation-p-lee commented Apr 21, 2023

Just notice it may generate some test functions like this (take vsoxseg7ei64.c as an example), not sure if there is something missing or not.

void test_vsoxseg7ei64_v_f64m1(float64_t *base, vuint64m1_t bindex, vfloat64m1x7_t v_tuple, size_t vl) {
  return __riscv_vsoxseg7ei64_v_f64m1(base, bindex, v_tuple, vl);
}

void test_vsoxseg7ei64_v_i8mf8(int8_t *base, vuint64m1_t bindex, vint8mf8x7_t v_tuple, size_t vl) {
  return __riscv_vsoxseg7ei64_v_i8mf8(base, bindex, v_tuple, vl);
}

void test_vsoxseg7ei64_v_i8mf4(int8_t *base, vuint64m2_t bindex, vint8mf4x7_t v_tuple, size_t vl) {
  return __riscv_vsoxseg7ei64_v_i8mf4(base, bindex, v_tuple, vl);
}

@eopXD
Copy link
Collaborator Author

eopXD commented Apr 21, 2023

Just notice it may generate some test functions like this (take vsoxseg7ei64.c as an example), not sure if there is something missing or not.

void test_vsoxseg7ei64_v_f64m1(float64_t *base, vuint64m1_t bindex, vfloat64m1x7_t v_tuple, size_t vl) {
  return __riscv_vsoxseg7ei64_v_f64m1(base, bindex, v_tuple, vl);
}

void test_vsoxseg7ei64_v_i8mf8(int8_t *base, vuint64m1_t bindex, vint8mf8x7_t v_tuple, size_t vl) {
  return __riscv_vsoxseg7ei64_v_i8mf8(base, bindex, v_tuple, vl);
}

void test_vsoxseg7ei64_v_i8mf4(int8_t *base, vuint64m2_t bindex, vint8mf4x7_t v_tuple, size_t vl) {
  return __riscv_vsoxseg7ei64_v_i8mf4(base, bindex, v_tuple, vl);
}

The interface looks as intended. May you explain more, thank you.

@Incarnation-p-lee
Copy link

Just notice it may generate some test functions like this (take vsoxseg7ei64.c as an example), not sure if there is something missing or not.

void test_vsoxseg7ei64_v_f64m1(float64_t *base, vuint64m1_t bindex, vfloat64m1x7_t v_tuple, size_t vl) {
  return __riscv_vsoxseg7ei64_v_f64m1(base, bindex, v_tuple, vl);
}

void test_vsoxseg7ei64_v_i8mf8(int8_t *base, vuint64m1_t bindex, vint8mf8x7_t v_tuple, size_t vl) {
  return __riscv_vsoxseg7ei64_v_i8mf8(base, bindex, v_tuple, vl);
}

void test_vsoxseg7ei64_v_i8mf4(int8_t *base, vuint64m2_t bindex, vint8mf4x7_t v_tuple, size_t vl) {
  return __riscv_vsoxseg7ei64_v_i8mf4(base, bindex, v_tuple, vl);
}

The interface looks as intended. May you explain more, thank you.

Sorry for misleading you, I mean the test function was declared as void, but the body try to return something. I am not sure if it is expected or not.

@eopXD
Copy link
Collaborator Author

eopXD commented Apr 21, 2023

The interface looks as intended. May you explain more, thank you.

Sorry for misleading you, I mean the test function was declared as void, but the body try to return something. I am not sure if it is expected or not.

It is legal and should be fine, the store functions have a return type of void ;)

@Incarnation-p-lee
Copy link

The interface looks as intended. May you explain more, thank you.

Sorry for misleading you, I mean the test function was declared as void, but the body try to return something. I am not sure if it is expected or not.

It is legal and should be fine, the store functions have a return type of void ;)

Oh, I see, you would like to test the return type is void for the store intrinsic. That makes sense to me, thanks for the explanation.

@eopXD eopXD force-pushed the eopc/tuple-type-for-seg-load-store branch 2 times, most recently from 78ad251 to 5e2f438 Compare April 25, 2023 07:40
@eopXD
Copy link
Collaborator Author

eopXD commented Apr 25, 2023

Change:

  • Fixed vset function name as @zhongjuzhe pointed out.
  • Fixed segment load/store function name for the missing trailing x{NF} as @kito-cheng pointed out.

vathpela pushed a commit to vathpela/gcc that referenced this pull request May 3, 2023
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
@Incarnation-p-lee
Copy link

Just FYI that GCC upstream has supported the segment-related load/store already. Thanks @zhongjuzhe and @kito-cheng for making it happen.

@eopXD eopXD force-pushed the eopc/tuple-type-for-seg-load-store branch from 5e2f438 to 4025e43 Compare June 3, 2023 02:45
@eopXD eopXD merged commit 745ce55 into master Jun 12, 2023
@eopXD eopXD deleted the eopc/tuple-type-for-seg-load-store branch July 19, 2023 12:15
fanghuaqi pushed a commit to riscv-mcu/riscv-gcc that referenced this pull request Jul 31, 2023
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/ruyi-gcc that referenced this pull request Feb 1, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
XYenChi pushed a commit to XYenChi/gcc that referenced this pull request Feb 28, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
yulong18 pushed a commit to yulong18/ruyisdk-gcc that referenced this pull request Mar 4, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/ruyi-gcc that referenced this pull request Mar 12, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/ruyi-gcc that referenced this pull request Mar 12, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/ruyi-gcc that referenced this pull request Mar 12, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/ruyi-gcc that referenced this pull request Mar 13, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/ruyi-gcc that referenced this pull request Mar 13, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/ruyi-gcc that referenced this pull request Mar 13, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/ruyi-gcc that referenced this pull request Mar 15, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/ruyi-gcc that referenced this pull request Mar 17, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/gcc that referenced this pull request Mar 19, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/gcc that referenced this pull request Mar 20, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/gcc that referenced this pull request Mar 25, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
XYenChi pushed a commit to XYenChi/gcc that referenced this pull request Mar 25, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/gcc that referenced this pull request Mar 27, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Liaoshihua pushed a commit to Liaoshihua/gcc that referenced this pull request Mar 27, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
XYenChi pushed a commit to XYenChi/gcc that referenced this pull request Apr 8, 2024
Add segment load/store intrinsics:
riscv-non-isa/rvv-intrinsic-doc#198

gcc/ChangeLog:

	* config/riscv/riscv-vector-builtins-bases.cc (fold_fault_load):
	New function.
	(class vlseg): New class.
	(class vsseg): Ditto.
	(class vlsseg): Ditto.
	(class vssseg): Ditto.
	(class seg_indexed_load): Ditto.
	(class seg_indexed_store): Ditto.
	(class vlsegff): Ditto.
	(BASE): Ditto.
	* config/riscv/riscv-vector-builtins-bases.h: Ditto.
	* config/riscv/riscv-vector-builtins-functions.def (vlseg):
	Ditto.
	(vsseg): Ditto.
	(vlsseg): Ditto.
	(vssseg): Ditto.
	(vluxseg): Ditto.
	(vloxseg): Ditto.
	(vsuxseg): Ditto.
	(vsoxseg): Ditto.
	(vlsegff): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.cc (struct
	seg_loadstore_def): Ditto.
	(struct seg_indexed_loadstore_def): Ditto.
	(struct seg_fault_load_def): Ditto.
	(SHAPE): Ditto.
	* config/riscv/riscv-vector-builtins-shapes.h: Ditto.
	* config/riscv/riscv-vector-builtins.cc
	(function_builder::append_nf): New function.
	* config/riscv/riscv-vector-builtins.def (vfloat32m1x2_t):
	Change ptr from double into float.
	(vfloat32m1x3_t): Ditto.
	(vfloat32m1x4_t): Ditto.
	(vfloat32m1x5_t): Ditto.
	(vfloat32m1x6_t): Ditto.
	(vfloat32m1x7_t): Ditto.
	(vfloat32m1x8_t): Ditto.
	(vfloat32m2x2_t): Ditto.
	(vfloat32m2x3_t): Ditto.
	(vfloat32m2x4_t): Ditto.
	(vfloat32m4x2_t): Ditto.
	* config/riscv/riscv-vector-builtins.h: Add segment intrinsics.
	* config/riscv/riscv-vsetvl.cc (fault_first_load_p): Adapt for
	segment ff load.
	* config/riscv/riscv.md: Add segment instructions.
	* config/riscv/vector-iterators.md: Support segment intrinsics.
	* config/riscv/vector.md (@pred_unit_strided_load<mode>): New
	pattern.
	(@pred_unit_strided_store<mode>): Ditto.
	(@pred_strided_load<mode>): Ditto.
	(@pred_strided_store<mode>): Ditto.
	(@pred_fault_load<mode>): Ditto.
	(@pred_indexed_<order>load<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>load<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>load<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>load<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>load<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>load<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>load<V64T:mode><V64I:mode>): Ditto.
	(@pred_indexed_<order>store<V1T:mode><V1I:mode>): Ditto.
	(@pred_indexed_<order>store<V2T:mode><V2I:mode>): Ditto.
	(@pred_indexed_<order>store<V4T:mode><V4I:mode>): Ditto.
	(@pred_indexed_<order>store<V8T:mode><V8I:mode>): Ditto.
	(@pred_indexed_<order>store<V16T:mode><V16I:mode>): Ditto.
	(@pred_indexed_<order>store<V32T:mode><V32I:mode>): Ditto.
	(@pred_indexed_<order>store<V64T:mode><V64I:mode>): Ditto.

Signed-off-by: Ju-Zhe Zhong <juzhe.zhong@rivai.ai>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the tuple type API for segment load store as compiler optional feature
8 participants