File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 235
235
(provide (= result (clz (rev x)))))
236
236
(instantiate ctz bv_unary_8_to_64)
237
237
238
+ (spec (popcnt x)
239
+ (provide (= result (popcnt x))))
240
+ (instantiate popcnt bv_unary_8_to_64)
241
+
238
242
(spec (load flags p offset)
239
243
(modifies clif_load loaded_value)
240
244
(provide
Original file line number Diff line number Diff line change 2869
2869
2870
2870
;; Helper for emitting `MInst.MovToFpu` instructions.
2871
2871
(decl mov_to_fpu (Reg ScalarSize) Reg)
2872
+ (attr mov_to_fpu (veri chain))
2872
2873
(rule (mov_to_fpu x size)
2873
2874
(let ((dst WritableReg (temp_writable_reg $I8X16))
2874
2875
(_ Unit (emit (MInst.MovToFpu dst x size))))
2875
2876
dst))
2876
2877
(rule 1 (mov_to_fpu x (ScalarSize.Size16))
2877
2878
(if-let $false (use_fp16))
2878
- (mov_to_fpu x (ScalarSize.Size32)))
2879
+ (let ((dst WritableReg (temp_writable_reg $I8X16))
2880
+ (_ Unit (emit (MInst.MovToFpu dst x (ScalarSize.Size32)))))
2881
+ dst))
2879
2882
2880
2883
;; Helper for emitting `MInst.FpuMoveFPImm` instructions.
2881
2884
(decl fpu_move_fp_imm (ASIMDFPModImm ScalarSize) Reg)
Original file line number Diff line number Diff line change 1899
1899
;; if ty == i128:
1900
1900
;; mov out_hi, 0
1901
1901
1902
- (rule (lower (has_type $I8 (popcnt x)))
1902
+ (rule popcnt_8 (lower (has_type $I8 (popcnt x)))
1903
1903
(let ((tmp Reg (mov_to_fpu x (ScalarSize.Size32)))
1904
1904
(nbits Reg (vec_cnt tmp (VectorSize.Size8x8))))
1905
1905
(mov_from_vec nbits 0 (ScalarSize.Size8))))
1906
1906
1907
1907
;; Note that this uses `addp` instead of `addv` as it's usually cheaper.
1908
- (rule (lower (has_type $I16 (popcnt x)))
1908
+ (rule popcnt_16 (lower (has_type $I16 (popcnt x)))
1909
1909
(let ((tmp Reg (mov_to_fpu x (ScalarSize.Size32)))
1910
1910
(nbits Reg (vec_cnt tmp (VectorSize.Size8x8)))
1911
1911
(added Reg (addp nbits nbits (VectorSize.Size8x8))))
1912
1912
(mov_from_vec added 0 (ScalarSize.Size8))))
1913
1913
1914
- (rule (lower (has_type $I32 (popcnt x)))
1914
+ (rule popcnt_32 (lower (has_type $I32 (popcnt x)))
1915
1915
(let ((tmp Reg (mov_to_fpu x (ScalarSize.Size32)))
1916
1916
(nbits Reg (vec_cnt tmp (VectorSize.Size8x8)))
1917
1917
(added Reg (addv nbits (VectorSize.Size8x8))))
1918
1918
(mov_from_vec added 0 (ScalarSize.Size8))))
1919
1919
1920
- (rule (lower (has_type $I64 (popcnt x)))
1920
+ (rule popcnt_64 (lower (has_type $I64 (popcnt x)))
1921
1921
(let ((tmp Reg (mov_to_fpu x (ScalarSize.Size64)))
1922
1922
(nbits Reg (vec_cnt tmp (VectorSize.Size8x8)))
1923
1923
(added Reg (addv nbits (VectorSize.Size8x8))))
Original file line number Diff line number Diff line change 409
409
410
410
(extern const $I8X8 Type)
411
411
(extern const $I8X16 Type)
412
+ (model I8X16 (const 128))
412
413
(extern const $I16X4 Type)
413
414
(extern const $I16X8 Type)
414
415
(extern const $I32X2 Type)
You can’t perform that action at this time.
0 commit comments