Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4abfe07
Initial
Simn Mar 16, 2026
1f84a42
Refactor Int64: move implementation logic to Int64Native, make Int64 …
Copilot Mar 17, 2026
338bed4
Refactor Int32 to use Int32Native pattern matching Int64 architecture…
Copilot Mar 17, 2026
1ce1d39
Merge branch 'development' into haxe-numeric
Simn Mar 17, 2026
f9aad9f
Implement UInt64 on top of Int64Native with unsigned ops routed throu…
Copilot Mar 17, 2026
27dff2b
Add toFloat, fix toInt truncation, and add MIN/MAX constants to Int64…
Copilot Mar 17, 2026
c2d1ea6
Redesign `Int32` operator overloads with scalable type-parameter boun…
Copilot Mar 17, 2026
2efdc3f
Merge branch 'development' into haxe-numeric
Simn Mar 17, 2026
6bd89f2
Optimize away trivial inlined abstract constructor blocks (#12839)
Copilot Mar 18, 2026
ef57225
Add haxe.UInt32; deprecate toplevel UInt as typedef alias (non-Flash)…
Copilot Mar 18, 2026
5c5a895
Align and unify public API across Int32, UInt32, Int64, UInt64; chang…
Copilot Mar 19, 2026
7a69f91
does anything break if I delete all this?
Simn Mar 19, 2026
b2837e4
align JVM's Int64 with the others
Simn Mar 19, 2026
df50f74
this changes allowed comparison combinations, but does it break any t…
Simn Mar 19, 2026
7427a2a
Merge branch 'development' into haxe-numeric
Simn Mar 19, 2026
d03bf34
Merge branch 'development' into haxe-numeric
Simn Mar 20, 2026
8afbfe2
Strict numeric types: remove implicit float/integer casts, add wideni…
Copilot Mar 20, 2026
62c3bb4
Merge branch 'development' into haxe-numeric
Simn Mar 20, 2026
3906788
Merge branch 'development' into haxe-numeric
Simn Mar 20, 2026
48c3b7f
Merge branch 'development' into haxe-numeric
Simn Mar 20, 2026
c151489
bring back deleted test
Simn Mar 20, 2026
324b661
doesn't work for now
Simn Mar 20, 2026
eeb1534
Dispatch numeric comparison operators to Native types for direct code…
Copilot Mar 20, 2026
0e9ebb0
cleanup
Simn Mar 20, 2026
b719675
Align numeric types API: isZero/isNeg → instance methods, add copy(),…
Copilot Mar 21, 2026
418d14c
Address unresolved review comments: genhl.ml UInt32 design, Lua trunc…
Copilot Mar 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/generators/genhl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,15 @@ let member_fun c t =

let rec unsigned t =
match follow t with
| TAbstract ({ a_path = ["haxe"],"UInt32" },_) -> true
(* haxe.UInt32 is intentionally not listed here. Its operations (division, comparison,
shift) are handled via @:op abstract operators that call Int32Helper/Int32Direct
functions. These helpers use `v < 0` to detect the high bit for unsigned conversion
(e.g. utoFloat). After Haxe inlines these helpers with a UInt32 argument, the
comparison `v < 0` retains UInt32 as the type of `v`. If unsigned returned true for
UInt32, that comparison would be emitted as an unsigned `jugte` (always false),
breaking the conversion. To enable native HL unsigned opcodes for UInt32 in the
future, the helper functions would need native HL overrides that use unsigned opcodes
directly rather than sign-based Int tricks. *)
| TAbstract (a,pl) -> unsigned (Abstract.get_underlying_type a pl)
| _ -> false

Expand Down Expand Up @@ -462,7 +470,7 @@ let rec to_type ?tref ctx t =
if Meta.has Meta.CoreType a.a_meta then
(match a.a_path with
| [], "Void" -> HVoid
| [], "Int" | ["haxe"], "UInt32" -> HI32
| [], "Int" -> HI32
| [], "Float" -> HF64
| [], "Single" -> HF32
| [], "Bool" -> HBool
Expand Down
24 changes: 0 additions & 24 deletions src/generators/genjvm.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1681,30 +1681,6 @@ class texpr_to_jvm
let tl,tr = self#call_arguments cf.cf_type el in
jm#invokestatic c.cl_path (String.sub cf.cf_name 1 (String.length cf.cf_name - 1)) (method_sig tl tr);
tr
| TField(_,FStatic({cl_path = (["haxe"],"Int64$Int64_Impl_")},{cf_name = "make"})) ->
begin match el with
| [{eexpr = TConst (TInt i1)};{eexpr = TConst (TInt i2)}] ->
let high = Int64.of_int32 i1 in
let high = Int64.shift_left high 32 in
let low = Int64.of_int32 i2 in
let low = Int64.logand low (Int64.of_string "0xFFFFFFFF") in
let i = Int64.logor high low in
jm#get_code#lconst i;
Some TLong
| [e1;e2] ->
self#texpr (rvalue_sig TLong) e1;
jm#cast TLong;
jm#get_code#iconst (Int32.of_int 32);
jm#get_code#lshl;
self#texpr (rvalue_sig TLong) e2;
jm#cast TLong;
jm#get_code#lconst (Int64.of_string "0xFFFFFFFF");
jm#get_code#land_;
jm#get_code#lor_;
Some TLong
| _ ->
die "" __LOC__
end
| TIdent "__array__" | TField(_,FStatic({cl_path = (["jvm"],"NativeArray")},{cf_name = "make"})) ->
begin match follow tr with
| TInst({cl_path = (["jvm"],"NativeArray")},[t]) ->
Expand Down
4 changes: 4 additions & 0 deletions src/optimization/inline.ml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ let api_inline2 basic platform c field params p =
Some (stringv())
| TAbstract ({ a_path = [],"UInt" }, []) ->
Some (stringv())
| TAbstract ({ a_path = ["haxe"],"UInt32" }, []) ->
(* Note: Std.string(v:UInt32) is rewritten to v.toString() during typing,
so this case is never reached in practice. Kept for completeness. *)
Some (stringv())
| TAbstract ({ a_path = [],"Bool" }, []) ->
Some (stringv())
| _ ->
Expand Down
Loading
Loading