Skip to content

Commit 606e30a

Browse files
psvriAmanieu
authored andcommitted
Adding doc links for arm crypto and aes intrinsics
1 parent 250a18a commit 606e30a

File tree

4 files changed

+77
-0
lines changed

4 files changed

+77
-0
lines changed

crates/core_arch/src/aarch64/neon/mod.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -664,6 +664,8 @@ pub unsafe fn vld1q_p16(ptr: *const p16) -> poly16x8_t {
664664
}
665665

666666
/// Load multiple single-element structures to one, two, three, or four registers.
667+
///
668+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_p64)
667669
#[inline]
668670
#[target_feature(enable = "neon,aes")]
669671
#[cfg_attr(test, assert_instr(ldr))]
@@ -673,6 +675,8 @@ pub unsafe fn vld1_p64(ptr: *const p64) -> poly64x1_t {
673675
}
674676

675677
/// Load multiple single-element structures to one, two, three, or four registers.
678+
///
679+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_p64)
676680
#[inline]
677681
#[target_feature(enable = "neon,aes")]
678682
#[cfg_attr(test, assert_instr(ldr))]
@@ -959,6 +963,8 @@ pub unsafe fn vst1q_p16(ptr: *mut p16, a: poly16x8_t) {
959963
}
960964

961965
// Store multiple single-element structures from one, two, three, or four registers.
966+
///
967+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_p64)
962968
#[inline]
963969
#[target_feature(enable = "neon,aes")]
964970
#[cfg_attr(test, assert_instr(str))]
@@ -969,6 +975,8 @@ pub unsafe fn vst1_p64(ptr: *mut p64, a: poly64x1_t) {
969975
}
970976

971977
// Store multiple single-element structures from one, two, three, or four registers.
978+
///
979+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_p64)
972980
#[inline]
973981
#[target_feature(enable = "neon,aes")]
974982
#[cfg_attr(test, assert_instr(str))]
@@ -3387,7 +3395,10 @@ pub unsafe fn vsliq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x
33873395
static_assert_imm4!(N);
33883396
transmute(vsliq_n_s16_(transmute(a), transmute(b), N))
33893397
}
3398+
33903399
/// Shift Left and Insert (immediate)
3400+
///
3401+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_p64)
33913402
#[inline]
33923403
#[target_feature(enable = "neon,aes")]
33933404
#[cfg_attr(test, assert_instr(sli, N = 1))]
@@ -3397,7 +3408,10 @@ pub unsafe fn vsli_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1
33973408
static_assert!(N: i32 where N >= 0 && N <= 63);
33983409
transmute(vsli_n_s64_(transmute(a), transmute(b), N))
33993410
}
3411+
34003412
/// Shift Left and Insert (immediate)
3413+
///
3414+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_p64)
34013415
#[inline]
34023416
#[target_feature(enable = "neon,aes")]
34033417
#[cfg_attr(test, assert_instr(sli, N = 1))]
@@ -3607,7 +3621,10 @@ pub unsafe fn vsriq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x
36073621
static_assert!(N: i32 where N >= 1 && N <= 16);
36083622
transmute(vsriq_n_s16_(transmute(a), transmute(b), N))
36093623
}
3624+
36103625
/// Shift Right and Insert (immediate)
3626+
///
3627+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_p64)
36113628
#[inline]
36123629
#[target_feature(enable = "neon,aes")]
36133630
#[cfg_attr(test, assert_instr(sri, N = 1))]
@@ -3617,7 +3634,10 @@ pub unsafe fn vsri_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1
36173634
static_assert!(N: i32 where N >= 1 && N <= 64);
36183635
transmute(vsri_n_s64_(transmute(a), transmute(b), N))
36193636
}
3637+
36203638
/// Shift Right and Insert (immediate)
3639+
///
3640+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_p64)
36213641
#[inline]
36223642
#[target_feature(enable = "neon,aes")]
36233643
#[cfg_attr(test, assert_instr(sri, N = 1))]

crates/core_arch/src/arm/neon.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ pub unsafe fn vld1q_p16(ptr: *const p16) -> poly16x8_t {
289289
}
290290

291291
/// Load multiple single-element structures to one, two, three, or four registers.
292+
///
293+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_p64)
292294
#[inline]
293295
#[target_feature(enable = "neon,aes")]
294296
#[cfg_attr(test, assert_instr(vldr))]
@@ -297,6 +299,8 @@ pub unsafe fn vld1_p64(ptr: *const p64) -> poly64x1_t {
297299
}
298300

