about summary refs log tree commit diff
path: root/tests/codegen/patchable-function-entry
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-02-16 09:53:01 +0000
committerbors <bors@rust-lang.org>2024-02-16 09:53:01 +0000
commitc9fcfea90ae62704cd44bdf97eb97f9df4bda8b4 (patch)
tree50890d271c94f3c91ad578b304dfd9c4e4463ec4 /tests/codegen/patchable-function-entry
parentf0a344db51736508b4aede0e0a501514fa9364ef (diff)
parentd55fdb25ce982f13496df04bd64c960687b43337 (diff)
downloadrust-c9fcfea90ae62704cd44bdf97eb97f9df4bda8b4.tar.gz
rust-c9fcfea90ae62704cd44bdf97eb97f9df4bda8b4.zip
Auto merge of #120500 - oli-obk:intrinsics2.0, r=WaffleLapkin
Implement intrinsics with fallback bodies

fixes #93145 (though we can port many more intrinsics)
cc #63585

The way this works is that the backend logic for generating custom code for intrinsics has been made fallible. The only failure path is "this intrinsic is unknown". The `Instance` (that was `InstanceDef::Intrinsic`) then gets converted to `InstanceDef::Item`, which represents the fallback body. A regular function call to that body is then codegenned. This is currently implemented for

* codegen_ssa (so llvm and gcc)
* codegen_cranelift

other backends will need to adjust, but they can just keep doing what they were doing if they prefer (though adding new intrinsics to the compiler will then require them to implement them, instead of getting the fallback body).

cc `@scottmcm` `@WaffleLapkin`

### todo

* [ ] miri support
* [x] default intrinsic name to name of function instead of requiring it to be specified in attribute
* [x] make sure that the bodies are always available (must be collected for metadata)
Diffstat (limited to 'tests/codegen/patchable-function-entry')
0 files changed, 0 insertions, 0 deletions