299301
/// Load multiple single-element structures to one, two, three, or four registers.
302+
///
303+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_p64)
300304
#[inline]
301305
#[target_feature(enable = "neon,aes")]
302306
#[cfg_attr(test, assert_instr("vld1.64"))]
@@ -481,6 +485,8 @@ pub unsafe fn vst1q_p16(ptr: *mut p16, a: poly16x8_t) {
481485
}
482486

483487
/// Store multiple single-element structures from one, two, three, or four registers.
488+
///
489+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1_p64)
484490
#[inline]
485491
#[target_feature(enable = "neon,aes,v8")]
486492
#[cfg_attr(test, assert_instr("vst1.64"))]
@@ -489,6 +495,8 @@ pub unsafe fn vst1_p64(ptr: *mut p64, a: poly64x1_t) {
489495
}
490496

491497
/// Store multiple single-element structures from one, two, three, or four registers.
498+
///
499+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vst1q_p64)
492500
#[inline]
493501
#[target_feature(enable = "neon,aes,v8")]
494502
#[cfg_attr(test, assert_instr("vst1.64"))]
@@ -1033,6 +1041,7 @@ pub unsafe fn vsli_n_p16<const N: i32>(a: poly16x4_t, b: poly16x4_t) -> poly16x4
10331041
int16x4_t(n, n, n, n),
10341042
))
10351043
}
1044+
10361045
/// Shift Left and Insert (immediate)
10371046
#[inline]
10381047
#[target_feature(enable = "neon,v7")]
@@ -1047,7 +1056,10 @@ pub unsafe fn vsliq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x
10471056
int16x8_t(n, n, n, n, n, n, n, n),
10481057
))
10491058
}
1059+
10501060
/// Shift Left and Insert (immediate)
1061+
///
1062+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsli_n_p64)
10511063
#[inline]
10521064
#[target_feature(enable = "neon,v7,aes")]
10531065
#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
@@ -1060,7 +1072,10 @@ pub unsafe fn vsli_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1
10601072
int64x1_t(N as i64),
10611073
))
10621074
}
1075+
10631076
/// Shift Left and Insert (immediate)
1077+
///
1078+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsliq_n_p64)
10641079
#[inline]
10651080
#[target_feature(enable = "neon,v7,aes")]
10661081
#[cfg_attr(test, assert_instr("vsli.64", N = 1))]
@@ -1317,7 +1332,10 @@ pub unsafe fn vsriq_n_p16<const N: i32>(a: poly16x8_t, b: poly16x8_t) -> poly16x
13171332
int16x8_t(n, n, n, n, n, n, n, n),
13181333
))
13191334
}
1335+
13201336
/// Shift Right and Insert (immediate)
1337+
///
1338+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsri_n_p64)
13211339
#[inline]
13221340
#[target_feature(enable = "neon,v7,aes")]
13231341
#[cfg_attr(test, assert_instr("vsri.64", N = 1))]
@@ -1330,7 +1348,10 @@ pub unsafe fn vsri_n_p64<const N: i32>(a: poly64x1_t, b: poly64x1_t) -> poly64x1
13301348
int64x1_t(-N as i64),
13311349
))
13321350
}
1351+
13331352
/// Shift Right and Insert (immediate)
1353+
///
1354+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsriq_n_p64)
13341355
#[inline]
13351356
#[target_feature(enable = "neon,v7,aes")]
13361357
#[cfg_attr(test, assert_instr("vsri.64", N = 1))]

crates/core_arch/src/arm_shared/crypto.rs

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ extern "unadjusted" {
5252
use stdarch_test::assert_instr;
5353

5454
/// AES single round encryption.
55+
///
56+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaeseq_u8)
5557
#[inline]
5658
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "aes"))]
5759
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -61,6 +63,8 @@ pub unsafe fn vaeseq_u8(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t {
6163
}
6264

6365
/// AES single round decryption.
66+
///
67+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaesdq_u8)
6468
#[inline]
6569
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "aes"))]
6670
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -70,6 +74,8 @@ pub unsafe fn vaesdq_u8(data: uint8x16_t, key: uint8x16_t) -> uint8x16_t {
7074
}
7175

7276
/// AES mix columns.
77+
///
78+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaesmcq_u8)
7379
#[inline]
7480
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "aes"))]
7581
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -79,6 +85,8 @@ pub unsafe fn vaesmcq_u8(data: uint8x16_t) -> uint8x16_t {
7985
}
8086

8187
/// AES inverse mix columns.
88+
///
89+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vaesimcq_u8)
8290
#[inline]
8391
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "aes"))]
8492
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -88,6 +96,8 @@ pub unsafe fn vaesimcq_u8(data: uint8x16_t) -> uint8x16_t {
8896
}
8997

9098
/// SHA1 fixed rotate.
99+
///
100+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha1h_u32)
91101
#[inline]
92102
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
93103
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -97,6 +107,8 @@ pub unsafe fn vsha1h_u32(hash_e: u32) -> u32 {
97107
}
98108

99109
/// SHA1 hash update accelerator, choose.
110+
///
111+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha1cq_u32)
100112
#[inline]
101113
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
102114
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -106,6 +118,8 @@ pub unsafe fn vsha1cq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) ->
106118
}
107119

108120
/// SHA1 hash update accelerator, majority.
121+
///
122+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha1mq_u32)
109123
#[inline]
110124
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
111125
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -115,6 +129,8 @@ pub unsafe fn vsha1mq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) ->
115129
}
116130

117131
/// SHA1 hash update accelerator, parity.
132+
///
133+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha1pq_u32)
118134
#[inline]
119135
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
120136
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -124,6 +140,8 @@ pub unsafe fn vsha1pq_u32(hash_abcd: uint32x4_t, hash_e: u32, wk: uint32x4_t) ->
124140
}
125141

126142
/// SHA1 schedule update accelerator, first part.
143+
///
144+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha1su0q_u32)
127145
#[inline]
128146
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
129147
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -133,6 +151,8 @@ pub unsafe fn vsha1su0q_u32(w0_3: uint32x4_t, w4_7: uint32x4_t, w8_11: uint32x4_
133151
}
134152

135153
/// SHA1 schedule update accelerator, second part.
154+
///
155+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha1su1q_u32)
136156
#[inline]
137157
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
138158
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -142,6 +162,8 @@ pub unsafe fn vsha1su1q_u32(tw0_3: uint32x4_t, w12_15: uint32x4_t) -> uint32x4_t
142162
}
143163

144164
/// SHA256 hash update accelerator.
165+
///
166+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha256hq_u32)
145167
#[inline]
146168
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
147169
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -155,6 +177,8 @@ pub unsafe fn vsha256hq_u32(
155177
}
156178

157179
/// SHA256 hash update accelerator, upper part.
180+
///
181+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha256h2q_u32)
158182
#[inline]
159183
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
160184
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -168,6 +192,8 @@ pub unsafe fn vsha256h2q_u32(
168192
}
169193

170194
/// SHA256 schedule update accelerator, first part.
195+
///
196+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha256su0q_u32)
171197
#[inline]
172198
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
173199
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]
@@ -177,6 +203,8 @@ pub unsafe fn vsha256su0q_u32(w0_3: uint32x4_t, w4_7: uint32x4_t) -> uint32x4_t
177203
}
178204

179205
/// SHA256 schedule update accelerator, second part.
206+
///
207+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vsha256su1q_u32)
180208
#[inline]
181209
#[cfg_attr(not(target_arch = "arm"), target_feature(enable = "sha2"))]
182210
#[cfg_attr(target_arch = "arm", target_feature(enable = "crypto,v8"))]

crates/core_arch/src/arm_shared/neon/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,6 +1284,8 @@ pub unsafe fn vld1q_lane_p16<const LANE: i32>(ptr: *const p16, src: poly16x8_t)
12841284
}
12851285

12861286
/// Load one single-element structure to one lane of one register.
1287+
///
1288+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_lane_p64)
12871289
#[inline]
12881290
#[target_feature(enable = "neon,aes")]
12891291
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
@@ -1300,6 +1302,8 @@ pub unsafe fn vld1_lane_p64<const LANE: i32>(ptr: *const p64, src: poly64x1_t) -
13001302
}
13011303

13021304
/// Load one single-element structure to one lane of one register.
1305+
///
1306+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_lane_p64)
13031307
#[inline]
13041308
#[target_feature(enable = "neon,aes")]
13051309
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
@@ -1675,6 +1679,8 @@ pub unsafe fn vld1_dup_f32(ptr: *const f32) -> float32x2_t {
16751679
}
16761680

16771681
/// Load one single-element structure and Replicate to all lanes (of one register).
1682+
///
1683+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1_dup_p64)
16781684
#[inline]
16791685
#[target_feature(enable = "neon,aes")]
16801686
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]
@@ -1696,6 +1702,8 @@ pub unsafe fn vld1_dup_p64(ptr: *const p64) -> poly64x1_t {
16961702
}
16971703

16981704
/// Load one single-element structure and Replicate to all lanes (of one register).
1705+
///
1706+
/// [Arm's documentation](https://developer.arm.com/architectures/instruction-sets/intrinsics/vld1q_dup_p64)
16991707
#[inline]
17001708
#[target_feature(enable = "neon,aes")]
17011709
#[cfg_attr(target_arch = "arm", target_feature(enable = "v7"))]

0 commit comments

Comments
 (0)